tcslti4.c File Reference

#include <math.h>
#include <memory.h>
#include "scicos_block.h"
#include "machine.h"

Include dependency graph for tcslti4.c:

Go to the source code of this file.

Functions

int C2F() dmmul ()
int C2F() dmmul1 ()
void tcslti4 (scicos_block *block, int flag)


Function Documentation

int C2F() dmmul (  ) 

int C2F() dmmul1 (  ) 

void tcslti4 ( scicos_block block,
int  flag 
)

Definition at line 12 of file tcslti4.c.

References C2F, dmmul(), dmmul1(), scicos_block::inptr, scicos_block::insz, lc, memcpy(), scicos_block::nevprt, scicos_block::nx, scicos_block::outptr, scicos_block::outsz, scicos_block::rpar, scicos_block::x, x, scicos_block::xd, xd, and y.

00013 {
00014   /* Copyright INRIA
00015    
00016      Scicos block simulator
00017      continuous state space linear system simulator
00018      rpar(1:nx*nx)=A
00019      rpar(nx*nx+1:nx*nx+nx*nu)=B
00020      rpar(nx*nx+nx*nu+1:nx*nx+nx*nu+nx*ny)=C
00021      rpar(nx*nx+nx*nu+nx*ny+1:nx*nx+nx*nu+nx*ny+ny*nu)=D */
00022 
00023   int un=1,lb,lc,ld;
00024   int nx=block->nx;
00025   double* x=block->x;
00026   double* xd=block->xd;
00027   double* rpar=block->rpar;
00028   double* y=block->outptr[0];
00029   double* u1=block->inptr[0];
00030   double* u2=block->inptr[1];
00031   int* outsz=block->outsz;
00032   int* insz=block->insz;
00033     
00034   lb=nx*nx;
00035   lc=lb+nx*insz[0];
00036   
00037   if (flag ==1 || flag ==6){
00038     /* y=c*x+d*u1 */  
00039     ld=lc+nx*outsz[0];
00040 
00041     C2F(dmmul)(&rpar[lc],outsz,x,&nx,y,outsz,outsz,&nx,&un);
00042     C2F(dmmul1)(&rpar[ld],outsz,u1,&insz[0],y,outsz,outsz,&insz[0],&un);
00043 
00044   }else if (flag == 2 && block->nevprt == 1){
00045     /* x+=u2 */
00046     memcpy(x,u2 ,nx*sizeof(double));
00047   }else if (flag ==0 && block->nevprt == 0){
00048     /* xd=a*x+b*u1 */
00049     C2F(dmmul)(&rpar[0],&nx,x,&nx,xd,&nx,&nx,&nx,&un);
00050     C2F(dmmul1)(&rpar[lb],&nx,u1,&insz[0],xd,&nx,&nx,&insz[0],&un);
00051   }
00052 }

Here is the call graph for this function:


Generated on Sun Mar 4 16:12:27 2007 for Scilab [trunk] by  doxygen 1.5.1