/*
    Copyright (C) 2012 Bartosz Broda, Jacek Bochenek, Łukasz Biłeńkij, 
    Damian Jaworski, Wojciech Mazur, Dominik Piasecki, Maciej Piasecki, 
    Radosław Ramocki
    
    This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.

    This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. 

    See the LICENSE and COPYING files for more details.
*/

#ifndef CLUSTERING_CBC_KBEST_H
#define CLUSTERING_CBC_KBEST_H
#include <boost/shared_ptr.hpp>
#include "matrices_all.h"
#include "comparator_all.h"

namespace clustering
{
	namespace cbc
	{
		class KBest
		{
		public:
			KBest();
			~KBest();
			void ReadFromXmlFile(const std::string &filename);
			static void GenerateFromMatrix(const std::string &filename_out, size_t k, double sim_min,
					Matrices::SuperMatrixPtr pMatrix, smartcomparator::compare::CompareFunctionPtr pCmp);
			/// \param labelfile If lablefile == "", then labelfile is assumed to be "filename"+".rlabel"
			Matrices::SymmetricSimMatrixPtr ReadFromGeneratedFiles(const std::string &filename, const std::string &labelfile = "", size_t k = 1000,
					double min_sim = 0.00001);
			std::vector<std::string>& GetKBest(const std::string &w);
		private:
			std::map<std::string, std::vector<std::string> > m_mKBest;
		};

		typedef boost::shared_ptr<KBest> KBestPtr;

	}//namespace cbc
}//namespace clustering
#endif //CLUSTERING_CBC_KBEST_H
