/***************************************************************************
                          Evaluation.h  -  description
                             -------------------
    begin                : Mit Feb 23 2005
    copyright            : (C) 2005 by klaus frieler
    email                : kgf@omniversum.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program 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.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef _LIBMELODY_EVALUATION_H
#define _LIBMELODY_EVALUATION_H

#include "types.h"
#include "Vector.h"

class EvaluationBase
{
public:
   EvaluationBase(const Vector& groundTruth):m_groundTruth(groundTruth){}
   virtual ~EvaluationBase(){}

   void              setGroundTruth(const Vector& groundTruth){ m_groundTruth = groundTruth;}
   virtual  MRESULT  evaluate(const Vector& data )= 0;

   uint              size(){ return m_groundTruth.size();}

   virtual void      dump()const = 0;

protected:
   Vector            m_groundTruth;

};

class Evaluation:public EvaluationBase
{
public:
   Evaluation(const Vector& groundTruth):EvaluationBase(groundTruth){}
   ~Evaluation(){}

   MRESULT     evaluate(const Vector& data );

   uint        getTP(){ return m_iTP;}
   uint        getTN(){ return m_iTN;}
   uint        getFP(){ return m_iFP;}
   uint        getFN(){ return m_iFN;}

   double      getSensitivity(){ return  m_dSensitivity;}
   double      getSpecificity(){ return  m_dSpecificity;}

   void        dump()const;
protected:
   uint        m_iFP, m_iFN, m_iTP, m_iTN;
   double      m_dSensitivity, m_dSpecificity;
   Vector      m_diff;
};

#endif


