/** 
* @file FPCCascade.h
* @brief generic cascade classifier
* @author Erik Rodner
* @date 04/21/2008

*/
#ifndef FPCCascadeINCLUDE
#define FPCCascadeINCLUDE

#include "core/vector/VectorT.h"
#include "core/vector/MatrixT.h"
  
#include "vislearning/classifier/classifierbase/FeaturePoolClassifier.h"


namespace OBJREC {

class Cascade : public std::vector< std::pair<double, FeaturePoolClassifier *> >
{};

/** generic cascade classifier */
class FPCCascade : public FeaturePoolClassifier
{

    protected:
	Cascade cascade;

	FeaturePoolClassifier *classifier;
	int backgroundClass;
	int nextComplexity;

    public:
  
	/** constructor */
	FPCCascade( FeaturePoolClassifier *_classifier,
			int _backgroundClass ); 

	/** simple destructor */
	virtual ~FPCCascade();
    
	virtual ClassificationResult classify ( Example & pe );

	virtual void train ( FeaturePool & fp, Examples & examples );

	virtual FPCCascade *clone () const;

	void restore (std::istream & is, int format = 0);
	void store (std::ostream & os, int format = 0) const;
	void clear ();

	void setLastThreshold ( double threshold );
	void deleteLastClassifier ();
	FeaturePoolClassifier *getLastClassifier ();

	Cascade & getCascade () { return cascade; };

	void setComplexity ( int size );

};


} // namespace

#endif
