File: runme.sci

package info (click to toggle)
renderdoc 1.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 79,584 kB
  • sloc: cpp: 491,671; ansic: 285,823; python: 12,617; java: 11,345; cs: 7,181; makefile: 6,703; yacc: 5,682; ruby: 4,648; perl: 3,461; php: 2,119; sh: 2,068; lisp: 1,835; tcl: 1,068; ml: 747; xml: 137
file content (39 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
  disp(lasterror());
  exit(ierr);
end
example_Init();

// This example shows how to use C++ fonctions with STL lists arguments
// Here, STL lists are converted from/to Scilab matrices (SWIG_SCILAB_EXTRA_NATIVE_CONTAINERS is not defined)

// integer lists

disp("Example of passing matrices of int as list arguments of C++ functions.");
disp("get a list of int {1...4} from create_integer_list():");
is = create_integer_list(1, 4);
disp(is);
disp("get the sum of this list elements with sum_integer_list():")
sum = sum_integer_list(is);
disp(is);
is2 = create_integer_list(3, 6);
disp("concat this list with the list of int {3...6} with concat_integer_list():");
is3 = concat_integer_list(is, is2);
disp(is3);

// string lists

disp("Example of passing matrices of string as list arguments of C++ functions.");
disp("get a list of string {''aa'', ''bb'', ''cc'', ''dd''} with create_string_list():");
ss = create_string_list("aa bb cc dd");
disp(ss);
ss2 = create_string_list("cc dd ee ff");
disp("concat this list with the list of string {''cc'', ''dd'', ''ee'', ''ff''} with concat_string_list():");
ss3 = concat_string_list(ss, ss2);
disp(ss3);

exit