accsum

accsum Commit Details

Date:2015-09-02 14:35:09 (2 years 10 months ago)
Author:John Gliksberg
Commit:32
Parents: 31
Message:restored gw comp. with s5 + cleanup + return 1 if error
Changes:
M/sci_gateway/builder_gateway.sce
M/tests/unit_tests/dblcompsum.tst
M/tests/unit_tests/dcs.dia.ref
M/sci_gateway/c/sci_accsum_fcompsum.c
M/tests/unit_tests/sumcond.tst
M/tests/unit_tests/order.tst
M/tests/unit_tests/fasttwosum.tst
M/tests/unit_tests/wilkinson.tst
M/tests/unit_tests/fdcs.tst
M/tests/unit_tests/orderdynamic.tst
M/tests/unit_tests/straight.dia.ref
M/tests/unit_tests/compsum.tst
M/tests/unit_tests/scs.dia.ref
M/tests/unit_tests/fcompsum.dia.ref
M/sci_gateway/c/builder_gateway_c.sce
M/tests/unit_tests/shuffle.dia.ref
M/tests/unit_tests/higham.dia.ref
M/tests/unit_tests/twosum.dia.ref
M/tests/unit_tests/priestx.dia.ref
M/sci_gateway/c/sci_accsum_fdcs.c
M/tests/unit_tests/fscs.tst
M/tests/unit_tests/dblcompsum.dia.ref
M/tests/unit_tests/sumcond.dia.ref
M/tests/unit_tests/dcs.tst
M/tests/unit_tests/order.dia.ref
M/tests/unit_tests/fasttwosum.dia.ref
M/tests/unit_tests/wilkinson.dia.ref
M/tests/unit_tests/fdcs.dia.ref
M/sci_gateway/c/sci_accsum_fscs.c
M/tests/unit_tests/orderdynamic.dia.ref
M/src/c/cleaner.sce
M/tests/unit_tests/compsum.dia.ref
M/builder.sce
M/tests/unit_tests/straight.tst
M/tests/unit_tests/scs.tst
M/tests/unit_tests/fcompsum.tst
M/tests/unit_tests/fscs.dia.ref
M/tests/unit_tests/shuffle.tst
M/tests/unit_tests/higham.tst
M/tests/unit_tests/priestx.tst
M/tests/unit_tests/twosum.tst

File differences

