
#ifndef PARTIAL_MSR2_B_H_
#define PARTIAL_MSR2_B_H_

#include "PartialMSR2Base.h"


namespace smartcomparator
{
	namespace simfunctions
	{
		class SMART_COMPARATOR_API PartialMSR2B : public PartialMSR2Base
		{
		public:
			struct ParamsB {
				unsigned int	k;
				unsigned int	n;
			};

		private:
			ParamsB mParamsB;

			// vector which store information how many locally important features belong to classes
			std::vector<size_t>	mClsCounter;

		public:
			PartialMSR2B(
				Matrices::SuperMatrixPtr&		pWeightsMatrix,
				SimilarityFunctionPtr&			pSimilarityFunction,
				SynsetClassSetPtrS&				pSynsetClasses,
				Params&							pParams,
				ParamsB&						pParamsB );

			virtual ~PartialMSR2B();


			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 InnerCountSimilarityB(
				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<PartialMSR2B> PartialMSR2BPtrS;
	}
}


#endif	/* PARTIAL_MSR2_H_ */
