////////////////////////////////////////////////////////////////////////
//
// Score.h - contains classes for different kinds of scoring systems
//
// $Id: Score.h,v 1.4 2001/12/26 10:42:13 goetz Exp $
//
////////////////////////////////////////////////////////////////////////

#ifndef SCORE_H
#define SCORE_H

#include <string>

#include "Alignment.h"
#include "ScoreMatrix.h"
#include "SecWeight.h"
#include "PwDistWeight.h"

//////////////////////////////////////////////////////////////////////
// base class : abstract class with no implementation
class Score 
{
public:
  /** returns the value of the score */
  operator int() const
  { return value; };
  /** returns the description, the name of the score */
  operator const string() const
  { return name; };

  /** only constructor (besides copy constructor):
   *  every score has to be given a name */
  Score(const string &name)
    : name(name) 
  {};

  /** this vector contains columnwise scores/differencies */
  int* colVal;

  // destructor: clean up all dynamically allocated stuff
  virtual ~Score();
private:
  string name;
  
protected:
  int value;
};

//////////////////////////////////////////////////////////////////////
// base class for difference scores between two alignments
class DiffScore : public Score
{
public:
  /** this score scores the "test" alignment using as difference to the
   *  "ref" alignment 
   *  optional: a secondary structure weight and a pairwise sequence
   *            distance weight may be given
   */
  DiffScore(const Alignment &test, const Alignment &ref,
	    const SecWeight &sweight = DefaultSecW(),
	    const PwDistWeight &pweight = DefaultPwDist());
  
protected:
  /** for different name of subclasses */
  DiffScore(const string &name)
    : Score(name) 
  {};
};

//////////////////////////////////////////////////////////////////////
// class for SP-Score with optional pairwise sequence weighting and 
// secondary structure weighting
class SPScore : public Score
{
public:
  /** calculate SP-Score of alignment "al" using scorematrix "scr" 
   *  optionally 
   *  pairwise sequence weights "pweight" and secondary structure weight
   *  "sweight"
   */
  SPScore(const Alignment &al, const ScoreMatrix &scr,
	  const SecWeight &sweight = DefaultSecW(),
	  const PwDistWeight &pweight = DefaultPwDist());
};

#endif
