diff options
author | rupak | 2019-10-15 11:23:39 +0530 |
---|---|---|
committer | rupak | 2019-10-15 11:23:39 +0530 |
commit | c6dfab2ab3197682e4fdb78b1b54887ce0161d7c (patch) | |
tree | 4f76f4b5b3e005f3e6a931a7baf635a3036f9cb7 /sci_gateway/cpp | |
parent | 01779a9f1594491392d9db34c8ed3da61e8a3ab1 (diff) | |
download | fossee-scilab-octave-toolbox-c6dfab2ab3197682e4fdb78b1b54887ce0161d7c.tar.gz fossee-scilab-octave-toolbox-c6dfab2ab3197682e4fdb78b1b54887ce0161d7c.tar.bz2 fossee-scilab-octave-toolbox-c6dfab2ab3197682e4fdb78b1b54887ce0161d7c.zip |
fixed complex input bug
Diffstat (limited to 'sci_gateway/cpp')
-rwxr-xr-x | sci_gateway/cpp/libscilab_octave.so | bin | 17160 -> 17160 bytes | |||
-rw-r--r-- | sci_gateway/cpp/sci_octave.cpp | 11 |
2 files changed, 7 insertions, 4 deletions
diff --git a/sci_gateway/cpp/libscilab_octave.so b/sci_gateway/cpp/libscilab_octave.so Binary files differindex 32f1555..1c7e6cb 100755 --- a/sci_gateway/cpp/libscilab_octave.so +++ b/sci_gateway/cpp/libscilab_octave.so diff --git a/sci_gateway/cpp/sci_octave.cpp b/sci_gateway/cpp/sci_octave.cpp index 939d05b..bf47b9e 100644 --- a/sci_gateway/cpp/sci_octave.cpp +++ b/sci_gateway/cpp/sci_octave.cpp @@ -38,8 +38,8 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o int i,j; double* d; - double* rd; - double* cd; + double* rd = NULL;; + double* cd = NULL;; int size; char str[20]; char* c; @@ -56,11 +56,12 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o ins[i].type = TYPE_DOUBLE; if(scilab_isComplex(env, in[i])==1) { + //printf("input %d is complex \n", i); ins[i].is_in_cmplx=1; size = scilab_getDim2d(env, in[i], &row, &col); ins[i].n_in_rows = row; ins[i].n_in_cols = col; - scilab_getDoubleComplexArray(env, in[0],&in_real, &in_img); + scilab_getDoubleComplexArray(env, in[i],&in_real, &in_img); ins[i].in_data_real = malloc(sizeof(double)*size); ins[i].in_data_img = malloc(sizeof(double)*size); @@ -76,12 +77,14 @@ int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* o rd[k] = in_real[p + q*row]; cd[k] = in_img[p + q*row]; k++; - //printf("%f\n",d[j]); + //printf("%d\n",in_real[k]); + //printf("%d\n",in_img[k]); } } } else { + //printf("input %d is NOT complex \n", i); ins[i].is_in_cmplx=0; size = scilab_getDim2d(env, in[i], &row, &col); ins[i].n_in_rows = row; |