From 9fd2976931c088dc523974afb901e96bad20f73c Mon Sep 17 00:00:00 2001 From: Harpreet Date: Thu, 4 Aug 2016 15:25:44 +0530 Subject: initial add --- build/cpp/sci_minconTMINLP.cpp | 311 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 311 insertions(+) create mode 100644 build/cpp/sci_minconTMINLP.cpp (limited to 'build/cpp/sci_minconTMINLP.cpp') diff --git a/build/cpp/sci_minconTMINLP.cpp b/build/cpp/sci_minconTMINLP.cpp new file mode 100644 index 0000000..ac688d4 --- /dev/null +++ b/build/cpp/sci_minconTMINLP.cpp @@ -0,0 +1,311 @@ +// Copyright (C) 2015 - IIT Bombay - FOSSEE +// +// Author: Harpreet Singh, Pranav Deshpande and Akshay Miterani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in +// 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 + +#include "minconTMINLP.hpp" +#include "sci_iofunc.hpp" + +extern "C" +{ +#include "call_scilab.h" +#include +#include +#include +#include +#include +#include +#include +} + +using namespace Ipopt; +using namespace Bonmin; + +#define DEBUG 0 + +minconTMINLP::~minconTMINLP() +{ + free(finalX_); +} + +// Set the type of every variable - CONTINUOUS or INTEGER +bool minconTMINLP::get_variables_types(Index n, VariableType* var_types) +{ + n = numVars_; + for(int i=0; i < n; i++) + var_types[i] = CONTINUOUS; + for(int i=0 ; i < intconSize_ ; ++i) + var_types[(int)(intcon_[i]-1)] = INTEGER; + return true; +} + +// The linearity of the variables - LINEAR or NON_LINEAR +bool minconTMINLP::get_variables_linearity(Index n, Ipopt::TNLP::LinearityType* var_types) +{ + for(int i=0;i