/*
 *  Copyright 2002 by Soos, Antal 
 *  All rights reserved. Property of Soos, Antal. 
 *  Restricted rights to use, duplicate or disclose this code are 
 *  granted through contract.   
 */ 
/***************************************************************************/ 
/*                                                                         */ 
/*     sysContr . hpp	                                                   */ 
/*                                                                         */ 
/*     System Control - Common definitions.		                   */ 
/*                                                                         */ 
/*                                                                         */ 
/***************************************************************************/ 
 
// Include files definition: 
#ifndef _SYSCONTR_HPP_ 
#define _SYSCONTR_HPP_ 
 
#include "MatrixCal.hpp"

#include <cstdlib> 

// Declaration of the system identification paramethers: 
 
#define CFSTATISTIC_IS_IMPLEMENTED   // for no statistic 0 

//-----------------------------------------------------------------------------
// Declaration of the sysCR object
class syscr {  // system Control class 


	 
protected: 



  int m_s;		// The static component dimension m_s = { 1 or 0} 
  int m_a;		// The dimension ofautoregresiv components of the model 
  int m_b;		// The moving averadge dimension of the model 
  int m_c;		// The error model dimension, if 0 => no error model  
  
  float v_n;		// output's error - residuals: v_n = r_n - y_n 
  Matrix state;         //  the estimated state vector
  
  float fio1 ;   // Integrator in remouve_DC function
  float fio2 ;
  float fio3 ;
  float fio4 ;
 

//-----------------------------------------------------------------------------

 
#if CSTATISTIC_IS_IMPLEMENTED //------------------------------------------------

    int count_n;	// counter for the sample lenght


    float performance_index; // generalized performance index 
 
#endif //CSTATISTIC_IS_IMPLEMENTED --------------------------------------------- 
 




public: 


    syscr(int is, int ia, int ib, int ic); 
     ~syscr(); 
    
 
    void get_state(Matrix *gtheta); 

 
#if CSTATISTIC_IS_IMPLEMENTED //------------------------------------------------ 
 
	int update_stat(void);  // Statistic calculation for the identification  
 
	float get_performance_index(void); // generalized performance index 
 
 
#endif //CSTATISTIC_IS_IMPLEMENTED --------------------------------------------- 
 
}; 
//----------------------------------------------------------------------------- 
 
#endif // _SYSCONTR_HPP_
