From 2269cb2d89c9e27b1edeb14849f201e90cbf89f7 Mon Sep 17 00:00:00 2001 From: Harpreet Date: Wed, 31 Aug 2016 01:43:18 +0530 Subject: Windows 32 bit bug fixed and third party updated --- sci_gateway/cpp/sci_QuadNLP.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'sci_gateway/cpp/sci_QuadNLP.cpp') diff --git a/sci_gateway/cpp/sci_QuadNLP.cpp b/sci_gateway/cpp/sci_QuadNLP.cpp index 8ec6f40..15c16be 100644 --- a/sci_gateway/cpp/sci_QuadNLP.cpp +++ b/sci_gateway/cpp/sci_QuadNLP.cpp @@ -28,15 +28,15 @@ extern "C"{ #include "IpoptConfig.h" #endif -double x_static,i, *op_obj_x = NULL,*op_obj_value = NULL; - using namespace Ipopt; QuadNLP::~QuadNLP() - { - free(finalX_); - free(finalZl_); - free(finalZu_);} +{ + if(finalX_) delete[] finalX_; + if(finalZl_) delete[] finalZl_; + if(finalZu_) delete[] finalZu_; + if(finalLambda_) delete[] finalLambda_; +} //get NLP info such as number of variables,constraints,no.of elements in jacobian and hessian to allocate memory bool QuadNLP::get_nlp_info(Index& n, Index& m, Index& nnz_jac_g, Index& nnz_h_lag, IndexStyleEnum& index_style){ @@ -196,25 +196,25 @@ void QuadNLP::finalize_solution(SolverReturn status, const IpoptData* ip_data, IpoptCalculatedQuantities* ip_cq){ - finalX_ = (double*)malloc(sizeof(double) * numVars_ * 1); + finalX_ = new double[n]; for (Index i=0; i