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

Detailed Description

Definition at line 41 of file g_xpress.h.

#include <g_xpress.h>

Public Member Functions

 Xpress ()=delete
absl::Status SetProbName (absl::string_view 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 constant, absl::Span< const int > col_index, absl::Span< const double > obj_coeffs)
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 > rowind, absl::Span< const int > colind, absl::Span< const double > values)
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 (absl::string_view model_name)
 Creates a new Xpress.
static void XPRS_CC printXpressMessage (XPRSprob prob, void *data, const char *sMsg, int nLen, int nMsgLvl)

Constructor & Destructor Documentation

◆ Xpress()

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

◆ ~Xpress()

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

Definition at line 87 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 146 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 133 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 99 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_t support for number of vars (use XPRSaddcols64)

Definition at line 106 of file g_xpress.cc.

◆ ChgCoeffs()

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

Definition at line 196 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 282 of file g_xpress.cc.

◆ GetDoubleAttr()

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

Definition at line 253 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 272 of file g_xpress.cc.

◆ GetIntAttr()

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

Definition at line 246 of file g_xpress.cc.

◆ GetIntControl()

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

Definition at line 225 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 208 of file g_xpress.cc.

◆ GetNumberOfConstraints()

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

Definition at line 260 of file g_xpress.cc.

◆ GetNumberOfVariables()

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

Definition at line 266 of file g_xpress.cc.

◆ GetVarLb()

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

Definition at line 300 of file g_xpress.cc.

◆ GetVarUb()

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

Definition at line 309 of file g_xpress.cc.

◆ LpOptimize()

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

Definition at line 204 of file g_xpress.cc.

◆ MipOptimize()

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

Definition at line 219 of file g_xpress.cc.

◆ New()

absl::StatusOr< std::unique_ptr< Xpress > > operations_research::math_opt::Xpress::New ( absl::string_view 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 215 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 80 of file g_xpress.cc.

◆ ResetIntControl()

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

Definition at line 236 of file g_xpress.cc.

◆ SetIntControl()

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

Definition at line 232 of file g_xpress.cc.

◆ SetLinearObjective()

absl::Status operations_research::math_opt::Xpress::SetLinearObjective ( double constant,
absl::Span< const int > col_index,
absl::Span< const double > obj_coeffs )

Definition at line 175 of file g_xpress.cc.

◆ SetObjectiveSense()

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

Definition at line 170 of file g_xpress.cc.

◆ SetProbName()

absl::Status operations_research::math_opt::Xpress::SetProbName ( absl::string_view name)

Definition at line 71 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 188 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 290 of file g_xpress.cc.

◆ Terminate()

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

Definition at line 223 of file g_xpress.cc.


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