/*   
 *  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.   
 */ 
/***************************************************************************/ 
/*                                                                         */ 
/*     FQR_RLS . hpp		                                           */ 
/*                                                                         */ 
/*     Recoursive Fast QR RLS Algorithm inplementation.			   */ 
/*			  				                   */ 
/*                                                                         */ 
/***************************************************************************/ 
 
#ifndef _FQR_RLS_HPP_ 
#define _FQR_RLS_HPP_ 
 
#include "sysIdent.hpp" 
#include "MatrixCal.hpp"
#include <cmath> // For the abs() function
#include <cstdlib> 
 
class FQR_RLS_alg : public sysid { 
 
	protected:
	float s_v[ARMAX_dim+2];
	float *s;
	float f_v[ARMAX_dim+2];
	float *f;
	float fp_v[ARMAX_dim+2];
	float *fp;
	float fs_v[ARMAX_dim+1+2];
	float *fs; 
    float beta_v[ARMAX_dim+2];
	float *beta;
	
    float Mtemp_v[1+2];
	Matrix Mtemp; // Temporary result holder matrix 	 
	float lambda; 
 
public: 
 
	void update(float y_n, float u_n_1); 
	FQR_RLS_alg(float fa) ; 
	~FQR_RLS_alg(); 
}; 
 
 
#endif // _FQR_RLS_HPP_
