summaryrefslogtreecommitdiff
path: root/sci_gateway
diff options
context:
space:
mode:
Diffstat (limited to 'sci_gateway')
-rw-r--r--sci_gateway/builder_gateway.sce6
-rw-r--r--sci_gateway/cpp/builder_gateway_cpp.sce10
-rw-r--r--sci_gateway/cpp/cleaner.sce8
-rw-r--r--sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c156
-rwxr-xr-xsci_gateway/cpp/libFOSSEE_Optimization_Toolbox.sobin0 -> 199050 bytes
-rw-r--r--sci_gateway/cpp/loader.sce8
6 files changed, 173 insertions, 15 deletions
diff --git a/sci_gateway/builder_gateway.sce b/sci_gateway/builder_gateway.sce
index 514d206..de09d9c 100644
--- a/sci_gateway/builder_gateway.sce
+++ b/sci_gateway/builder_gateway.sce
@@ -1,13 +1,13 @@
// Copyright (C) 2015 - IIT Bombay - FOSSEE
//
-// Author: Harpreet Singh
-// Organization: FOSSEE, IIT Bombay
-// Email: harpreet.mertia@gmail.com
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution. The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// Author: Harpreet Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
sci_gateway_dir = get_absolute_file_path('builder_gateway.sce');
diff --git a/sci_gateway/cpp/builder_gateway_cpp.sce b/sci_gateway/cpp/builder_gateway_cpp.sce
index 3503996..c92bd7f 100644
--- a/sci_gateway/cpp/builder_gateway_cpp.sce
+++ b/sci_gateway/cpp/builder_gateway_cpp.sce
@@ -1,22 +1,24 @@
// Copyright (C) 2015 - IIT Bombay - FOSSEE
//
-// Author: Keyur Joshi, Sai Kiran, Iswarya and Harpreet Singh
-// Organization: FOSSEE, IIT Bombay
-// Email: harpreet.mertia@gmail.com
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution. The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// Author: Harpreet Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
mode(-1)
lines(0)
-toolbox_title = "FAMOS";
+toolbox_title = "FOSSEE_Optimization_Toolbox";
[a, opt] = getversion();
Version = opt(2);
+Build_64Bits = %f;
+
path_builder = get_absolute_file_path('builder_gateway_cpp.sce');
tools_path = path_builder + "../../thirdparty/linux/";
diff --git a/sci_gateway/cpp/cleaner.sce b/sci_gateway/cpp/cleaner.sce
index 27b5409..333775c 100644
--- a/sci_gateway/cpp/cleaner.sce
+++ b/sci_gateway/cpp/cleaner.sce
@@ -10,12 +10,12 @@ if fileinfo('loader.sce') <> [] then
mdelete('loader.sce');
end
// ------------------------------------------------------
-if fileinfo('libFAMOS.so') <> [] then
- mdelete('libFAMOS.so');
+if fileinfo('libFOSSEE_Optimization_Toolbox.so') <> [] then
+ mdelete('libFOSSEE_Optimization_Toolbox.so');
end
// ------------------------------------------------------
-if fileinfo('libFAMOS.c') <> [] then
- mdelete('libFAMOS.c');
+if fileinfo('libFOSSEE_Optimization_Toolbox.c') <> [] then
+ mdelete('libFOSSEE_Optimization_Toolbox.c');
end
// ------------------------------------------------------
chdir(curdir);
diff --git a/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c
new file mode 100644
index 0000000..cd53066
--- /dev/null
+++ b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c
@@ -0,0 +1,156 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <mex.h>
+#include <sci_gateway.h>
+#include <api_scilab.h>
+#include <MALLOC.h>
+static int direct_gateway(char *fname,void F(void)) { F();return 0;};
+extern Gatefunc sci_sym_open;
+extern Gatefunc sci_sym_close;
+extern Gatefunc sci_sym_isEnvActive;
+extern Gatefunc sci_sym_set_defaults;
+extern Gatefunc sci_sym_set_int_param;
+extern Gatefunc sci_sym_get_int_param;
+extern Gatefunc sci_sym_set_dbl_param;
+extern Gatefunc sci_sym_get_dbl_param;
+extern Gatefunc sci_sym_set_str_param;
+extern Gatefunc sci_sym_get_str_param;
+extern Gatefunc sci_sym_getInfinity;
+extern Gatefunc sci_sym_loadProblemBasic;
+extern Gatefunc sci_sym_loadProblem;
+extern Gatefunc sci_sym_load_mps;
+extern Gatefunc sci_sym_get_num_int;
+extern Gatefunc sci_sym_get_num_int;
+extern Gatefunc sci_sym_get_num_int;
+extern Gatefunc sci_sym_isContinuous;
+extern Gatefunc sci_sym_isBinary;
+extern Gatefunc sci_sym_isInteger;
+extern Gatefunc sci_sym_set_continuous;
+extern Gatefunc sci_sym_set_integer;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_setVarBound;
+extern Gatefunc sci_sym_setVarBound;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_setObjCoeff;
+extern Gatefunc sci_sym_getObjSense;
+extern Gatefunc sci_sym_setObjSense;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_setConstrBound;
+extern Gatefunc sci_sym_setConstrBound;
+extern Gatefunc sci_sym_setConstrType;
+extern Gatefunc sci_sym_get_matrix;
+extern Gatefunc sci_sym_get_row_sense;
+extern Gatefunc sci_sym_addConstr;
+extern Gatefunc sci_sym_addVar;
+extern Gatefunc sci_sym_delete_cols;
+extern Gatefunc sci_sym_delete_rows;
+extern Gatefunc sci_sym_getPrimalBound;
+extern Gatefunc sci_sym_setPrimalBound;
+extern Gatefunc sci_sym_setColSoln;
+extern Gatefunc sci_sym_solve;
+extern Gatefunc sci_sym_get_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_getVarSoln;
+extern Gatefunc sci_sym_getObjVal;
+extern Gatefunc sci_sym_get_iteration_count;
+extern Gatefunc sci_sym_getRowActivity;
+extern Gatefunc sci_linearprog;
+extern Gatefunc sci_rmps;
+extern Gatefunc sci_solveqp;
+extern Gatefunc sci_solveminuncp;
+extern Gatefunc sci_solveminbndp;
+extern Gatefunc sci_solveminconp;
+static GenericTable Tab[]={
+ {(Myinterfun)sci_gateway,sci_sym_open,"sym_open"},
+ {(Myinterfun)sci_gateway,sci_sym_close,"sym_close"},
+ {(Myinterfun)sci_gateway,sci_sym_isEnvActive,"sym_isEnvActive"},
+ {(Myinterfun)sci_gateway,sci_sym_set_defaults,"sym_resetParams"},
+ {(Myinterfun)sci_gateway,sci_sym_set_int_param,"sym_setIntParam"},
+ {(Myinterfun)sci_gateway,sci_sym_get_int_param,"sym_getIntParam"},
+ {(Myinterfun)sci_gateway,sci_sym_set_dbl_param,"sym_setDblParam"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_param,"sym_getDblParam"},
+ {(Myinterfun)sci_gateway,sci_sym_set_str_param,"sym_setStrParam"},
+ {(Myinterfun)sci_gateway,sci_sym_get_str_param,"sym_getStrParam"},
+ {(Myinterfun)sci_gateway,sci_sym_getInfinity,"sym_getInfinity"},
+ {(Myinterfun)sci_gateway,sci_sym_loadProblemBasic,"sym_loadProblemBasic"},
+ {(Myinterfun)sci_gateway,sci_sym_loadProblem,"sym_loadProblem"},
+ {(Myinterfun)sci_gateway,sci_sym_load_mps,"sym_loadMPS"},
+ {(Myinterfun)sci_gateway,sci_sym_get_num_int,"sym_getNumConstr"},
+ {(Myinterfun)sci_gateway,sci_sym_get_num_int,"sym_getNumVar"},
+ {(Myinterfun)sci_gateway,sci_sym_get_num_int,"sym_getNumElements"},
+ {(Myinterfun)sci_gateway,sci_sym_isContinuous,"sym_isContinuous"},
+ {(Myinterfun)sci_gateway,sci_sym_isBinary,"sym_isBinary"},
+ {(Myinterfun)sci_gateway,sci_sym_isInteger,"sym_isInteger"},
+ {(Myinterfun)sci_gateway,sci_sym_set_continuous,"sym_setContinuous"},
+ {(Myinterfun)sci_gateway,sci_sym_set_integer,"sym_setInteger"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getVarLower"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getVarUpper"},
+ {(Myinterfun)sci_gateway,sci_sym_setVarBound,"sym_setVarLower"},
+ {(Myinterfun)sci_gateway,sci_sym_setVarBound,"sym_setVarUpper"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getObjCoeff"},
+ {(Myinterfun)sci_gateway,sci_sym_setObjCoeff,"sym_setObjCoeff"},
+ {(Myinterfun)sci_gateway,sci_sym_getObjSense,"sym_getObjSense"},
+ {(Myinterfun)sci_gateway,sci_sym_setObjSense,"sym_setObjSense"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getRhs"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getConstrRange"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getConstrLower"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getConstrUpper"},
+ {(Myinterfun)sci_gateway,sci_sym_setConstrBound,"sym_setConstrLower"},
+ {(Myinterfun)sci_gateway,sci_sym_setConstrBound,"sym_setConstrUpper"},
+ {(Myinterfun)sci_gateway,sci_sym_setConstrType,"sym_setConstrType"},
+ {(Myinterfun)sci_gateway,sci_sym_get_matrix,"sym_getMatrix"},
+ {(Myinterfun)sci_gateway,sci_sym_get_row_sense,"sym_getConstrSense"},
+ {(Myinterfun)sci_gateway,sci_sym_addConstr,"sym_addConstr"},
+ {(Myinterfun)sci_gateway,sci_sym_addVar,"sym_addVar"},
+ {(Myinterfun)sci_gateway,sci_sym_delete_cols,"sym_deleteVars"},
+ {(Myinterfun)sci_gateway,sci_sym_delete_rows,"sym_deleteConstrs"},
+ {(Myinterfun)sci_gateway,sci_sym_getPrimalBound,"sym_getPrimalBound"},
+ {(Myinterfun)sci_gateway,sci_sym_setPrimalBound,"sym_setPrimalBound"},
+ {(Myinterfun)sci_gateway,sci_sym_setColSoln,"sym_setVarSoln"},
+ {(Myinterfun)sci_gateway,sci_sym_solve,"sym_solve"},
+ {(Myinterfun)sci_gateway,sci_sym_get_status,"sym_getStatus"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isOptimal"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isInfeasible"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isAbandoned"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isIterLimitReached"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isTimeLimitReached"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isTargetGapAchieved"},
+ {(Myinterfun)sci_gateway,sci_sym_getVarSoln,"sym_getVarSoln"},
+ {(Myinterfun)sci_gateway,sci_sym_getObjVal,"sym_getObjVal"},
+ {(Myinterfun)sci_gateway,sci_sym_get_iteration_count,"sym_getIterCount"},
+ {(Myinterfun)sci_gateway,sci_sym_getRowActivity,"sym_getConstrActivity"},
+ {(Myinterfun)sci_gateway,sci_linearprog,"linearprog"},
+ {(Myinterfun)sci_gateway,sci_rmps,"rmps"},
+ {(Myinterfun)sci_gateway,sci_solveqp,"solveqp"},
+ {(Myinterfun)sci_gateway,sci_solveminuncp,"solveminuncp"},
+ {(Myinterfun)sci_gateway,sci_solveminbndp,"solveminbndp"},
+ {(Myinterfun)sci_gateway,sci_solveminconp,"solveminconp"},
+};
+
+int C2F(libFOSSEE_Optimization_Toolbox)()
+{
+ Rhs = Max(0, Rhs);
+ if (*(Tab[Fin-1].f) != NULL)
+ {
+ if(pvApiCtx == NULL)
+ {
+ pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+ }
+ pvApiCtx->pstName = (char*)Tab[Fin-1].name;
+ (*(Tab[Fin-1].f))(Tab[Fin-1].name,Tab[Fin-1].F);
+ }
+ return 0;
+}
+#ifdef __cplusplus
+}
+#endif
diff --git a/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so
new file mode 100755
index 0000000..1f7e424
--- /dev/null
+++ b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so
Binary files differ
diff --git a/sci_gateway/cpp/loader.sce b/sci_gateway/cpp/loader.sce
index 37305c7..1ec953f 100644
--- a/sci_gateway/cpp/loader.sce
+++ b/sci_gateway/cpp/loader.sce
@@ -2,10 +2,10 @@
// Generated by builder.sce : Please, do not edit this file
// ----------------------------------------------------------------------------
//
-libFAMOS_path = get_absolute_file_path('loader.sce');
+libFOSSEE_Optimizat_path = get_absolute_file_path('loader.sce');
//
// ulink previous function with same name
-[bOK, ilib] = c_link('libFAMOS');
+[bOK, ilib] = c_link('libFOSSEE_Optimization_Toolbox');
if bOK then
ulink(ilib);
end
@@ -75,9 +75,9 @@ list_functions = [ 'sym_open';
'solveminbndp';
'solveminconp';
];
-addinter(libFAMOS_path + filesep() + 'libFAMOS' + getdynlibext(), 'libFAMOS', list_functions);
+addinter(libFOSSEE_Optimizat_path + filesep() + 'libFOSSEE_Optimization_Toolbox' + getdynlibext(), 'libFOSSEE_Optimization_Toolbox', list_functions);
// remove temp. variables on stack
-clear libFAMOS_path;
+clear libFOSSEE_Optimizat_path;
clear bOK;
clear ilib;
clear list_functions;