diff --git a/Doc/Manual/Scilab.html b/Doc/Manual/Scilab.html index c2d5ff094..bb2afb572 100644 --- a/Doc/Manual/Scilab.html +++ b/Doc/Manual/Scilab.html @@ -157,7 +157,7 @@ it may be because the SWIG library is not found. Check the SWIG_LIB env

-Note: SWIG for Scilab can work in two modes related to the way the module is build, see the Building modes section for details. +Note: SWIG for Scilab can work in two modes related to the way the module is built, see the Building modes section for details. This example uses the builder mode.

@@ -170,7 +170,7 @@ The swig executable has several other command line options you can use.

37.2.2 Building the module

-To be loaded in Scilab, the wrapper has to be build into a dynamic module (or shared library). +To be loaded in Scilab, the wrapper has to be built into a dynamic module (or shared library).

@@ -183,7 +183,7 @@ $ gcc -shared example_wrap.o -o libexample.so

-Note: we supposed in this example the path to the Scilab include directory is /usr/local/include/scilab (which is the case in a Debian environment), this sould be changed for another environment. +Note: we supposed in this example that the path to the Scilab include directory is /usr/local/include/scilab (which is the case in a Debian environment), this should be changed for another environment.

37.2.3 Loading the module

@@ -206,7 +206,7 @@ Link done.

-Which means that Scilab has sucessfully loaded the shared library. The module functions and other symbols are now available in Scilab. +which means that Scilab has successfully loaded the shared library. The module functions and other symbols are now available in Scilab.

37.2.4 Using the module

@@ -217,23 +217,29 @@ In Scilab, the function fact() is simply called as following:
 --> fact(5)
-ans =  120
+ans  =
+
+    120.
 

For the Foo global variable, the accessors need to be used:

 --> Foo_get
-ans =  3
+ans  =
+
+    3.
 
 --> Foo_set(4);
 
 --> Foo_get
-ans =  4
+ans  =
+
+    4.
 

-Note: in order to be concise, the remaining Scilab code examples assume the modules have been successfully built and loaded in Scilab. +Note: for conciseness, we assume in the subsequent Scilab code examples that the modules have been beforehand built and loaded in Scilab.

37.2.5 Scilab command line options

@@ -336,7 +342,7 @@ creates a built-in function fact(n) in Scilab:
 --> fact(4)
-ans =
+ans  =
 
     24.
 
@@ -455,10 +461,14 @@ These functions are used as following: --> Foo_set(4); --> c -c = 3 +c = + + 3. --> Foo_get() -ans = 4 +ans = + + 4.

@@ -492,17 +502,15 @@ It works the same:

--> initArrays(); --> x_get() - ans = + ans = - 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. + 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. --> y_set([0:6] / 10); --> y_get() + ans = ---> - ans = - - 0. 0.1 0.2 0.3 0.4 0.5 0.6 + 0. 0.1 0.2 0.3 0.4 0.5 0.6 @@ -531,32 +539,47 @@ the following getter functions are generated:
 --> exec loader.sce;
 --> ICONST_get();
- ans =
-      42
+ ans  =
+
+    42.
+
 --> FCONST_get();
- ans =
-      2.1828
+ ans  =
+
+    2.1828
+
 --> CCONST_get();
- ans =
-      x
+ ans  =
+
+    x
+
 --> CCONST2_get();
- ans =
+ ans  =
 
 --> SCONST_get();
- ans =
-      Hello World
+ ans  =
+
+    Hello World
+
 --> SCONST2_get();
- ans =
-      "Hello World"
+ ans  =
+
+    "Hello World"
+
 --> EXPR_get();
- ans =
-      48.5484
+ ans  =
+
+    48.5484
+
 --> iconst_get();
- ans =
-       37
+ ans  =
+
+    37.
+
 --> fconst_get();
- ans =
-       3.14
+ ans  =
+
+    3.14
 

@@ -590,32 +613,47 @@ are mapped to Scilab variables, with the same name:

 --> exec loader.sce;
 --> ICONST
- ans =
-      42
+ ans  =
+
+    42
+
 --> FCONST
- ans =
-      2.1828
+ ans  =
+
+    2.1828
+
 --> CCONST
- ans =
-      x
+ ans  =
+
+    x
+
 --> CCONST2
- ans =
+ ans  =
 
 --> SCONST
- ans =
-      Hello World
+ ans  =
+
+    Hello World
+
 --> SCONST2
- ans =
-      "Hello World"
+ ans  =
+
+    "Hello World"
+
 --> EXPR
- ans =
-      48.5484
+ ans  =
+
+    48.5484
+
 --> iconst
- ans =
-      37
+ ans  =
+
+    37
+
 --> fconst
- ans =
-      3.14
+ ans  =
+
+    3.14
 

Enumerations

@@ -638,13 +676,18 @@ a getter function will be generated for each value of the enumeration: --> exec loader.sce; --> RED_get() ans = - 0. + + 0. + --> BLUE_get() ans = - 1. + + 1. + --> GREEN_get() ans = - 2. + + 2.

@@ -661,13 +704,19 @@ typedef enum { RED, BLUE, GREEN } color; --> exec loader.sce; --> RED ans = - 0. + + 0. + --> BLUE ans = - 1. + + 1. + --> GREEN ans = - 2. + + 2. +

@@ -753,7 +802,7 @@ But it is possible to have a null pointer by using the previous functions SW --> SWIG_this(p) == 0 ans = - T + T @@ -803,7 +852,7 @@ Usage example: --> Foo_x_get(f) ans = - 100. + 100. --> Foo_arr_set(f, [0:3]); --> Foo_arr_get(f) @@ -847,7 +896,7 @@ typedef struct { --> Bar_x_get(b2); ans = - 20. + 20.

@@ -894,7 +943,8 @@ can be used in Scilab like this: --> p2 = Point_new(1, 2); --> p1.distance(p2) ans = - 3.6056 + + 3.6056 --> delete_Point(p1); --> delete_Point(p2); @@ -964,12 +1014,12 @@ But we can use either use the get_perimeter() function of the parent cl 2. --> Circle_get_perimeter(c) - ans = + ans = 18.84 --> Shape_get_perimeter(c) - ans = + ans = 18.84 @@ -1070,17 +1120,17 @@ Then in Scilab: -->IntTriplet_first_get(t) ans = - 3. + 3. -->IntTriplet_second_get(t) ans = - 4. + 4. -->IntTriplet_third_get(t) ans = - 1. + 1. -->delete_IntTriplet(t); @@ -1260,7 +1310,7 @@ It can be used with the lasterror() function as following: -->lasterror() ans = -SWIG/Scilab: Exception (char const *) occured: Bye world ! + SWIG/Scilab: Exception (char const *) occured: Bye world !

@@ -1344,7 +1394,7 @@ The following table provides the equivalent Scilab type for C/C++ primitive type

Notes: