summaryrefslogtreecommitdiffstats
path: root/scilab_doc
diff options
context:
space:
mode:
authorFarid Belahcene <farid.belahcene@inria.fr>2006-09-01 09:44:43 +0000
committerFarid Belahcene <farid.belahcene@inria.fr>2006-09-01 09:44:43 +0000
commit0bb50c7079a1334afffc75bd7727545d1a5cba0b (patch)
treef00f30f5635ec008e386b405c769cd66ee2fc0b2 /scilab_doc
parent01cf7d84a448c3f808244d275dd0b91624713cef (diff)
downloadscilab-0bb50c7079a1334afffc75bd7727545d1a5cba0b.zip
scilab-0bb50c7079a1334afffc75bd7727545d1a5cba0b.tar.gz
Deleted trunk/scilab_doc/toolbox_guide/toolbox_example/interface
Diffstat (limited to 'scilab_doc')
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/interface/builder.sce8
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/interface/intfun1.c56
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/interface/intsumab.c41
3 files changed, 0 insertions, 105 deletions
diff --git a/scilab_doc/toolbox_guide/toolbox_example/interface/builder.sce b/scilab_doc/toolbox_guide/toolbox_example/interface/builder.sce
deleted file mode 100644
index 18f6570..0000000
--- a/scilab_doc/toolbox_guide/toolbox_example/interface/builder.sce
+++ /dev/null
@@ -1,8 +0,0 @@
1// must be run from this directory
2ilib_name = 'libtoolbox_example' // interface library name
3files = ['intfun1.o', 'intsumab.o']; // objects files
4libs = ["../src/libtoolboxsrc"] // other libs needed for linking
5table = [ 'scifun1', 'intfun1';
6 'scisum','intsumab']; // table of (scilab_name,interface-name)
7// do not modify below
8ilib_build(ilib_name,table,files,libs)
diff --git a/scilab_doc/toolbox_guide/toolbox_example/interface/intfun1.c b/scilab_doc/toolbox_guide/toolbox_example/interface/intfun1.c
deleted file mode 100644
index c819308..0000000
--- a/scilab_doc/toolbox_guide/toolbox_example/interface/intfun1.c
+++ /dev/null
@@ -1,56 +0,0 @@
1#include "stack-c.h"
2
3extern void fun2(double * , int, int *);
4extern void fun1(double * , int, int *, double **, double *);
5
6int intfun1(char *fname)
7{
8 int l1, m1, n1, m=1, nX, i, l2, l3;
9 double * X, S;
10
11 /* 1 - Check the number of inputs and outputs arguments */
12 /* You can use the variables: Lhs and Rhs */
13 int minlhs=1, maxlhs=2, minrhs=1, maxrhs=1;
14 CheckRhs(minrhs,maxrhs) ;
15 CheckLhs(minlhs,maxlhs) ;
16
17 /* 2 - Check rhs type, get the rows number(m1) and the columns number(n1) of rhs, and its adress(l1) in the Scilab stack */
18 GetRhsVar(1, "d", &m1, &n1, &l1);
19
20 if(m1!=0 && n1!=0 )
21 {
22 if(m1!=1 && n1!=1)
23 {
24 cerro("input argument must be a vector");
25 return(0);
26 }
27 }
28
29 fun1(stk(l1), n1*m1, &nX, &X, &S);
30
31 /* 4 - Create the place for the firts output X ( a vector of doubles, size: m*n ) to the adress l2 in the Scilab stack */
32 CreateVar(2, "d", &m, &nX, &l2);
33
34 /* if there are two outputs variable then: Create the place for the second output S ( a double, size 1*1) to the adress l3 in the Scilab stack */
35 /* get the value of S, and put it in the Scilab stack */
36 if(Lhs==2)
37 {
38 CreateVar(3, "d", &m, &m, &l3);
39 *stk(l3)=S;
40 }
41
42 /* get the components of X, and put them in the Scilab stack */
43 for(i=0;i<nX;i++)
44 stk(l2)[i]=X[i];
45
46 /* free memory */
47 free(X);
48
49 /* 5 - Specification of outputs variables */
50 LhsVar(1) = 2;
51
52 if(Lhs==2)
53 LhsVar(2) = 3;
54
55 return 0;
56} \ No newline at end of file
diff --git a/scilab_doc/toolbox_guide/toolbox_example/interface/intsumab.c b/scilab_doc/toolbox_guide/toolbox_example/interface/intsumab.c
deleted file mode 100644
index 68278a8..0000000
--- a/scilab_doc/toolbox_guide/toolbox_example/interface/intsumab.c
+++ /dev/null
@@ -1,41 +0,0 @@
1#include "stack-c.h"
2
3extern int sumab(int n, double * a, double * b, double * y);
4
5void intsumab(char *fname)
6{
7 int l1, m1, n1, l2, m2, n2, l3, n;
8
9 /* 1 - Check rhs and lhs number */
10 int minlhs=1, maxlhs=1, minrhs=2, maxrhs=2;
11 CheckRhs(minrhs,maxrhs) ;
12 CheckLhs(minlhs,maxlhs) ;
13
14 /* 2 - Check rhs type and get rhs adress in the Scilab stack */
15 GetRhsVar(1, "d", &m1, &n1, &l1);
16 GetRhsVar(2, "d", &m2, &n2, &l2);
17
18 n=m2*n2;
19 if( n1!=n2 || m1!=m2)
20 {
21 cerro("input arguments must have the same size");
22 return 0;
23 }
24
25 if(n1!=0 && m1!=0)
26 if(n1!=1 && m1!=1)
27 {
28 cerro("input arguments must be vectors");
29 return(0);
30 }
31
32 /* use chekdims and getscalar functions: a completer ................*/
33
34 /* 4 - Create the output argument */
35 CreateVar(3,"d",&m2,&n2,&l3);
36 sumab(n,stk(l1),stk(l2),stk(l3));
37
38 /* 5 - Specif the ouput argument */
39 LhsVar(1) = 3;
40 return 0;
41} \ No newline at end of file