// file: model.h
//
// this is the header for the model class
//

// make sure definitions are only made once
//
#ifndef __ISIP_MODEL
#define __ISIP_MODEL

// isip include files
//
#ifndef __ISIP_INTEGRAL
#include <integral.h>
#endif

#ifndef __ISIP_INTEGRAL_CONSTANTS
#include <integral_constants.h>
#endif

// forward class definitions
//
#ifndef __ISIP_STATE
#include <state.h>
#endif

// Model: a class that contains a Hidden Markov model
//
class Model {
  
  //---------------------------------------------------------------------------
  //
  // protected data
  //
  //---------------------------------------------------------------------------
protected:
  
  // parameters related to the model
  //
  int_4 num_states_d;		        // number of states in the mod.
  float_4* trans_prob_d;		// transition matrix
  State** states_d;                     // states
  
  //---------------------------------------------------------------------------
  //
  // public methods
  //
  //---------------------------------------------------------------------------
public:

  // required methods
  //
  char_1* name_cc();
  volatile void error_handler_cc(char_1* method_name, char_1* message);
  logical_1 debug_cc(FILE* fp, char_1* message);
  int_4 size_cc();
  
  // destructors/constructors
  //
  ~Model();  
  Model();
  Model(int_4 num_states, float_4* trans_prob, State** state);
  Model(Model& model);
  
  // set methods
  //
  logical_1 set_num_states_cc(int_4 num_states) {
    num_states_d = num_states;
    return ISIP_TRUE;
  }

  logical_1 set_transitions_cc(float_4* trans_prob) {
    trans_prob_d = trans_prob;
    return ISIP_TRUE;
  }
  
  logical_1 set_states_cc(State** state);
  
  // get methods
  //
  int_4 get_num_states_cc() {
    return num_states_d;
  }
  
  float_4* get_transitions_cc() {
    return trans_prob_d;
  }

  State** get_states_cc() {
    return states_d;
  }

  // HMM methods
  //
  float_4 get_output_prob_cc(int_4 state, float_4* data, int_4 frame);
  logical_1 get_next_states_cc(int_4 state_ind, int_4& num_trans,
			       int_4*& trans_states, float_4*& trans_scores,
			       int_4& trans_states_size);
  
  //---------------------------------------------------------------------------
  //
  // private methods
  //
  //---------------------------------------------------------------------------
private:

};

// end of file
// 
#endif
