/* -*- C++ -*- * src/lemon/lp_cplex.cc * - Part of LEMON, a generic C++ optimization library * * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Combinatorial Optimization Research Group, EGRES). * * Permission to use, modify and distribute this software is granted * provided that this copyright notice appears in all copies. For * precise terms see the accompanying LICENSE file. * * This software is provided "AS IS" with no warranty of any kind, * express or implied, and with no claim as to its suitability for any * purpose. * */ #include"lp_cplex.h" ///\file ///\brief Implementation of the LEMON-CPLEX lp solver interface. namespace lemon { int LpCplex::_addCol() { int i = CPXgetnumcols (env, lp); int lb[1],ub[1]; lb[0]=-INF;//-CPX_INFBOUND; ub[0]=INF;//CPX_INFBOUND; status = CPXnewcols (env, lp, 1, NULL, lb, ub, NULL, NULL); return i; } int LpCplex::_addRow() { int i = CPXgetnumrows (env, lp); status = CPXnewrows (env, lp, 1, NULL, NULL, NULL, NULL, NULL); return i; } ///\warning Data at index 0 is ignored iin the arrays. void LpCplex::_setRowCoeffs(int i, int length, int const * indices, Value const * values ) { int rowlist[length+1]; for (int k=1;k<=length;++k){ rowlist[k]=i; } status = CPXchgcoeflist(env, lp, length, rowlist++, inices++, values++); } void LpCplex::_setColCoeffs(int i, int length, int const * indices, Value const * values) { int collist[length+1]; for (int k=1;k<=length;++k){ collist[k]=i; } status = CPXchgcoeflist(env, lp, length, inices++, collist++, values++); } void LpCplex::_setColLowerBound(int i, Value value) { } void LpCplex::_setColUpperBound(int i, Value value) { } void LpCplex::_setRowLowerBound(int i, Value value) { } void LpCplex::_setRowUpperBound(int i, Value value) { } void LpCplex::_setObjCoeff(int i, Value obj_coef) { } LpCplex::SolutionType LpCplex::_solve() { return OPTIMAL; } LpCplex::Value LpCplex::_getSolution(int i) { return 0; } } //namespace lemon