MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
IdentARXProcess Class Reference

#include <id.h>

Inheritance diagram for IdentARXProcess:
Collaboration diagram for IdentARXProcess:

Public Member Functions

 IdentARXProcess (unsigned int iOut, unsigned int iIn, unsigned int iA, unsigned int iB, ForgettingFactor *pf)
 
virtual ~IdentARXProcess (void)
 
virtual void Update (const doublereal *pdYTmp, const doublereal *pdUTmp)
 
virtual void GetTheta (doublereal *pdTheta)
 
virtual integer iGetSize (void) const
 
- Public Member Functions inherited from IdentProcess
 IdentProcess (unsigned int iOut, unsigned int iIn, unsigned int iA, unsigned int iB)
 
virtual ~IdentProcess (void)
 
void CreateIdent (integer size, integer nout, ForgettingFactor *pf)
 
virtual void GetErr (doublereal *pdE)
 
virtual doublereal dGetForgettingFactor (void)
 
integer iGetNumOutput (void) const
 

Protected Attributes

integer size
 
doublerealpdBase
 
doublerealpdPhi
 
doublerealpdY
 
- Protected Attributes inherited from IdentProcess
unsigned int iNumOutput
 
unsigned int iNumInput
 
unsigned int iOrdA
 
unsigned int iOrdB
 
IdentpIdent
 

Detailed Description

Definition at line 125 of file id.h.

Constructor & Destructor Documentation

IdentARXProcess::IdentARXProcess ( unsigned int  iOut,
unsigned int  iIn,
unsigned int  iA,
unsigned int  iB,
ForgettingFactor pf 
)

Definition at line 201 of file id.cc.

References IdentProcess::CreateIdent(), pdBase, pdPhi, pdY, SAFENEWARR, and size.

204 : IdentProcess(iOut, iIn, iA, iB),
205 size(iOut*iA+iIn*(iB+1)), pdBase(NULL), pdPhi(NULL), pdY(NULL)
206 {
207  // size e' il lato lungo di Theta
208 
209  CreateIdent(size, integer(iOut), pf);
210 
211  integer i = size // Phi
212  +iOut; // Y
213 
215 
216  pdPhi = pdBase;
217  pdY = pdPhi+size;
218 
219  for (integer j = i; j-- > 0; ) {
220  pdBase[j] = 0.;
221  }
222 }
void CreateIdent(integer size, integer nout, ForgettingFactor *pf)
Definition: id.cc:182
IdentProcess(unsigned int iOut, unsigned int iIn, unsigned int iA, unsigned int iB)
Definition: id.cc:167
integer size
Definition: id.h:127
doublereal * pdBase
Definition: id.h:130
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal * pdPhi
Definition: id.h:132
doublereal * pdY
Definition: id.h:133

Here is the call graph for this function:

IdentARXProcess::~IdentARXProcess ( void  )
virtual

Definition at line 224 of file id.cc.

References pdBase, and SAFEDELETEARR.

225 {
227 }
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
doublereal * pdBase
Definition: id.h:130

Member Function Documentation

void IdentARXProcess::GetTheta ( doublereal pdTheta)
virtual

Implements IdentProcess.

Definition at line 259 of file id.cc.

References IdentProcess::iNumOutput, Ident::pdGetTheta(), IdentProcess::pIdent, and size.

260 {
261  doublereal* p = pIdent->pdGetTheta();
262  for (integer i = iNumOutput*size; i-- > 0; ) {
263  pdTheta[i] = p[i];
264  }
265 }
doublereal * pdGetTheta(void)
Definition: id.cc:115
integer size
Definition: id.h:127
unsigned int iNumOutput
Definition: id.h:90
Ident * pIdent
Definition: id.h:95
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

virtual integer IdentARXProcess::iGetSize ( void  ) const
inlinevirtual

Implements IdentProcess.

Definition at line 144 of file id.h.

References size.

144  {
145  return size;
146  };
integer size
Definition: id.h:127
void IdentARXProcess::Update ( const doublereal pdYTmp,
const doublereal pdUTmp 
)
virtual

Implements IdentProcess.

Definition at line 229 of file id.cc.

References IdentProcess::iNumInput, IdentProcess::iNumOutput, IdentProcess::iOrdA, IdentProcess::iOrdB, pdPhi, pdY, IdentProcess::pIdent, and Ident::Update().

231 {
232  if (iOrdA > 0) {
233  for (integer i = iNumOutput*(iOrdA-1); i-- > 0; ) {
234  pdPhi[i+iNumOutput] = pdPhi[i];
235  }
236  for (integer i = iNumOutput; i-- > 0; ) {
237  pdPhi[i] = pdY[i];
238  pdY[i] = pdYTmp[i];
239  }
240  } else {
241  // FIR
242  for (integer i = iNumOutput; i-- > 0; ) {
243  pdY[i] = pdYTmp[i];
244  }
245  }
246 
247  doublereal* pdTmp = pdPhi+iNumOutput*iOrdA;
248  // if (iOrdB == 0) // AR is implicitly satisfied
249  for (integer i = iNumInput*iOrdB; i-- > 0; ) {
250  pdTmp[i+iNumInput] = pdTmp[i];
251  }
252  for (integer i = iNumInput; i-- > 0; ) {
253  pdTmp[i] = pdUTmp[i];
254  }
255 
256  pIdent->Update(pdPhi, pdY);
257 }
unsigned int iOrdA
Definition: id.h:92
void Update(const doublereal *pphi, const doublereal *yy)
Definition: id.cc:137
unsigned int iNumOutput
Definition: id.h:90
Ident * pIdent
Definition: id.h:95
unsigned int iNumInput
Definition: id.h:91
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal * pdPhi
Definition: id.h:132
doublereal * pdY
Definition: id.h:133
unsigned int iOrdB
Definition: id.h:93

Here is the call graph for this function:

Member Data Documentation

doublereal* IdentARXProcess::pdBase
protected

Definition at line 130 of file id.h.

Referenced by IdentARXProcess(), and ~IdentARXProcess().

doublereal* IdentARXProcess::pdPhi
protected

Definition at line 132 of file id.h.

Referenced by IdentARXProcess(), and Update().

doublereal* IdentARXProcess::pdY
protected

Definition at line 133 of file id.h.

Referenced by IdentARXProcess(), and Update().

integer IdentARXProcess::size
protected

Definition at line 127 of file id.h.

Referenced by GetTheta(), IdentARXProcess(), and iGetSize().


The documentation for this class was generated from the following files: