# HG changeset patch # User athos # Date 1159174268 0 # Node ID 4473c872599acb2bb885c6a1931c7ac2027cd0a7 # Parent c263168e09642dfadbf69adb2b1d34ef1d087578 Too many files added: sorry. diff -r c263168e0964 -r 4473c872599a lemon/mip_cplex.cc~ --- a/lemon/mip_cplex.cc~ Mon Sep 25 08:50:36 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -*- C++ -*- - * - * This file is a part of LEMON, a generic C++ optimization library - * - * Copyright (C) 2003-2006 - * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport - * (Egervary Research Group on Combinatorial Optimization, 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. - * - */ - -#ifndef LEMON_MIP_CPLEX_CC -#define LEMON_MIP_CPLEX_CC - -///\file -///\brief Implementation of the LEMON-CPLEX mip solver interface. - -#include - -namespace lemon { - - MipCplex::MipCplex() { - //This is unnecessary: setting integrality constraints on - //variables will set this, too - - ///\todo The constant CPXPROB_MIP is - ///called CPXPROB_MILP in later versions - CPXchgprobtype( env, lp, CPXPROB_MIP); - } - - void MipCplex::_colType(int i, MipCplex::ColTypes col_type){ - - // Note If a variable is to be changed to binary, a call to CPXchgbds - // should also be made to change the bounds to 0 and 1. - - int indices[1]; - indices[0]=i; - char ctype[1]; - switch (col_type){ - case INTEGER: - ctype[0]=CPX_INTEGER;//'I' - break; - case REAL: - ctype[0]=CPX_CONTINUOUS ;//'C' - break; - default:; - //FIXME problem - } - CPXchgctype (env, lp, 1, indices, ctype); - } - - MipCplex::ColTypes MipCplex::_colType(int i){ - - char ctype[1]; - status = CPXgetctype (env, lp, ctype, i, i); - std::cout<<"Kukucska: "< - -namespace lemon { - /// \brief Interface for the CPLEX MIP solver - /// - /// This class implements an interface for the CPLEX MIP solver. - ///\ingroup gen_opt_group - class MipCplex : public MipSolverBase, public LpCplex{ - - public: - - typedef MipSolverBase ParentMip; - typedef LpCplex ParentLp; - - MipCplex(); - //~MipCplex(); - - - - protected: - - virtual ColTypes _colType(int col); - virtual void _colType(int col, ColTypes col_type); - - virtual LpCplex::SolveExitStatus _solve(); - virtual LpCplex::SolutionStatus _getMipStatus(); - virtual ParentLp::Value _getPrimal(int i); - virtual ParentLp::Value _getPrimalValue(); - }; - -} //END OF NAMESPACE LEMON - -#endif // END OF LEMON_MIP_CPLEX_H