diff options
Diffstat (limited to 'sci_gateway/cpp/sci_matrix.cpp')
-rw-r--r-- | sci_gateway/cpp/sci_matrix.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sci_gateway/cpp/sci_matrix.cpp b/sci_gateway/cpp/sci_matrix.cpp index 2b2c544..ca147a7 100644 --- a/sci_gateway/cpp/sci_matrix.cpp +++ b/sci_gateway/cpp/sci_matrix.cpp @@ -5,13 +5,16 @@ extern "C" #include<sciprint.h> #include<api_scilab.h> #include "localization.h" -#include<fun.h> +#include "fun.h" +#include <cstdio> +#include <math.h> 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; if (nin != 0) { @@ -24,17 +27,14 @@ 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); + //double retval = fun(); + //printf("%f\n", retval); + //*out1 = retval; + scilab_getDoubleArray(env, out[0], &out1); + out1[0]=fun(); - //int x = fun(); - //typename (x); - double x = fun(); - //sciprint("%f\n", fun()); - - out[0] = scilab_createDouble(env, x); - - //out[0] = scilab_createDoubleMatrix(env, 20, 1, 0); - //scilab_getDoubleArray(env, out[0], &x); return 0; } |