sci_fsum.c

Go to the documentation of this file.
00001 /* ==================================================================== */
00002 /* Allan CORNET */
00003 /* INRIA 2008 */
00004 /* Template toolbox_skeleton */
00005 /* ==================================================================== */
00006 #include "stack-c.h" 
00007 /* ==================================================================== */
00008 extern int F2C(fsum)(double *a,double *b,double *c);
00009 /* ==================================================================== */
00010 int sci_fsum(char *fname)
00011 {
00012   int l1, m1, n1, l2, m2, n2, m3, n3,l3;
00013 
00014   double a,b,c;
00015   
00016   a = 0;
00017   b = 0;
00018   c = 0;
00019 
00020   /* --> result = fortransum(3,8)
00021   /* check that we have only 2 parameters input */
00022   /* check that we have only 1 parameters output */
00023   CheckRhs(2,2) ;
00024   CheckLhs(1,1) ;   
00025 
00026   /* get first parameter and put in 'a' */
00027   GetRhsVar(1, "d", &m1, &n1, &l1);
00028   a = *stk(l1);
00029   
00030   /* get second parameter and put in 'a' */
00031   GetRhsVar(2, "d", &m2, &n2, &l2);
00032   b= *stk(l2) ;
00033  
00034   /* call fortran fsum subroutine */
00035   F2C(fsum)(&a,&b,&c);
00036   
00037   /* create a variable on scilab's stack */
00038   m3=1;
00039   n3=1;
00040   CreateVar(Rhs+1,"d",&m3,&n3,&l3);
00041   *stk(l3) = c;
00042 
00043   LhsVar(1) = Rhs+1; 
00044   return 0;
00045 }
00046 /* ==================================================================== */

Generated on Tue Sep 9 17:48:18 2008 for Scilab [trunk] by  doxygen 1.5.5