From 7e0c5dd60936148d49875a08739f803fc03e3d26 Mon Sep 17 00:00:00 2001 From: Simon Marchetto Date: Thu, 13 Mar 2014 19:07:58 +0100 Subject: [PATCH] scilab: in doc, add example for array typemaps --- Doc/Manual/Scilab.html | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/Doc/Manual/Scilab.html b/Doc/Manual/Scilab.html index 48115bf32..777be9536 100644 --- a/Doc/Manual/Scilab.html +++ b/Doc/Manual/Scilab.html @@ -807,6 +807,31 @@ It means that, if needed, a Scilab double vector is converted in input into a C And this C int array is automatically converted in output to a Scilab double vector.

+

+This example illustrates this:

+ +
+%module example
+
+%inline %{
+
+int sumArray(int values[], int len) {
+  int s = 0;
+  int i = 0;
+  for (i=0; i < len; i++)
+    s += values[i];
+  return s;
+%}
+
+ +

+

+--> sum([1. 2. 3. 5.], 4);
+ ans  =
+
+    11.
+
+

37.4.4 Pointer-to-pointers

@@ -949,7 +974,7 @@ void absolute(int *matrix, int matrixNbRow, int matrixNbCol, } %} - +

@@ -958,7 +983,7 @@ void absolute(int *matrix, int matrixNbRow, int matrixNbCol,
 
     0.    1.    2.
     3.    4.    5.
-
+

37.5 Module