diff options
author | rupak | 2019-08-23 17:41:20 +0530 |
---|---|---|
committer | rupak | 2019-08-23 17:41:20 +0530 |
commit | 18719adcd3e801d072085ecb8ed60acbad3ffd0a (patch) | |
tree | 776df650afdbcd00396d30f6cc98312963439d7b | |
parent | 378f77aefd60289e955d1b180e3326e461cfcbec (diff) | |
download | fossee-scilab-octave-toolbox-18719adcd3e801d072085ecb8ed60acbad3ffd0a.tar.gz fossee-scilab-octave-toolbox-18719adcd3e801d072085ecb8ed60acbad3ffd0a.tar.bz2 fossee-scilab-octave-toolbox-18719adcd3e801d072085ecb8ed60acbad3ffd0a.zip |
scilab recieves 1D array from octave
-rw-r--r-- | build.sce | 2 | ||||
-rw-r--r-- | macros/scilab_error.bin | bin | 1951 -> 1951 bytes | |||
-rw-r--r-- | macros/scilab_sum.bin | bin | 913 -> 913 bytes | |||
-rwxr-xr-x | sci_gateway/cpp/libscilab_toolbox.so | bin | 16528 -> 16528 bytes | |||
-rw-r--r-- | sci_gateway/cpp/sci_matrix.cpp | 16 | ||||
-rw-r--r-- | thirdparty/linux/include/fun.h | 3 | ||||
-rwxr-xr-x | thirdparty/linux/lib/x64/libfun.so | bin | 2654856 -> 2670672 bytes |
7 files changed, 15 insertions, 6 deletions
@@ -18,4 +18,4 @@ ulink exec builder.sce exec loader.sce -octave_fun() +//octave_fun() diff --git a/macros/scilab_error.bin b/macros/scilab_error.bin Binary files differindex c5f954f..332cba1 100644 --- a/macros/scilab_error.bin +++ b/macros/scilab_error.bin diff --git a/macros/scilab_sum.bin b/macros/scilab_sum.bin Binary files differindex 2e854dd..ba64f9e 100644 --- a/macros/scilab_sum.bin +++ b/macros/scilab_sum.bin diff --git a/sci_gateway/cpp/libscilab_toolbox.so b/sci_gateway/cpp/libscilab_toolbox.so Binary files differindex ed9057f..9cf2138 100755 --- a/sci_gateway/cpp/libscilab_toolbox.so +++ b/sci_gateway/cpp/libscilab_toolbox.so diff --git a/sci_gateway/cpp/sci_matrix.cpp b/sci_gateway/cpp/sci_matrix.cpp index ca147a7..aa45bed 100644 --- a/sci_gateway/cpp/sci_matrix.cpp +++ b/sci_gateway/cpp/sci_matrix.cpp @@ -14,8 +14,10 @@ static const char fname[] = "octave_fun"; int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out) { -double* out1 = NULL; - + double* out1 = NULL; + int n=5; + double ar[n]; + if (nin != 0) { Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 2); @@ -27,13 +29,19 @@ if (nout != 1) Scierror(77, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1); return 1; } - *out = scilab_createDoubleMatrix2d(env, 1, 1, 0); + + fun(ar, n); + *out = scilab_createDoubleMatrix2d(env, n, 1, 0); //double retval = fun(); //printf("%f\n", retval); //*out1 = retval; scilab_getDoubleArray(env, out[0], &out1); - out1[0]=fun(); + //out1[0]=fun(); + for(int i=0; i<n; i++) + { + out1[i] = ar[i];//.float_value(); + } return 0; diff --git a/thirdparty/linux/include/fun.h b/thirdparty/linux/include/fun.h index 99ef937..d2bcdf3 100644 --- a/thirdparty/linux/include/fun.h +++ b/thirdparty/linux/include/fun.h @@ -1,2 +1,3 @@ -extern "C" double fun(); +#define fun_h__ +extern "C" int fun (double* answ, int size); diff --git a/thirdparty/linux/lib/x64/libfun.so b/thirdparty/linux/lib/x64/libfun.so Binary files differindex c118c4b..3e8cbca 100755 --- a/thirdparty/linux/lib/x64/libfun.so +++ b/thirdparty/linux/lib/x64/libfun.so |