/* 
 *  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.   
 */ 
/***************************************************************************/ 
/*                                                                         */ 
/*     RLS . hpp		                                                   */ 
/*                                                                         */ 
/*     Recoursive Least Square Algorithm inplementation.                   */ 
/*                                                                         */ 
/*                                                                         */ 
/***************************************************************************/ 
 
#ifndef _RLS_HPP_ 
#define _RLS_HPP_ 
 
#include "sysIdent.hpp" 
 
class RLS_alg : public sysid { 
	Matrix P_RLS; //Estimated error covariance matrix  
	Matrix pi; //Local variable - vector 
	Matrix k; // the uodate gain vector 
	Matrix Mtemp; // Temporary result holder matrix 
 
	float lambda; // memory lenght paramether 
	float lambda_inv; // = (1/lambda) 
 
public: 
 
	void update(float y_n, float u_n_1); 
	RLS_alg(float lambda_RLS,int is,int ia,int ib,int ic) ; 
	~RLS_alg(); 
}; 
 
 
#endif // _RLS_HPP_
