summaryrefslogtreecommitdiff
path: root/modules/interpolation/tests/unit_tests/splin3d.dia.ref
blob: fcf6b42de18e56251cacc258129afdc923105aee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2008 - DIGITEO - Allan CORNET
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
function v=f(x,y,z)
    v=cos(2*%pi*x).*sin(2*%pi*y).*cos(2*%pi*z)
endfunction
// n x n x n  interpolation points
n = 10;
// interpolation grid
x = linspace(0,1,n); y=x; z=x;
[X,Y,Z] = ndgrid(x,y,z);
V = f(X,Y,Z);
tl = splin3d(x,y,z,V,[5 5 5]);
assert_checkequal(type(tl), 16);
assert_checkequal(size(tl), 7);
assert_checkequal(type(tl(1)), 10);
assert_checkequal(size(tl(2)), [15 1]);
assert_checkequal(size(tl(3)), [15 1]);
assert_checkequal(size(tl(4)), [15 1]);
assert_checkequal(size(tl(6)), [1000 1]);
assert_checkequal(size(tl(7)), [6 1]);