builder.sce
1212
1313
1414
15
16
17
18
19
20
21
22
23
24
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
2538
26
27
28
29
30
3139
32
33
34
35
36
37
38
39
40
40
41
//
mode(-1);
lines(0);
//setenv("DEBUG_SCILAB_DYNAMIC_LINK","YES");
setenv("__USE_DEPRECATED_STACK_FUNCTIONS__", "YES");
try
getversion("scilab");
catch
error(gettext("Scilab 5.0 or more is required."));
end;
// ====================================================================
if ~with_module("development_tools") then
error(msprintf(gettext("%s module not installed."),"development_tools"));
function accsumBuildToolbox()
//setenv("DEBUG_SCILAB_DYNAMIC_LINK","YES");
v = getversion("scilab");
if v(1) < 5 ..
| (v(1) == 5 ..
& v(2) < 3) then
error(gettext("Scilab 5.3 or more is required."));
end
TOOLBOX_NAME = "accsum";
TOOLBOX_TITLE = "Accsum";
toolbox_dir = get_absolute_file_path("builder.sce");
tbx_builder_src(toolbox_dir);
tbx_builder_gateway(toolbox_dir);
tbx_builder_macros(toolbox_dir);
tbx_builder_help(toolbox_dir);
tbx_build_loader(TOOLBOX_NAME, toolbox_dir);
tbx_build_cleaner(TOOLBOX_NAME, toolbox_dir);
clear toolbox_dir TOOLBOX_NAME TOOLBOX_TITLE;
end
// ====================================================================
TOOLBOX_NAME = "accsum";
TOOLBOX_TITLE = "Accsum";
// ====================================================================
toolbox_dir = get_absolute_file_path("builder.sce");
tbx_builder_src(toolbox_dir);
tbx_builder_gateway(toolbox_dir);
tbx_builder_macros(toolbox_dir);
tbx_builder_help(toolbox_dir);
tbx_build_loader(TOOLBOX_NAME, toolbox_dir);
tbx_build_cleaner(TOOLBOX_NAME, toolbox_dir);
clear toolbox_dir TOOLBOX_NAME TOOLBOX_TITLE;
// ====================================================================
accsumBuildToolbox();
clear accsumBuildToolbox;
sci_gateway/builder_gateway.sce
1212
1313
1414
15
15
16
1617
tbx_build_gateway_loader("c", sci_gateway_dir);
tbx_build_gateway_clean("c", sci_gateway_dir);
clear tbx_builder_gateway_lang tbx_build_gateway_loader;
clear tbx_builder_gateway_lang;
clear tbx_build_gateway_loader;
clear sci_gateway_dir;
sci_gateway/c/sci_accsum_fcompsum.c
77
88
99
10
11
12
13
1410
1511
1612
......
1814
1915
2016
21
22
17
18
2319
24
20
21
22
23
24
25
2526
26
27
28
29
30
31
32
33
34
27
28
29
30
31
32
33
34
35
36
3537
36
38
39
40
41
3742
38
39
43
44
4045
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
7685
7786
7887
......
8493
8594
8695
87
96
8897
8998
90
99
91100
92101
93102
......
96105
97106
98107
99
108
100109
101110
102111
103
112
104113
105114
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
/* -------------------------------------------------------------------------- */
/* This gateway uses the new scilab api
/* -------------------------------------------------------------------------- */
#include "machine.h"
#include "Scierror.h"
#include "api_scilab.h"
#include "accsum.h"
// s = accsum_fcompsum(x)
// [s,e] = accsum_fcompsum(x)
// s = accsum_fcompsum(x)
// [s,e] = accsum_fcompsum(x)
// returns the sum of x, with a compensated summation.
int sci_accsum_fcompsum (char * fname, void* pvApiCtx) {
#if SCI_VERSION_MAJOR < 6
int sci_accsum_fcompsum(char * fname)
#else
int sci_accsum_fcompsum(char * fname, void * pvApiCtx)
#endif
{
SciErr sciErr;
int *piAddr = NULL;
int iType = 0;
int rowsX,colsX;
double* lX = NULL;
int iComplex = 0;
int i;
double s;
double e;
SciErr sciErr;
int * piAddr = NULL;
int iType = 0;
int rowsX;
int colsX;
double * lX = NULL;
int iComplex = 0;
int i;
double s;
double e;
int minlhs=1, minrhs=1, maxlhs=2, maxrhs=1;
int minlhs = 1;
int minrhs = 1;
int maxlhs = 2;
int maxrhs = 1;
CheckRhs(minrhs,maxrhs) ;
CheckLhs(minlhs,maxlhs) ;
CheckRhs(minrhs, maxrhs) ;
CheckLhs(minlhs, maxlhs) ;
//
// Read X
//
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
sciErr = getVarType(pvApiCtx, piAddr, &iType);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
if ( iType != sci_matrix )
{
Scierror(999,_("%s: Wrong type for input argument #%d. Matrix expected.\n"),fname,1);
return 0;
}
iComplex= isVarComplex(pvApiCtx, piAddr);
if ( iComplex == 1 )
{
Scierror(999,_("%s: Wrong content for input argument #%d. Real matrix expected.\n"),fname,1);
return 0;
}
sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &rowsX, &colsX, &lX);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
//
// Perform the sum
//
//
// Read X
//
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
sciErr = getVarType(pvApiCtx, piAddr, &iType);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
if ( iType != sci_matrix )
{
Scierror(999, _("%s: Wrong type for input argument #%d. "
"Matrix expected.\n"),
fname, 1);
return 1;
}
iComplex = isVarComplex(pvApiCtx, piAddr);
if ( iComplex == 1 )
{
Scierror(999, _("%s: Wrong content for input argument #%d. "
"Real matrix expected.\n"),
fname, 1);
return 1;
}
sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &rowsX, &colsX, &lX);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
//
// Perform the sum
//
accsum_fcompsum(lX, rowsX*colsX, &s, &e);
//
// Set LHS
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
return 1;
}
LhsVar(1) = Rhs+1;
}
}
if ( Lhs==2 )
{
//
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
return 1;
}
LhsVar(2) = Rhs+2;
}
return(0);
return 0;
}
sci_gateway/c/sci_accsum_fscs.c
77
88
99
10
11
12
13
1410
1511
1612
......
1814
1915
2016
21
22
17
18
2319
24
20
21
22
23
24
25
2526
26
27
28
29
30
31
32
33
34
27
28
29
30
31
32
33
34
35
36
3537
36
38
39
40
41
3742
38
39
43
44
4045
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
7584
7685
7786
......
8493
8594
8695
87
96
8897
8998
90
99
91100
92101
93102
......
96105
97106
98107
99
108
100109
101110
102111
103112
104
113
105114
106115
107116
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
/* -------------------------------------------------------------------------- */
/* This gateway uses the new scilab api
/* -------------------------------------------------------------------------- */
#include "machine.h"
#include "Scierror.h"
#include "api_scilab.h"
#include "accsum.h"
// s = accsum_fdcs(x)
// [s,e] = accsum_fdcs(x)
// s = accsum_fdcs(x)
// [s,e] = accsum_fdcs(x)
// returns the sum of x, with a simply compensated summation.
int sci_accsum_fscs (char * fname, void* pvApiCtx) {
#if SCI_VERSION_MAJOR < 6
int sci_accsum_fscs(char * fname)
#else
int sci_accsum_fscs(char * fname, void * pvApiCtx)
#endif
{
SciErr sciErr;
int *piAddr = NULL;
int iType = 0;
int rowsX,colsX;
double* lX = NULL;
int iComplex = 0;
int i;
double s;
double e;
SciErr sciErr;
int * piAddr = NULL;
int iType = 0;
int rowsX;
int colsX;
double * lX = NULL;
int iComplex = 0;
int i;
double s;
double e;
int minlhs=1, minrhs=1, maxlhs=2, maxrhs=1;
int minlhs = 1;
int minrhs = 1;
int maxlhs = 2;
int maxrhs = 1;
CheckRhs(minrhs,maxrhs) ;
CheckLhs(minlhs,maxlhs) ;
CheckRhs(minrhs, maxrhs) ;
CheckLhs(minlhs, maxlhs) ;
//
// Read X
//
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
sciErr = getVarType(pvApiCtx, piAddr, &iType);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
if ( iType != sci_matrix )
{
Scierror(999,_("%s: Wrong type for input argument #%d. Matrix expected.\n"),fname,1);
return 0;
}
iComplex= isVarComplex(pvApiCtx, piAddr);
if ( iComplex == 1 )
{
Scierror(999,_("%s: Wrong content for input argument #%d. Real matrix expected.\n"),fname,1);
return 0;
}
sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &rowsX, &colsX, &lX);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
//
// Perform the sum
//
// Read X
//
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
sciErr = getVarType(pvApiCtx, piAddr, &iType);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
if ( iType != sci_matrix )
{
Scierror(999, _("%s: Wrong type for input argument #%d. "
"Matrix expected.\n"),
fname, 1);
return 1;
}
iComplex = isVarComplex(pvApiCtx, piAddr);
if ( iComplex == 1 )
{
Scierror(999, _("%s: Wrong content for input argument #%d. "
"Real matrix expected.\n"),
fname, 1);
return 1;
}
sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &rowsX, &colsX, &lX);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
//
// Perform the sum
accsum_fscs(lX, rowsX*colsX, &s, &e);
//
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
return 1;
}
LhsVar(1) = Rhs+1;
}
}
if ( Lhs==2 )
{
//
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
return 1;
}
LhsVar(2) = Rhs+2;
}
return(0);
return 0;
}
sci_gateway/c/sci_accsum_fdcs.c
77
88
99
10
11
12
13
1410
1511
1612
......
1814
1915
2016
21
22
17
18
2319
24
20
21
22
23
24
25
2526
26
27
28
29
30
31
32
33
34
27
28
29
30
31
32
33
34
35
36
3537
36
38
39
40
41
3742
38
39
43
44
4045
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
7584
7685
7786
......
8493
8594
8695
87
96
8897
8998
90
99
91100
92101
93102
......
96105
97106
98107
99
108
100109
101110
102111
103112
104
113
105114
106115
107116
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
/* -------------------------------------------------------------------------- */
/* This gateway uses the new scilab api
/* -------------------------------------------------------------------------- */
#include "machine.h"
#include "Scierror.h"
#include "api_scilab.h"
#include "accsum.h"
// s = accsum_fdcs(x)
// [s,e] = accsum_fdcs(x)
// s = accsum_fdcs(x)
// [s,e] = accsum_fdcs(x)
// returns the sum of x, with a doubly compensated summation.
int sci_accsum_fdcs (char * fname, void* pvApiCtx) {
#if SCI_VERSION_MAJOR < 6
int sci_accsum_fdcs(char * fname)
#else
int sci_accsum_fdcs(char * fname, void * pvApiCtx)
#endif
{
SciErr sciErr;
int *piAddr = NULL;
int iType = 0;
int rowsX,colsX;
double* lX = NULL;
int iComplex = 0;
int i;
double s;
double e;
SciErr sciErr;
int * piAddr = NULL;
int iType = 0;
int rowsX;
int colsX;
double * lX = NULL;
int iComplex = 0;
int i;
double s;
double e;
int minlhs=1, minrhs=1, maxlhs=2, maxrhs=1;
int minlhs = 1;
int minrhs = 1;
int maxlhs = 2;
int maxrhs = 1;
CheckRhs(minrhs,maxrhs) ;
CheckLhs(minlhs,maxlhs) ;
CheckRhs(minrhs, maxrhs) ;
CheckLhs(minlhs, maxlhs) ;
//
// Read X
//
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
sciErr = getVarType(pvApiCtx, piAddr, &iType);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
if ( iType != sci_matrix )
{
Scierror(999,_("%s: Wrong type for input argument #%d. Matrix expected.\n"),fname,1);
return 0;
}
iComplex= isVarComplex(pvApiCtx, piAddr);
if ( iComplex == 1 )
{
Scierror(999,_("%s: Wrong content for input argument #%d. Real matrix expected.\n"),fname,1);
return 0;
}
sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &rowsX, &colsX, &lX);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
}
//
// Perform the sum
//
// Read X
//
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
sciErr = getVarType(pvApiCtx, piAddr, &iType);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
if ( iType != sci_matrix )
{
Scierror(999, _("%s: Wrong type for input argument #%d. "
"Matrix expected.\n"),
fname, 1);
return 1;
}
iComplex = isVarComplex(pvApiCtx, piAddr);
if ( iComplex == 1 )
{
Scierror(999, _("%s: Wrong content for input argument #%d. "
"Real matrix expected.\n"),
fname, 1);
return 1;
}
sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &rowsX, &colsX, &lX);
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 1;
}
//
// Perform the sum
accsum_fdcs(lX, rowsX*colsX, &s, &e);
//
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
return 1;
}
LhsVar(1) = Rhs+1;
}
}
if ( Lhs==2 )
{
//
if(sciErr.iErr)
{
printError(&sciErr, 0);
return 0;
return 1;
}
LhsVar(2) = Rhs+2;
}
return(0);
return 0;
}
sci_gateway/c/builder_gateway_c.sce
1111
1212
1313
14
15
14
15
1616
1717
1818
......
3232
3333
3434
35
36
37
38
39
40
41
35
4236
43
gateway_path = get_absolute_file_path("builder_gateway_c.sce");
libname = "accsumgateway";
namelist = [
"accsum_fdcs" "sci_accsum_fdcs"
"accsum_fscs" "sci_accsum_fscs"
"accsum_fdcs" "sci_accsum_fdcs"
"accsum_fscs" "sci_accsum_fscs"
"accsum_fcompsum" "sci_accsum_fcompsum"
];
tbx_build_gateway(libname, namelist, files, gateway_path, libs, "", includes_src_c);
endfunction
if %t then
builder_gw_c();
else
old_build();
end
builder_gw_c();
clear builder_gw_c; // remove builder_gw_c on stack
clear old_build;
tests/unit_tests/fscs.dia.ref
77
88
99
10
10
1111
1212
1313
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_fscs ( [2 1] );
assert_checkequal(s,3);
tests/unit_tests/priestx.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = accsum_priestx ( )
x =
tests/unit_tests/higham.tst
77
88
99
10
10
1111
1212
1313
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = accsum_higham ( );
tests/unit_tests/twosum.tst
77
88
99
10
10
1111
1212
1313
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,t] = accsum_twosum ( 2 , 1 );
tests/unit_tests/dblcompsum.tst
77
88
99
10
10
1111
1212
1313
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_dblcompsum ( [2 1] );
tests/unit_tests/sumcond.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = 1:10;
[s,c] = accsum_sumcond(x);
tests/unit_tests/order.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = [-9.9 5.5 2.2 -3.3 -6.6 0 1.1]
x =
tests/unit_tests/dcs.tst
77
88
99
10
10
1111
1212
1313
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_dcs ( [2 1] );
tests/unit_tests/wilkinson.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
// Example with r = 3
x = accsum_wilkinson (3);
tests/unit_tests/fasttwosum.tst
77
88
99
10
10
1111
1212
1313
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,t] = accsum_fasttwosum ( 2 , 1 );
tests/unit_tests/fdcs.tst
88
99
1010
11
11
1212
1313
1414
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_fdcs ( [2 1] );
tests/unit_tests/orderdynamic.tst
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
// Test on simple data
tests/unit_tests/compsum.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_compsum ( [2 1] );
assert_checkequal(s,3);
tests/unit_tests/straight.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = 1:10;
s = accsum_straight(x);
tests/unit_tests/fcompsum.dia.ref
77
88
99
10
10
1111
1212
1313
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_fcompsum ( [2 1] );
assert_checkequal(s,3);
tests/unit_tests/scs.tst
77
88
99
10
10
1111
1212
1313
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_scs ( [2 1] );
tests/unit_tests/higham.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = accsum_higham ( );
// With direct input x: expected = 0
tests/unit_tests/twosum.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,t] = accsum_twosum ( 2 , 1 );
assert_checkequal(s,3);
tests/unit_tests/shuffle.tst
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = (0:10);
tests/unit_tests/priestx.tst
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = accsum_priestx ( )
tests/unit_tests/fscs.tst
88
99
1010
11
11
1212
1313
1414
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_fscs ( [2 1] );
tests/unit_tests/dblcompsum.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_dblcompsum ( [2 1] );
assert_checkequal(s,3);
tests/unit_tests/dcs.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_dcs ( [2 1] );
assert_checkequal(s,3);
tests/unit_tests/sumcond.tst
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = 1:10;
tests/unit_tests/fasttwosum.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,t] = accsum_fasttwosum ( 2 , 1 );
assert_checkequal(s,3);
tests/unit_tests/order.tst
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = [-9.9 5.5 2.2 -3.3 -6.6 0 1.1]
for o = 1 : 7
tests/unit_tests/wilkinson.tst
77
88
99
10
10
1111
1212
1313
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
// Example with r = 3
tests/unit_tests/fdcs.dia.ref
77
88
99
10
10
1111
1212
1313
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_fdcs ( [2 1] );
assert_checkequal(s,3);
tests/unit_tests/orderdynamic.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
// Test on simple data
x = [-9.9 5.5 2.2 -3.3 -6.6 0 1.1]
tests/unit_tests/compsum.tst
77
88
99
10
10
1111
1212
1313
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_compsum ( [2 1] );
tests/unit_tests/straight.tst
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = 1:10;
tests/unit_tests/scs.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_scs ( [2 1] );
assert_checkequal(s,3);
tests/unit_tests/fcompsum.tst
88
99
1010
11
11
1212
1313
1414
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
[s,e] = accsum_fcompsum ( [2 1] );
tests/unit_tests/shuffle.dia.ref
66
77
88
9
9
1010
1111
1212
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
// <-- JVM NOT MANDATORY -->
// <-- CLI SHELL MODE -->
// <-- ENGLISH IMPOSED -->
x = (0:10);
y1 = accsum_shuffle ( x );
src/c/cleaner.sce
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// This file is released under the 3-clause BSD license. See COPYING-BSD.
// Generated by builder.sce : Please, do not edit this file
// cleaner.sce
// ------------------------------------------------------
curdir = pwd();
cleaner_path = get_file_path('cleaner.sce');
chdir(cleaner_path);
// ------------------------------------------------------
if fileinfo('loader.sce') <> [] then
mdelete('loader.sce');
end
// ------------------------------------------------------
if fileinfo('Makelib.mak') <> [] then
unix_s('nmake /Y /nologo /f Makelib.mak clean');
mdelete('Makelib.mak');
end
// ------------------------------------------------------
if isdir('Debug') then
rmdir('Debug','s');
end
// ------------------------------------------------------
if isdir('Release') then
rmdir('Release','s');
end
// ------------------------------------------------------
if fileinfo('libaccsum.dll') <> [] then
mdelete('libaccsum.dll');
end
// ------------------------------------------------------
chdir(curdir);
// ------------------------------------------------------
// This file is released under the 3-clause BSD license. See COPYING-BSD.
// Generated by builder.sce : Please, do not edit this file
// cleaner.sce
// ------------------------------------------------------
curdir = pwd();
cleaner_path = get_file_path('cleaner.sce');
chdir(cleaner_path);
// ------------------------------------------------------
if fileinfo('loader.sce') <> [] then
mdelete('loader.sce');
end
// ------------------------------------------------------
if fileinfo('libaccsum.so') <> [] then
mdelete('libaccsum.so');
end
// ------------------------------------------------------
chdir(curdir);
// ------------------------------------------------------

Archive Download the corresponding diff file

Revision: 32