csslti4.c File Reference

#include "scicos_block.h"
#include "machine.h"

Include dependency graph for csslti4.c:

Go to the source code of this file.

Functions

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


Function Documentation

void csslti4 ( scicos_block block,
int  flag 
)

Definition at line 7 of file csslti4.c.

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

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

Here is the call graph for this function:

int C2F() dmmul (  ) 

Referenced by csslti4(), dsslti4(), gain(), gainblk(), tcslti4(), and tcsltj4().

Here is the caller graph for this function:

int C2F() dmmul1 (  ) 

Referenced by csslti4(), dsslti4(), and tcslti4().

Here is the caller graph for this function:


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