#ifndef PARTIAL_MSR2_A_H_
#define PARTIAL_MSR2_A_H_

#include "PartialMSR2Base.h"


namespace smartcomparator
{
	namespace simfunctions
	{

		class SMART_COMPARATOR_API PartialMSR2A : public PartialMSR2Base
		{
		public:
			struct ParamsA {
				unsigned int k;
			};

		private:
			Matrices::SuperMatrixPtr 	mFrequencies;
			ParamsA 					mParamsA;

			//Features from weighted words to features from freq words
			boost::shared_ptr< std::vector<size_t> > mWWordsToFWords;


		public:
			PartialMSR2A(
				Matrices::SuperMatrixPtr&	pWeightsMatrix,
				SimilarityFunctionPtr&		pSimilarityFunction,
				SynsetClassSetPtrS&			pSynsetClasses,
				Params&						pParams,
				ParamsA&					pParamsA );

			virtual ~PartialMSR2A();


			virtual double CountSimilarity(
				Matrices::CompressedVector& pMatrixRow1,					// i think so
				Matrices::CompressedVector& pMatrixRow2,					// i think so
				size_t 						pLemmaIndex1,					// yup
				size_t 						pLemmaIndex2,					// yup
				const std::set<size_t>&		pNonZeroFeaturesIndices1,		// yup
				const std::set<size_t>&		pNonZeroFeaturesIndices2 );		// yup

			virtual void init( Matrices::SuperMatrixPtr& pFrequencies );

		private:
			double InnerCountSimilarityA(
				Matrices::CompressedVector& pMatrixRow1,
				Matrices::CompressedVector& pMatrixRow2,
				size_t 						pLemmaIndex1,
				size_t 						pLemmaIndex2,
				const std::set<size_t>&		pNonZeroFeaturesIndices1,
				const std::set<size_t>&		pNonZeroFeaturesIndices2 );
		};

		typedef boost::shared_ptr<PartialMSR2A> PartialMSR2APtrS;
	}
}


#endif	/* PARTIAL_MSR2_H_ */
