Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::Xpress Class Reference

#include <g_xpress.h>

Public Member Functions

 Xpress ()=delete
 
absl::Status SetProbName (const std::string &name)
 
 ~Xpress ()
 
absl::StatusOr< int > GetIntControl (int control) const
 
absl::Status SetIntControl (int control, int value)
 
absl::Status ResetIntControl (int control)
 
absl::StatusOr< int > GetIntAttr (int attribute) const
 
absl::StatusOr< double > GetDoubleAttr (int attribute) const
 
absl::Status AddVars (absl::Span< const double > obj, absl::Span< const double > lb, absl::Span< const double > ub, absl::Span< const char > vtype)
 
absl::Status AddVars (absl::Span< const int > vbegin, absl::Span< const int > vind, absl::Span< const double > vval, absl::Span< const double > obj, absl::Span< const double > lb, absl::Span< const double > ub, absl::Span< const char > vtype)
 
absl::Status AddConstrs (absl::Span< const char > sense, absl::Span< const double > rhs, absl::Span< const double > rng)
 
absl::Status AddConstrs (absl::Span< const char > rowtype, absl::Span< const double > rhs, absl::Span< const double > rng, absl::Span< const int > start, absl::Span< const int > colind, absl::Span< const double > rowcoef)
 
absl::Status SetObjectiveSense (bool maximize)
 
absl::Status SetLinearObjective (double offset, absl::Span< const int > colind, absl::Span< const double > values)
 
absl::Status SetQuadraticObjective (absl::Span< const int > colind1, absl::Span< const int > colind2, absl::Span< const double > coefficients)
 
absl::Status ChgCoeffs (absl::Span< const int > cind, absl::Span< const int > vind, absl::Span< const double > val)
 
absl::Status LpOptimize (std::string flags)
 
absl::Status GetLpSol (absl::Span< double > primals, absl::Span< double > duals, absl::Span< double > reducedCosts)
 
absl::Status MipOptimize ()
 
absl::Status PostSolve ()
 
void Terminate ()
 
absl::StatusOr< int > GetDualStatus () const
 
absl::Status GetBasis (std::vector< int > &rowBasis, std::vector< int > &colBasis) const
 
absl::Status SetStartingBasis (std::vector< int > &rowBasis, std::vector< int > &colBasis) const
 
int GetNumberOfConstraints () const
 
int GetNumberOfVariables () const
 
absl::StatusOr< std::vector< double > > GetVarLb () const
 
absl::StatusOr< std::vector< double > > GetVarUb () const
 

Static Public Member Functions

static absl::StatusOr< std::unique_ptr< Xpress > > New (const std::string &model_name)
 Creates a new Xpress.
 
static void XPRS_CC printXpressMessage (XPRSprob prob, void *data, const char *sMsg, int nLen, int nMsgLvl)
 

Detailed Description

Definition at line 42 of file g_xpress.h.

Constructor & Destructor Documentation

◆ Xpress()

operations_research::math_opt::Xpress::Xpress ( )
delete

◆ ~Xpress()

operations_research::math_opt::Xpress::~Xpress ( )

Definition at line 89 of file g_xpress.cc.

Member Function Documentation

◆ AddConstrs() [1/2]

absl::Status operations_research::math_opt::Xpress::AddConstrs ( absl::Span< const char > rowtype,
absl::Span< const double > rhs,
absl::Span< const double > rng,
absl::Span< const int > start,
absl::Span< const int > colind,
absl::Span< const double > rowcoef )

Definition at line 147 of file g_xpress.cc.

◆ AddConstrs() [2/2]

absl::Status operations_research::math_opt::Xpress::AddConstrs ( absl::Span< const char > sense,
absl::Span< const double > rhs,
absl::Span< const double > rng )

Definition at line 135 of file g_xpress.cc.

◆ AddVars() [1/2]

absl::Status operations_research::math_opt::Xpress::AddVars ( absl::Span< const double > obj,
absl::Span< const double > lb,
absl::Span< const double > ub,
absl::Span< const char > vtype )

Definition at line 101 of file g_xpress.cc.

◆ AddVars() [2/2]

absl::Status operations_research::math_opt::Xpress::AddVars ( absl::Span< const int > vbegin,
absl::Span< const int > vind,
absl::Span< const double > vval,
absl::Span< const double > obj,
absl::Span< const double > lb,
absl::Span< const double > ub,
absl::Span< const char > vtype )
Todo
: look into int64 support for number of vars (use XPRSaddcols64)

Definition at line 108 of file g_xpress.cc.

◆ ChgCoeffs()

absl::Status operations_research::math_opt::Xpress::ChgCoeffs ( absl::Span< const int > cind,
absl::Span< const int > vind,
absl::Span< const double > val )

