www.pudn.com > firev0.01.rar > baseclusterer.hpp


/*
This file is part of the FIRE -- Flexible Image Retrieval System

FIRE is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

FIRE 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
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with FIRE; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
#ifndef __baseclusterer_hpp
#define __baseclusterer_hpp

#include 

#include "basefeature.hpp"
#include "distances.hpp"

using namespace std;

/** Absolute basic class for clustering algorithms.
 *
 * This class is pure abstract and does not provide anything except an interface
 */
template  
class BaseClusterer {
public:
  
  /** start the clustering algorithm.
   * @param inputdata the data to be clustered. 
   * @param clusterinformation after clustering a vector which
   * contains clusternumbers. The clusternumber at position x belongs
   * to inputdata at position x
   * @return the number of clusters generated
   */


  virtual const unsigned int run(const vector  *> &inputdata, vector  &clusterinformation)=0;
  /** the dist function which is to be taken for clustering
   */
  virtual BaseDist*& dist() {return dist_;}
  
  /// returns the name of the dist Function used.
  string & distString() { return distString_;}
  /// returns the name of the dist Function used, const version.
  const string & distString() const { return distString_;}

  virtual void saveClusters(::std::string filename) const =0;
    
  virtual ~BaseClusterer() {};

protected:
  BaseDist *dist_;
  string distString_;
};

#endif