summaryrefslogtreecommitdiff
path: root/sci_gateway/cpp
diff options
context:
space:
mode:
authorttt2019-09-04 16:33:11 +0530
committerttt2019-09-04 16:33:11 +0530
commit08e0c7b9e0b0bdaaae8365a905af0198550a7c61 (patch)
treee40b8784cc78fd002b563c5b0a6c961e74f792a3 /sci_gateway/cpp
parentb733c1d648b90b0ea1958dae1130e76f895fd873 (diff)
downloadfossee-scilab-octave-toolbox-08e0c7b9e0b0bdaaae8365a905af0198550a7c61.tar.gz
fossee-scilab-octave-toolbox-08e0c7b9e0b0bdaaae8365a905af0198550a7c61.tar.bz2
fossee-scilab-octave-toolbox-08e0c7b9e0b0bdaaae8365a905af0198550a7c61.zip
success: call octave with one input vector/scalar with func name and opt string args
Diffstat (limited to 'sci_gateway/cpp')
-rwxr-xr-xsci_gateway/cpp/libscilab_toolbox.sobin17408 -> 17368 bytes
-rw-r--r--sci_gateway/cpp/sci_matrix.cpp54
2 files changed, 45 insertions, 9 deletions
diff --git a/sci_gateway/cpp/libscilab_toolbox.so b/sci_gateway/cpp/libscilab_toolbox.so
index 523db58..5e204b2 100755
--- a/sci_gateway/cpp/libscilab_toolbox.so
+++ b/sci_gateway/cpp/libscilab_toolbox.so
Binary files differ
diff --git a/sci_gateway/cpp/sci_matrix.cpp b/sci_gateway/cpp/sci_matrix.cpp
index f2622b8..c2da80c 100644
--- a/sci_gateway/cpp/sci_matrix.cpp
+++ b/sci_gateway/cpp/sci_matrix.cpp
@@ -21,24 +21,53 @@ static const char fname[] = "octave_fun";
int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out)
{
+/*
+ printf("%d\n", nin);
+ int row = 0;
+ int col = 0;
+ int size = 0;
+ size = scilab_getDim2d(env, in[0], &row, &col);
+ printf("%d\n", row);
+ printf("%d\n", col);
+ int i=3;
+*/
+///////////////////First Input/////////////////////
+ double* n = NULL;
+ int row = 0;
+ int col = 0;
+ int size = 0;
+ size = scilab_getDim2d(env, in[0], &row, &col);
+ scilab_getDoubleArray(env, in[0], &n);
+ double ar[(int)n[0]];
+
+// if((int)n[0]!=NULL)
+// if(in[i]!=NULL)
+// printf("\nInput %d is not null\n",i);
- double* out1 = NULL;
- double* n;
+////////////////Second Input/////////////////////
wchar_t* in1 = 0;
char str[20];
- scilab_getDoubleArray(env, in[0], &n);
- double ar[(int)n[0]];
-
scilab_getString(env, in[1], &in1);
//printf("%S\n", in1);
wcstombs(str, in1, sizeof(str));
//printf("%s\n", str);
-
+////////////////Third Input/////////////////////
+ wchar_t* in4 = 0;
+
+ char str2[20];
+
+ scilab_getString(env, in[2], &in4);
+ //printf("%S\n", in1);
+
+ wcstombs(str2, in4, sizeof(str2));
+ //printf("%s\n", str);
+
+
//if (nin != 0)
// {
@@ -52,11 +81,18 @@ if (nout != 1)
return 1;
}
- fun(ar, n[0],str);
- *out = scilab_createDoubleMatrix2d(env, n[0], 1, 0);
+ double inp[col];
- scilab_getDoubleArray(env, out[0], &out1);
+ for(int i=0; i<col; i++)
+ {
+ inp[i] = n[i];//.float_value();
+ }
+ fun(ar, inp, col, str, str2);
+ out[0] = scilab_createDoubleMatrix2d(env, n[0], 1, 0);
+
+ double* out1 = NULL;
+ scilab_getDoubleArray(env, out[0], &out1);
for(int i=0; i<n[0]; i++)
{