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 41 42 43 44 45 46 47 48 49 50 51 52 53
|
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2009 - 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+"/common_read_api"));
cd(pathconvert(TMPDIR+"/common_read_api"));
copyfile(SCI+"/modules/api_scilab/tests/unit_tests/common_read_api.c",pathconvert(TMPDIR+"/common_read_api/common_read_api.c",%F));
cflags = "-I"+SCI+"/modules/localization/includes";
ilib_build("common_read",["common_read","common_read"],"common_read_api.c",[],"Makefile","",cflags);
function read_all()
d = [1,2,3;4,5,6;7,8,9];common_read(d);
s=poly(0,"x");p=1+s+2*s^2;p = [(p * 2),(p * s + 3);(p * 2 * s ** 2 - 6),(12 - 4 * p * (- s) ** 2)];common_read(p);
b = [%t,%f;%t,%f;%f,%t];common_read(b);
sp=sparse([2,-1,0,0,0;-1,2,-1,0,0;0,-1,2,-1,0;0,0,-1,2,-1;0,0,0,-1,2]);common_read(sp);
bsp=sparse([1,2;4,5;3,10],[%t,%t,%t]);common_read(bsp);
i8 = int8([1,2,3]);common_read(i8);
ui32 = uint32([3;2;1]);common_read(ui32);
str = ["may", "the", "puffin"; "be", "with","you"];common_read(str);
if with_module('umfpack') then
Cp = taucs_chfact(sp);
l = list(list(d, p, list(b, sp)), list(i8, bsp), list(ui32, str), Cp);
else
l = list(list(d, p, list(b, sp)), list(i8, bsp), list(ui32, str));
end
common_read(l)
endfunction
read_all;
Double (3 x 3)
Poly (2 x 2), varname : 'x'
Boolean (3 x 2)
Sparse (5 x 5), Item(s) : 13
Boolean Sparse (4 x 10), Item(s) : 3
Integer 8 bits (1 x 3)
Unsigned Integer 32 bits (3 x 1)
Strings (2 x 3)
List (4)
List (3)
Double (3 x 3)
Poly (2 x 2), varname : 'x'
List (2)
Boolean (3 x 2)
Sparse (5 x 5), Item(s) : 13
List (2)
Integer 8 bits (1 x 3)
Boolean Sparse (4 x 10), Item(s) : 3
List (2)
Unsigned Integer 32 bits (3 x 1)
Strings (2 x 3)
Pointer : 0x08751898
|