ex16c.c

Go to the documentation of this file.
00001 
00002 #include "../../routines/machine.h"
00003 
00004 /*******************************************
00005  * simple example with sparse matrix 
00006  * Display of a 
00007  *******************************************/
00008 
00009 int F2C(ext16ca)(ar,m,n)
00010      int *ar;
00011      int *n,*m;
00012 { 
00013   int i;
00014   for ( i=0; i < (*m)*(*n) ; i++) ar[i]= (ar[i]==1)? 0:1;
00015 }
00016 
00017 /*******************************************
00018  * simple example with sparse matrix 
00019  * 2*a copied into b 
00020  *******************************************/
00021 
00022 int F2C(ext16cb)(ar1,ar2,m,n)
00023      int *ar1,*ar2;
00024      int *m,*n;
00025 {
00026   int i;
00027   for ( i = 0; i < *m*(*n) ; i++) ar2[i] =  (ar1[i]==1)? 0:1;
00028 }
00029 
00030 
00031 /*******************************************
00032  * a is an external 
00033  *******************************************/
00034 
00035 
00036 int F2C(ext16ce)(ar1,m,n,err)
00037      int  **ar1;
00038      int *m,*n,*err;
00039 {
00040   int i,j;
00041   *n=2;
00042   *m=3;
00043   *ar1 = (int *) malloc((unsigned) (*m)*(*n)*sizeof(int));
00044   if ( *ar1 == (int*) 0) 
00045     {
00046       *err=1;
00047       sciprint("No more space\r\n");
00048       return;
00049     }
00050   *err=0;
00051   for ( i = 0; i < (*n) ; i++) 
00052     for ( j = 0; j < (*m) ; j++) 
00053       (*ar1)[i+(*n)*j] = i ;
00054 }

Generated on Sun Mar 4 15:03:57 2007 for Scilab [trunk] by  doxygen 1.5.1