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 40
|
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2009-2010 - DIGITEO - Scilab Consortium Operational Team
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- JVM NOT MANDATORY -->
ilib_verbose(0);
mkdir(pathconvert(TMPDIR+"/doubleExample"));
cd(pathconvert(TMPDIR+"/doubleExample"));
copyfile(SCI+"/modules/api_scilab/tests/unit_tests/doubleExample.c",pathconvert(TMPDIR+"/doubleExample/doubleExample.c",%F));
cflags = "-I"+SCI+"/modules/localization/includes";
ilib_build("doubleExample",["doubleExample","doubleExample"],"doubleExample.c",[],"","",cflags);
exec("loader.sce");
a = 1;
b = %i;
c = [1,2,3;4,5,6];
d = c(1:$) + c($:-1:1) * %i;
doubleExample(a) == a
ans =
T
doubleExample(b) == b
ans =
T
doubleExample(c) == c
ans =
T T T
T T T
doubleExample(d) == d
ans =
T
T
T
T
T
T
|