Definition at line 197 of file g_xpress.cc.

◆ GetBasis()

absl::Status operations_research::math_opt::Xpress::GetBasis ( std::vector< int > & rowBasis,
std::vector< int > & colBasis ) const

Definition at line 283 of file g_xpress.cc.

◆ GetDoubleAttr()

absl::StatusOr< double > operations_research::math_opt::Xpress::GetDoubleAttr ( int attribute) const

Definition at line 254 of file g_xpress.cc.

◆ GetDualStatus()

absl::StatusOr< int > operations_research::math_opt::Xpress::GetDualStatus ( ) const

Even though we do not need the values, we have to fetch them, otherwise we'd get a segmentation fault

Definition at line 273 of file g_xpress.cc.

◆ GetIntAttr()

absl::StatusOr< int > operations_research::math_opt::Xpress::GetIntAttr ( int attribute) const

Definition at line 247 of file g_xpress.cc.

◆ GetIntControl()

absl::StatusOr< int > operations_research::math_opt::Xpress::GetIntControl ( int control) const

Definition at line 226 of file g_xpress.cc.

◆ GetLpSol()

absl::Status operations_research::math_opt::Xpress::GetLpSol ( absl::Span< double > primals,
absl::Span< double > duals,
absl::Span< double > reducedCosts )

Fetch LP solution (primals, duals, and reduced costs) The user is responsible for ensuring that the three vectors are of correct size (nVars, nCons, and nVars respectively)

Definition at line 209 of file g_xpress.cc.

◆ GetNumberOfConstraints()

int operations_research::math_opt::Xpress::GetNumberOfConstraints ( ) const

Definition at line 261 of file g_xpress.cc.

◆ GetNumberOfVariables()

int operations_research::math_opt::Xpress::GetNumberOfVariables ( ) const

Definition at line 267 of file g_xpress.cc.

◆ GetVarLb()

absl::StatusOr< std::vector< double > > operations_research::math_opt::Xpress::GetVarLb ( ) const

Definition at line 301 of file g_xpress.cc.

◆ GetVarUb()

absl::StatusOr< std::vector< double > > operations_research::math_opt::Xpress::GetVarUb ( ) const

Definition at line 310 of file g_xpress.cc.

◆ LpOptimize()

absl::Status operations_research::math_opt::Xpress::LpOptimize ( std::string flags)

Definition at line 205 of file g_xpress.cc.

◆ MipOptimize()

absl::Status operations_research::math_opt::Xpress::MipOptimize ( )

Definition at line 220 of file g_xpress.cc.

◆ New()

absl::StatusOr< std::unique_ptr< Xpress > > operations_research::math_opt::Xpress::New ( const std::string & model_name)
static

Creates a new Xpress.

Definition at line 62 of file g_xpress.cc.

◆ PostSolve()

absl::Status operations_research::math_opt::Xpress::PostSolve ( )

Definition at line 216 of file g_xpress.cc.

◆ printXpressMessage()

void XPRS_CC operations_research::math_opt::Xpress::printXpressMessage ( XPRSprob prob,
void * data,
const char * sMsg,
int nLen,
int nMsgLvl )
static

Definition at line 81 of file g_xpress.cc.

◆ ResetIntControl()

absl::Status operations_research::math_opt::Xpress::ResetIntControl ( int control)

Definition at line 237 of file g_xpress.cc.

◆ SetIntControl()

absl::Status operations_research::math_opt::Xpress::SetIntControl ( int control,
int value )

Definition at line 233 of file g_xpress.cc.

◆ SetLinearObjective()

absl::Status operations_research::math_opt::Xpress::SetLinearObjective ( double offset,
absl::Span< const int > colind,
absl::Span< const double > values )

Definition at line 176 of file g_xpress.cc.

◆ SetObjectiveSense()

absl::Status operations_research::math_opt::Xpress::SetObjectiveSense ( bool maximize)

Definition at line 171 of file g_xpress.cc.

◆ SetProbName()

absl::Status operations_research::math_opt::Xpress::SetProbName ( const std::string & name)

Definition at line 72 of file g_xpress.cc.

◆ SetQuadraticObjective()

absl::Status operations_research::math_opt::Xpress::SetQuadraticObjective ( absl::Span< const int > colind1,
absl::Span< const int > colind2,
absl::Span< const double > coefficients )

Definition at line 189 of file g_xpress.cc.

◆ SetStartingBasis()

absl::Status operations_research::math_opt::Xpress::SetStartingBasis ( std::vector< int > & rowBasis,
std::vector< int > & colBasis ) const

Definition at line 291 of file g_xpress.cc.

◆ Terminate()

void operations_research::math_opt::Xpress::Terminate ( )

Definition at line 224 of file g_xpress.cc.


The documentation for this class was generated from the following files: