summaryrefslogtreecommitdiffstats
path: root/scilab_doc
diff options
context:
space:
mode:
authorFarid Belahcene <farid.belahcene@inria.fr>2006-09-01 13:32:51 +0000
committerFarid Belahcene <farid.belahcene@inria.fr>2006-09-01 13:32:51 +0000
commitb002eaddc30658082504e837dbf3fb315c6b487f (patch)
tree5eaeab8d068fdd44fa8b2df5390d0375b5d882a3 /scilab_doc
parent5f53d99688ac2991b8aada5fde9affbf4010371f (diff)
downloadscilab-b002eaddc30658082504e837dbf3fb315c6b487f.zip
scilab-b002eaddc30658082504e837dbf3fb315c6b487f.tar.gz
Update toolbox guide
Diffstat (limited to 'scilab_doc')
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/help/buildhelp.sce6
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/help/foo1.xml68
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/help/loadhelp.sce4
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/help/sumab.xml83
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.abin0 -> 43092 bytes
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.lai35
-rwxr-xr-xscilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.sobin0 -> 31586 bytes
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.abin0 -> 29566 bytes
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.lai35
-rwxr-xr-xscilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.sobin0 -> 25398 bytes
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/sci_gateway/buildsci_gateway.sce8
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/sci_gateway/sci_fun.c77
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/sci_gateway/sci_sumab.c41
13 files changed, 357 insertions, 0 deletions
diff --git a/scilab_doc/toolbox_guide/toolbox_example/help/buildhelp.sce b/scilab_doc/toolbox_guide/toolbox_example/help/buildhelp.sce
new file mode 100644
index 0000000..b4cd3b8
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/help/buildhelp.sce
@@ -0,0 +1,6 @@
1mode(-1) //force silent execution
2path=get_absolute_file_path('builhelp.sce');//get the absolute path of this file
3add_help_chapter("Title1",path);//add help chapter
4xmltohtml(path,"Title1")
5//clear the variable stack
6clear path add_help_chapter get_absolute_file_path \ No newline at end of file
diff --git a/scilab_doc/toolbox_guide/toolbox_example/help/foo1.xml b/scilab_doc/toolbox_guide/toolbox_example/help/foo1.xml
new file mode 100644
index 0000000..480b982
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/help/foo1.xml
@@ -0,0 +1,68 @@
1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2<!DOCTYPE MAN SYSTEM "/home/scilab/scilab-3.0/man/manrev.dtd">
3<MAN>
4 <LANGUAGE>eng</LANGUAGE>
5 <TITLE>foo1</TITLE>
6 <TYPE>Scilab Function </TYPE>
7 <DATE>25-Mar-2006</DATE>
8 <SHORT_DESCRIPTION name="foo1"> Returns the positive components of A diagonal</SHORT_DESCRIPTION>
9
10 <CALLING_SEQUENCE>
11 <CALLING_SEQUENCE_ITEM>X = foo1(A)</CALLING_SEQUENCE_ITEM>
12 </CALLING_SEQUENCE>
13
14 <PARAM>
15 <PARAM_INDENT>
16
17 <PARAM_ITEM>
18 <PARAM_NAME>A</PARAM_NAME>
19 <PARAM_DESCRIPTION>
20 <SP>
21 : a square matrix of reals
22 </SP>
23 </PARAM_DESCRIPTION>
24 </PARAM_ITEM>
25
26 <PARAM_ITEM>
27 <PARAM_NAME>X</PARAM_NAME>
28 <PARAM_DESCRIPTION>
29 <SP>
30 : a vector of positive reals
31 </SP>
32 </PARAM_DESCRIPTION>
33 </PARAM_ITEM>
34 </PARAM_INDENT>
35 </PARAM>
36
37 <DESCRIPTION>
38 <DESCRIPTION_INDENT>
39 <DESCRIPTION_ITEM>
40 <P>
41 This function returns a vector containing the positive components of the A diagonal. A must be a square matrix.
42 Other paragraph can be added
43 </P>
44 </DESCRIPTION_ITEM>
45 </DESCRIPTION_INDENT>
46 </DESCRIPTION>
47
48 <EXAMPLE><![CDATA[
49 A=rand(5,5)-1/2;
50 X=foo1(A);
51 ]]></EXAMPLE>
52
53 <SEE_ALSO>
54 <SEE_ALSO_ITEM> <LINK> diag</LINK> </SEE_ALSO_ITEM>
55 </SEE_ALSO>
56
57 <BIBLIO>
58 Add here the function bibliography if any
59 </BIBLIO>
60
61 <AUTHORS>
62 <AUTHORS_ITEM label='F.Belahcene'>
63 </AUTHORS_ITEM>
64 </AUTHORS>
65 <USED_FUNCTIONS>
66 Add here the used function name and references
67 </USED_FUNCTIONS>
68</MAN>
diff --git a/scilab_doc/toolbox_guide/toolbox_example/help/loadhelp.sce b/scilab_doc/toolbox_guide/toolbox_example/help/loadhelp.sce
new file mode 100644
index 0000000..8d9c3e1
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/help/loadhelp.sce
@@ -0,0 +1,4 @@
1mode(-1) //force silent execution
2path=get_absolute_file_path('loadhelp.sce');//get the absolute path of this file
3add_help_chapter("Title1",path);//add help chapter
4clear path add_help_chapter get_absolute_file_ \ No newline at end of file
diff --git a/scilab_doc/toolbox_guide/toolbox_example/help/sumab.xml b/scilab_doc/toolbox_guide/toolbox_example/help/sumab.xml
new file mode 100644
index 0000000..b53db11
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/help/sumab.xml
@@ -0,0 +1,83 @@
1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2<!DOCTYPE MAN SYSTEM "/home/scilab/scilab-3.0/man/manrev.dtd">
3<MAN>
4 <LANGUAGE>eng</LANGUAGE>
5 <TITLE>scisum</TITLE>
6 <TYPE>Scilab Function </TYPE>
7 <DATE>25-Mar-2006</DATE>
8 <SHORT_DESCRIPTION name="scisum"> add short decription here</SHORT_DESCRIPTION>
9
10 <CALLING_SEQUENCE>
11 <CALLING_SEQUENCE_ITEM>y = scisum(a,b)</CALLING_SEQUENCE_ITEM>
12 </CALLING_SEQUENCE>
13
14 <PARAM>
15 <PARAM_INDENT>
16
17 <PARAM_ITEM>
18 <PARAM_NAME>a</PARAM_NAME>
19 <PARAM_DESCRIPTION>
20 <SP>
21 : add here the parameter description
22 </SP>
23 </PARAM_DESCRIPTION>
24 </PARAM_ITEM>
25
26 <PARAM_ITEM>
27 <PARAM_NAME>b</PARAM_NAME>
28 <PARAM_DESCRIPTION>
29 <SP>
30 : add here the parameter description
31 </SP>
32 </PARAM_DESCRIPTION>
33 </PARAM_ITEM>
34
35 <PARAM_ITEM>
36 <PARAM_NAME>y</PARAM_NAME>
37 <PARAM_DESCRIPTION>
38 <SP>
39 : add here the parameter description
40 </SP>
41 </PARAM_DESCRIPTION>
42 </PARAM_ITEM>
43 </PARAM_INDENT>
44 </PARAM>
45
46 <DESCRIPTION>
47 <DESCRIPTION_INDENT>
48 <DESCRIPTION_ITEM>
49 <P>
50 Add here a paragraph of the function description.
51 Other paragraph can be added
52 </P>
53 </DESCRIPTION_ITEM>
54 <DESCRIPTION_ITEM>
55 <P>
56 Add here a paragraph of the function description
57 </P>
58 </DESCRIPTION_ITEM>
59 </DESCRIPTION_INDENT>
60 </DESCRIPTION>
61
62 <EXAMPLE><![CDATA[
63 Add here scilab instructions and comments
64 ]]></EXAMPLE>
65
66 <SEE_ALSO>
67 <SEE_ALSO_ITEM> <LINK> add a key here</LINK> </SEE_ALSO_ITEM>
68 <SEE_ALSO_ITEM> <LINK> add a key here</LINK> </SEE_ALSO_ITEM>
69 </SEE_ALSO>
70
71 <BIBLIO>
72 Add here the function bibliography if any
73 </BIBLIO>
74
75 <AUTHORS>
76 <AUTHORS_ITEM label='enter here the author name'>
77 Add here the author references
78 </AUTHORS_ITEM>
79 </AUTHORS>
80 <USED_FUNCTIONS>
81 Add here the used function name and references
82 </USED_FUNCTIONS>
83</MAN>
diff --git a/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.a b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.a
new file mode 100644
index 0000000..ffb9e4c
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.a
Binary files differ
diff --git a/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.lai b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.lai
new file mode 100644
index 0000000..b229a60
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.lai
@@ -0,0 +1,35 @@
1# libmytoolbox.la - a libtool library file
2# Generated by ltmain.sh - GNU libtool 1.5.20 (1.1220.2.287 2005/08/31 18:54:15)
3#
4# Please DO NOT delete this file!
5# It is necessary for linking the library.
6
7# The name that we can dlopen(3).
8dlname='libmytoolbox.so'
9
10# Names of this library.
11library_names='libmytoolbox.so libmytoolbox.so libmytoolbox.so'
12
13# The name of the static archive.
14old_library='libmytoolbox.a'
15
16# Libraries that this one depends upon.
17dependency_libs=' -lieee'
18
19# Version information for libmytoolbox.
20current=0
21age=0
22revision=0
23
24# Is this an already installed library?
25installed=yes
26
27# Should we warn about portability when linking against -modules?
28shouldnotlink=yes
29
30# Files to dlopen/dlpreopen
31dlopen=''
32dlpreopen=''
33
34# Directory that this library needs to be installed in:
35libdir='/home/belahcene/Desktop/mytoolbox/sci_gateway'
diff --git a/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.so b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.so
new file mode 100755
index 0000000..585e167
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libmytoolbox.so
Binary files differ
diff --git a/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.a b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.a
new file mode 100644
index 0000000..b36ac1a
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.a
Binary files differ
diff --git a/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.lai b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.lai
new file mode 100644
index 0000000..c95b8b9
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.lai
@@ -0,0 +1,35 @@
1# libtoolbox_example.la - a libtool library file
2# Generated by ltmain.sh - GNU libtool 1.5.20 (1.1220.2.287 2005/08/31 18:54:15)
3#
4# Please DO NOT delete this file!
5# It is necessary for linking the library.
6
7# The name that we can dlopen(3).
8dlname='libtoolbox_example.so'
9
10# Names of this library.
11library_names='libtoolbox_example.so libtoolbox_example.so libtoolbox_example.so'
12
13# The name of the static archive.
14old_library='libtoolbox_example.a'
15
16# Libraries that this one depends upon.
17dependency_libs=' -lieee'
18
19# Version information for libtoolbox_example.
20current=0
21age=0
22revision=0
23
24# Is this an already installed library?
25installed=yes
26
27# Should we warn about portability when linking against -modules?
28shouldnotlink=yes
29
30# Files to dlopen/dlpreopen
31dlopen=''
32dlpreopen=''
33
34# Directory that this library needs to be installed in:
35libdir='/home/belahcene/Desktop/toolbox_example/interface'
diff --git a/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.so b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.so
new file mode 100755
index 0000000..a409396
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/.libs/libtoolbox_example.so
Binary files differ
diff --git a/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/buildsci_gateway.sce b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/buildsci_gateway.sce
new file mode 100644
index 0000000..01ee497
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/buildsci_gateway.sce
@@ -0,0 +1,8 @@
1// must be run from this directory
2ilib_name = 'libmytoolbox' // interface library name
3files = ['sci_fun.o', 'sci_sumab.o']; // objects files
4libs = ["../src/libmytoolboxsrc"] // other libs needed for linking
5table = [ 'fun', 'sci_fun';
6 'sumab','sci_sumab']; // table of (scilab_name,interface-name)
7// do not modify below
8ilib_build(ilib_name,table,files,libs) \ No newline at end of file
diff --git a/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/sci_fun.c b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/sci_fun.c
new file mode 100644
index 0000000..66e77cd
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/sci_fun.c
@@ -0,0 +1,77 @@
1#include "stack-c.h"
2
3extern void fun1(double * , int, int *, double **, double *);
4
5int sci_fun(char *fname)
6{
7 int la, ma, na, m=1, nx, i, lx, ls;
8 double * x, s;
9
10 /* 1 - Check the number of inputs and outputs arguments */
11 /* You can use the variables: Lhs and Rhs */
12 int minlhs=1, maxlhs=2, minrhs=1, maxrhs=1;
13 CheckRhs(minrhs,maxrhs) ;
14 CheckLhs(minlhs,maxlhs) ;
15
16 /* 2 - Check the rhs type, get the rows number (ma) and the columns number (na) of rhs, and its adress (la) in the Scilab stack (first position) */
17 GetRhsVar(1, "d", &ma, &na, &la);
18
19 /* 3 - Check rhs is a vector */
20 if(ma!=0 && na!=0 )
21 {
22 if(ma!=1 && na!=1)
23 {
24 cerro("input argument must be a vector");
25 return(0);
26 }
27 }
28
29 fun1(stk(la), na*ma, &nx, &x, &s);
30
31 /* 4 - Create the place for the first output argument x ( a vector of doubles, size: 1*nx ) to the address lx in the Scilab stack (second position) */
32 CreateVar(2, "d", &m, &nx, &lx);
33
34 /* if there are two outputs variables then: Create the place for the second output s ( a double, size 1*1) to the adress ls in the Scilab stack (third position) */
35 /* get the value of s, and put it in the Scilab stack */
36 if(Lhs==2)
37 {
38 CreateVar(3, "d", &m, &m, &ls);
39 *stk(ls)=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(lx)[i]=x[i];
45
46 /* free memory */
47 free(x);
48
49 /* 5 - Specification of outputs variables */
50 LhsVar(1) = 2;
51 if(Lhs==2)
52 LhsVar(2) = 3;
53 return 0;
54}
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
diff --git a/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/sci_sumab.c b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/sci_sumab.c
new file mode 100644
index 0000000..84e3019
--- /dev/null
+++ b/scilab_doc/toolbox_guide/toolbox_example/sci_gateway/sci_sumab.c
@@ -0,0 +1,41 @@
1#include "stack-c.h"
2extern int vectsum(int n, double * a, double * b, double * y);
3
4void sci_sumab(char *fname){
5int l1, m1, n1, l2, m2, n2, l3, n;
6
7/* 1 - Check the number of inputs/outputs arguments */
8int minlhs=1, maxlhs=1, minrhs=2, maxrhs=2;
9CheckRhs(minrhs,maxrhs) ;
10CheckLhs(minlhs,maxlhs) ;
11
12/* 2 - Check inputs arguments type, and get the size and the adress in the Scilab stack of the inputs arguments */
13GetRhsVar(1, "d", &m1, &n1, &l1);
14GetRhsVar(2, "d", &m2, &n2, &l2);
15
16/* 3 - Check that the inputs arguments have the same size */
17/* it's possible to use the chekdims and getscalar functions to do these checks*/
18n=m2*n2;
19if( n1!=n2 || m1!=m2)
20{
21 cerro("inputs arguments must have the same size");
22 return 0;
23}
24if(n1!=0 && m1!=0)
25 if(n1!=1 && m1!=1)
26 {
27 cerro("inputs arguments must be vectors");
28 return(0);
29 }
30
31
32/* 4 - Create a new variable corresponding to the output argument */
33CreateVar(3,"d",&m2,&n2,&l3);
34
35/* 5 -call vectmab routine to perform a+b */
36vectsum(n,stk(l1),stk(l2),stk(l3));
37
38/* 6 - Specif the ouput argument */
39LhsVar(1) = 3;
40return 0;
41} \ No newline at end of file