diff --git a/Doc/Manual/Scilab.html b/Doc/Manual/Scilab.html index 215dae55c..a30091c97 100644 --- a/Doc/Manual/Scilab.html +++ b/Doc/Manual/Scilab.html @@ -27,7 +27,8 @@
  • Identifiers
  • Modules
  • Functions -
  • Default primitive type mappings +
  • Default primitive type mappings +
  • Scilab non-primitive type mappings
  • Global variables
  • Constants
  • Enums @@ -382,7 +383,7 @@ In that case, SWIG displays an error when wrapping a function that has long long

    37.3.5 Default type mappings for non-primitive types

    -The default mapped type for C/C++ non-primitive types is the Scilab pointer. That is the case for exemple for C structs, C++ classes, ... +The default mapped type for C/C++ non-primitive types is the Scilab pointer. That is the case for exemple for C structs, C++ classes, etc... But there are many type mappings for non-primitive types (such as enums, arrays, STL types, etc...). Each of them is described further in this document.

    @@ -620,10 +621,13 @@ ans =

    37.3.11 Arrays

    +

    +One-dimensional arrays are supported whether as global variables or functions arguments. +

    -Arrays are fully supported by SWIG and Scilab. In SWIG, they are handled as pointers. -It is easy to deal with arrays too. For example: +Global arrays are wrapped through accessor functions. +For example with two global arrays x and y:

    @@ -632,42 +636,40 @@ It is easy to deal with arrays too. For example:
     %inline %{
     int x[10];
     double y[7];
    -void initArray()
    -{
    -  int i, n;
    -
    -  n = sizeof(x)/sizeof(x[0]);
    -  for(i = 0; i > n; i++)
    -    x[i] = i;
    -
    -  n = sizeof(y)/sizeof(y[0]);
    -  for(i = 0; i < n; i++)
    -    y[i] = ((double) i)/ ((double) n);
    -  return;
     %}
     
    -

    When wrapped, the following functions are generated: x_set(), x_get(), y_set(), y_get(), and _wrap_initArray. -They can be used like this: +

    Two Scilab functions are generated for each array: a getter _get() and a setter _set(), prefixed by the array name. +Following is an example of use of these functions:

     --> exec loader.sce
     
    ---> initArray();
    +--> x_set([0:9]);
     --> x_get()
     ans =
     
       0  1  2  3  4  5  6  7  8  9
    +
    +--> y_set([0:6] / 7);
     --> y_get()
    +
    +-->
     ans =
     
       0.    0.1428571    0.2857143    0.4285714    0.5714286    0.7142857   0.8571429
     
    -

    37.3.12 Matrices

    +

    +The type mappings used for arrays is described in 37.3.4. +It means that, if needed, a Scilab double vector is converted in input into a C int array. +And this C int array is automatically converted in output to a Scilab double vector. +

    +

    37.3.12 Matrices

    +

    Scilab uses matrices a lot for numerical mathematics and scientific visualization. Supporting matrices makes Scilab more convenient. For example:

    @@ -829,7 +831,7 @@ Standard Template Library (STL) is partially supported.

    The following containers are usable:

    - +l