tcsltj4.c File Reference

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

Include dependency graph for tcsltj4.c:

Go to the source code of this file.

Functions

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


Function Documentation

int C2F() dmmul (  ) 

int C2F() dmmul1 (  ) 

void tcsltj4 ( scicos_block block,
int  flag 
)

Definition at line 10 of file tcsltj4.c.

References C2F, dmmul(), 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.

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

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