Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
cplex_interface.cc File Reference
#include <cstdint>
#include <limits>
#include <memory>
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h"
#include "ortools/base/logging.h"
#include "ortools/base/timer.h"
#include "ortools/linear_solver/linear_solver.h"
#include "ilcplex/cplexx.h"

Go to the source code of this file.

Classes

class  operations_research::CplexInterface
 

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 

Macros

#define CPX_NAN   std::numeric_limits<double>::quiet_NaN()
 
#define CHECK_STATUS(s)
 

Functions

CPXLIBAPI int CPXPUBLIC CPXEsetobjoffset (CPXCENVptr, CPXLPptr, double)
 Initial version of this code was written by Daniel Junglas (IBM)
 
MPSolverInterfaceoperations_research::BuildCplexInterface (bool mip, MPSolver *const solver)
 

Macro Definition Documentation

◆ CHECK_STATUS

#define CHECK_STATUS ( s)
Value:
do { \
int const status_ = s; \
CHECK_EQ(0, status_); \
} while (0)

The argument to this macro is the invocation of a CPXX function that returns a status. If the function returns non-zero the macro aborts the program with an appropriate error message.

Definition at line 44 of file cplex_interface.cc.

◆ CPX_NAN

#define CPX_NAN   std::numeric_limits<double>::quiet_NaN()

In case we need to return a double but don't have a value for that we just return a NaN.

Definition at line 38 of file cplex_interface.cc.

Function Documentation

◆ CPXEsetobjoffset()

CPXLIBAPI int CPXPUBLIC CPXEsetobjoffset ( CPXCENVptr ,
CPXLPptr ,
double  )

Initial version of this code was written by Daniel Junglas (IBM)

Copyright 2014 IBM Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. This is an undocumented function, setting the objective offset is not supported everywhere (for example it may not be exported if a model is written to a file), but it works in the cases we need here.