MAiNGO
maingo Namespace Reference

namespace holding all essentials of MAiNGO More...

Namespaces

 bab
 namespace holding everything related to the actual branch-and-bound algorithm
 
 lbp
 namespace holding all essentials of the lower bounding solver
 
 ubp
 namespace holding all essentials of the upper bounding solvers
 

Classes

class  AleModel
 This class provides the interface for a program composed of ALE expressions. More...
 
struct  Constraint
 Struct for storing information about constraints. More...
 
struct  ConstraintContainer
 Containter for constraint evaluation. More...
 
struct  EvaluationContainer
 Struct for storing the values returned by model evaluation at the given point "var". More...
 
class  Logger
 This class contains all logging and output information. More...
 
class  MAiNGO
 This class is the MAiNGO solver holding the B&B tree, upper bounding solver, lower bounding solver and settings. More...
 
class  MaingoEvaluator
 Evaluates ALE expressions to Var. More...
 
class  MAiNGOException
 This class defines the exceptions thrown by MAiNGO. More...
 
class  MAiNGOmodel
 This class is the base class for models to be solved by MAiNGO. More...
 
class  MAiNGOmodelEpsCon
 This class is the base class for implementing bi-objective problems. More...
 
struct  modelFunction
 Struct for making work with the EvaluationContainer easier for the user and also to ensure backward compatibility. More...
 
struct  OutputVariable
 Struct for storing additional output variables. More...
 
struct  Program
 Container Class for ALE expressions comprising an optimization problem. More...
 
class  ProgramParser
 Parser specialization for parsing a maingo::Program. More...
 
struct  Settings
 Struct for storing settings for MAiNGO. More...
 
class  SymbolFinder
 Visitor for finding all symbols used in an expression. More...
 
class  VariableLister
 Serializes a given symbol and lists it into a vector. More...
 

Typedefs

using Var = mc::FFVar
 
using OptimizationVariable = babBase::OptimizationVariable
 
using Bounds = babBase::Bounds
 
using VT = babBase::enums::VT
 

Enumerations

enum  PROBLEM_STRUCTURE {
  LP = 0, MIP, QP, MIQP,
  NLP, DNLP, MINLP
}
 Enum for representing the problem structure. More...
 
enum  CONSTRAINT_TYPE {
  OBJ = 0, INEQ, EQ, INEQ_REL_ONLY,
  EQ_REL_ONLY, INEQ_SQUASH, AUX_EQ_REL_ONLY, OUTPUT,
  TYPE_UNKNOWN
}
 Enum for representing the constraint type. More...
 
enum  CONSTRAINT_CONVEXITY { CONV_NONE = 0, CONVEX, CONCAVE }
 Enum for representing the constraint convexity. More...
 
enum  CONSTRAINT_MONOTONICITY { MON_NONE = 0, INCR, DECR }
 Enum for representing the constraint monotonicity. More...
 
enum  CONSTRAINT_DEPENDENCY {
  DEP_UNKNOWN = 0, LINEAR, BILINEAR, QUADRATIC,
  POLYNOMIAL, RATIONAL, NONLINEAR
}
 Enum for representing the constraint dependency. Note that the dependency is increasing meaning that linear is a subset of bilinear which is a subset of quadratic etc. More...
 
enum  SETTING_NAMES {
  EPSILONA = 1, EPSILONR, DELTAINEQ, DELTAEQ,
  RELNODETOL, INFTY, TARGETLOWERBOUND, TARGETUPPERBOUND,
  BAB_MAXNODES, BAB_MAXITERATIONS, MAXTIME, CONFIRMTERMINATION,
  TERMINATEONFEASIBLEPOINT, PRE_MAXLOCALSEARCHES, PRE_OBBTMAXROUNDS, PRE_PUREMULTISTART,
  BAB_NODESELECTION, BAB_BRANCHVARIABLE, BAB_ALWAYSSOLVEOBBT, BAB_PROBING,
  BAB_DBBT, BAB_CONSTRAINTPROPAGATION, LBP_SOLVER, LBP_LINPOINTS,
  LBP_SUBGRADIENTINTERVALS, LBP_OBBTMINIMPROVEMENT, LBP_ACTIVATEMORESCALING, LBP_ADDAUXILIARYVARS,
  LBP_MINFACTORSFORAUX, LBP_MAXNUMBEROFADDEDFACTORS, MC_MVCOMPUSE, MC_MVCOMPTOL,
  MC_ENVELTOL, UBP_SOLVERPRE, UBP_MAXSTEPSPRE, UBP_MAXTIMEPRE,
  UBP_SOLVERBAB, UBP_MAXSTEPSBAB, UBP_MAXTIMEBAB, UBP_IGNORENODEBOUNDS,
  EC_NPOINTS, LBP_VERBOSITY, UBP_VERBOSITY, BAB_VERBOSITY,
  BAB_PRINTFREQ, BAB_LOGFREQ, OUTSTREAMVERBOSITY, WRITELOG,
  WRITECSV, WRITERESFILE, WRITETOLOGSEC, PRE_PRINTEVERYLOCALSEARCH,
  WRITETOOTHERLANGUAGE, UNKNOWN_SETTING = 500
}
 Enum for representing the setting names and making the tracking of set settings easier. More...
 
enum  RETCODE {
  GLOBALLY_OPTIMAL = 0, INFEASIBLE, FEASIBLE_POINT, NO_FEASIBLE_POINT_FOUND,
  BOUND_TARGETS, NOT_SOLVED_YET, JUST_A_WORKER_DONT_ASK_ME
}
 Enum for representing the return codes returned by MAiNGO after the solve() function was called. More...
 
enum  SUBSOLVER_RETCODE { SUBSOLVER_INFEASIBLE = 0, SUBSOLVER_FEASIBLE }
 Enum for representing the return codes returned by the different sub-solvers (UpperBoundingSolver, LowerBoundingSolver). More...
 
enum  TIGHTENING_RETCODE { TIGHTENING_INFEASIBLE = 0, TIGHTENING_UNCHANGED, TIGHTENING_CHANGED }
 Enum for representing the return codes returned by LowerBoundingSolvers when solving OBBT or constraint propagation. More...
 
enum  VERB { VERB_NONE = 0, VERB_NORMAL, VERB_ALL }
 Enum for controlling the output level of solvers (i.e., how much should be printed on the screen and, possibly, to the log file). More...
 
enum  OUTSTREAM_VERB { OUTSTREAM_NONE = 0, OUTSTREAM_OUTSTREAM, OUTSTREAM_LOG, OUTSTREAM_BOTH }
 Enum for controlling the output and writing level of MAiNGO (i.e., where should the output be written to, outstream and/or log) More...
 
enum  PARSING_LANGUAGE {
  LANG_NONE = -1, AMPL, ALE, BARON,
  GAMS, PYOMO, NLP_LANG
}
 Enum for representing possible modeling language for parsing a MAiNGO model to. More...
 

Functions

double get_cpu_time ()
 Function for querying CPU time of the process. More...
 
double get_wall_time ()
 Function for querying wall clock time of the process. More...
 
bool larger_or_equal_within_tolerance (const double LBD, const double UBD, Settings *mySettings)
 Function for checking if LBD is larger than UBD, or smaller by not more than the specified tolerance (absolute or relative) More...
 
std::string print_version ()
 Function printing the current version number. More...
 
template<unsigned IDim>
std::string var_indexes (size_t *indexes)
 Function for serializing index sequences. More...
 
template<>
std::string var_indexes< 1 > (size_t *indexes)
 Function for serializing index sequences. More...
 
template<unsigned IDim>
std::string var_name (std::string base, size_t *indexes)
 Function for flattening indexed symbol names. More...
 

Variables

constexpr VT VT_CONTINUOUS = babBase::enums::VT_CONTINUOUS
 
constexpr VT VT_BINARY = babBase::enums::VT_BINARY
 
constexpr VT VT_INTEGER = babBase::enums::VT_INTEGER
 

Detailed Description

namespace holding all essentials of MAiNGO

Typedef Documentation

◆ Bounds

Redefine for easier usage

◆ OptimizationVariable

Redefine for easier usage

◆ Var

using maingo::Var = typedef mc::FFVar

◆ VT

using maingo::VT = typedef babBase::enums::VT

Redefine for easier usage

Enumeration Type Documentation

◆ CONSTRAINT_CONVEXITY

Enum for representing the constraint convexity.

Enumerator
CONV_NONE 

the constraint has no specific convexity properties

CONVEX 

the constraint is convex

CONCAVE 

the constraint is concave

◆ CONSTRAINT_DEPENDENCY

Enum for representing the constraint dependency. Note that the dependency is increasing meaning that linear is a subset of bilinear which is a subset of quadratic etc.

Enumerator
DEP_UNKNOWN 

unknown dependency type

LINEAR 

linear

BILINEAR 

bilinear

QUADRATIC 

quadratic

POLYNOMIAL 

polynomial

RATIONAL 

rational

NONLINEAR 

nonlinear

◆ CONSTRAINT_MONOTONICITY

Enum for representing the constraint monotonicity.

Enumerator
MON_NONE 

the constraint has no specific monotonicity properties

INCR 

the constraint is monotonically increasing

DECR 

the constraint is monotonically decreasing

◆ CONSTRAINT_TYPE

Enum for representing the constraint type.

Enumerator
OBJ 

objective

INEQ 

inequality

EQ 

equality

INEQ_REL_ONLY 

relaxation only inequality

EQ_REL_ONLY 

relaxations only equality

INEQ_SQUASH 

squash inequality is meant to be used with the squash_node function. No tolerances are allowed for a squash inequality

AUX_EQ_REL_ONLY 

auxiliary relaxation only equality

OUTPUT 

output function

TYPE_UNKNOWN 

unknown function type

◆ OUTSTREAM_VERB

Enum for controlling the output and writing level of MAiNGO (i.e., where should the output be written to, outstream and/or log)

Enumerator
OUTSTREAM_NONE 

Print and write no output whatsoever.

OUTSTREAM_OUTSTREAM 

Print only to output stream (standard ist std::cout)

OUTSTREAM_LOG 

Write to log only

OUTSTREAM_BOTH 

Print to output stream AND write the same information to log

◆ PARSING_LANGUAGE

Enum for representing possible modeling language for parsing a MAiNGO model to.

Enumerator
LANG_NONE 

A different parsing language is not set.

AMPL 

AMPL.

ALE 

ALE.

BARON 

BARON.

GAMS 

GAMS.

PYOMO 

PYOMO.

NLP_LANG 

NLP.

◆ PROBLEM_STRUCTURE

Enum for representing the problem structure.

Enumerator
LP 

linear program

MIP 

mixed-integer linear program

QP 

quadratically constrained program

MIQP 

mixed-integer quadratically constrained program

NLP 

non-linear program

DNLP 

non-smooth non-linear program

MINLP 

mixed-integer non-linear program

◆ RETCODE

Enum for representing the return codes returned by MAiNGO after the solve() function was called.

Enumerator
GLOBALLY_OPTIMAL 

found solution is globally optimal

INFEASIBLE 

the given problem is infeasible

FEASIBLE_POINT 

the returned solution is feasible

NO_FEASIBLE_POINT_FOUND 

no feasible point was found

BOUND_TARGETS 

reached user-defined target for either lower or upper bound

NOT_SOLVED_YET 

problem has not been solved yet

JUST_A_WORKER_DONT_ASK_ME 

dummy status for workers in parallel version

◆ SETTING_NAMES

Enum for representing the setting names and making the tracking of set settings easier.

Enumerator
EPSILONA 

absolute optimality tolerance

EPSILONR 

relative optimality tolerance

DELTAINEQ 

absolute inequality tolerance

DELTAEQ 

absolute equality tolerance

RELNODETOL 

relative minimal node size tolerance

INFTY 

infinity value

TARGETLOWERBOUND 

target value for LBD at which MAiNGO terminates

TARGETUPPERBOUND 

target value for UBD at which MAiNGO terminates

BAB_MAXNODES 

max number of nodes

BAB_MAXITERATIONS 

max number of iterations

MAXTIME 

max time

CONFIRMTERMINATION 

whether to confirm termination

TERMINATEONFEASIBLEPOINT 

whether to terminate once a feasible point was found

PRE_MAXLOCALSEARCHES 

max local searches in pre-processing

PRE_OBBTMAXROUNDS 

max number of obbt rounds in pre-processing

PRE_PUREMULTISTART 

whether to do a pure multistart

BAB_NODESELECTION 

node selection heuristic

BAB_BRANCHVARIABLE 

branching variable heuristic

BAB_ALWAYSSOLVEOBBT 

whether to always solve obbt

BAB_PROBING 

whether to do probing

BAB_DBBT 

whether to do dbbt

BAB_CONSTRAINTPROPAGATION 

whether to do constraint propagation

LBP_SOLVER 

lower bounding solver

LBP_LINPOINTS 

linearization point strategy

LBP_SUBGRADIENTINTERVALS 

whether to use subgradient intervals heuristic

LBP_OBBTMINIMPROVEMENT 

minimal obbt improvement

LBP_ACTIVATEMORESCALING 

number of consecutive iterations with no lbd imrovement needed to activate more aggressive scaling in LP solver (e.g., CPLEX)

LBP_ADDAUXILIARYVARS 

whether to add auxiliary variables for common factors in the lower bounding problem

LBP_MINFACTORSFORAUX 

minimum number of common factors to add an auxiliary variable

LBP_MAXNUMBEROFADDEDFACTORS 

maximum number of added factor as auxiliaries

MC_MVCOMPUSE 

whether to use multivariate mccormick

MC_MVCOMPTOL 

mccormick computational tolerance

MC_ENVELTOL 

mccormick envelope computation tolerance

UBP_SOLVERPRE 

upper bounding solver in pre-processing

UBP_MAXSTEPSPRE 

max steps for upper bounding solver in pre-processing

UBP_MAXTIMEPRE 

max time for upper bounding solver in pre-processing

UBP_SOLVERBAB 

upper bounding solver in B&B

UBP_MAXSTEPSBAB 

max steps for upper bounding solver in B&B

UBP_MAXTIMEBAB 

max time for upper bounding solver in B&B

UBP_IGNORENODEBOUNDS 

whether to ignore bounds in upper bounding

EC_NPOINTS 

number of points on the Pareto front in epsilon-constraint method

LBP_VERBOSITY 

lower bounding verbosity

UBP_VERBOSITY 

upper bounding verbosity

BAB_VERBOSITY 

b&b verbosity

BAB_PRINTFREQ 

frequency of printed b&b iterations

BAB_LOGFREQ 

frequency of written b&b iterations

OUTSTREAMVERBOSITY 

verbosity for outstream

WRITELOG 

whether to write log

WRITECSV 

whether to write csv

WRITERESFILE 

whether to write an additional log file containing non-standard information about the problem

WRITETOLOGSEC 

write to log/csv every x seconds

PRE_PRINTEVERYLOCALSEARCH 

whether to print every local search

WRITETOOTHERLANGUAGE 

write a file in a different modeling language

UNKNOWN_SETTING 

unknown setting

◆ SUBSOLVER_RETCODE

Enum for representing the return codes returned by the different sub-solvers (UpperBoundingSolver, LowerBoundingSolver).

Enumerator
SUBSOLVER_INFEASIBLE 

no feasible point was found, or the problem was proven to be infeasible.

SUBSOLVER_FEASIBLE 

returned solution is feasible.

◆ TIGHTENING_RETCODE

Enum for representing the return codes returned by LowerBoundingSolvers when solving OBBT or constraint propagation.

Enumerator
TIGHTENING_INFEASIBLE 

the problem was found to be infeasible during bound tightening

TIGHTENING_UNCHANGED 

no progress was made in bound tightening

TIGHTENING_CHANGED 

the bounds were successfully tightened

◆ VERB

Enum for controlling the output level of solvers (i.e., how much should be printed on the screen and, possibly, to the log file).

Enumerator
VERB_NONE 

Print no output whatsoever.

VERB_NORMAL 

For BranchAndBound, this means that regular output on solution progress is printed according to the specified print frequency, as well as when the incumbent is updated. For LowerBoundingSolver and UpperBoundingSolver, only critical output is given (e.g., important warnings).

VERB_ALL 

Highest output level (very noisy!).

Function Documentation

◆ get_cpu_time()

double maingo::get_cpu_time ( )

Function for querying CPU time of the process.

◆ get_wall_time()

double maingo::get_wall_time ( )

Function for querying wall clock time of the process.

◆ larger_or_equal_within_tolerance()

bool maingo::larger_or_equal_within_tolerance ( const double  LBD,
const double  UBD,
Settings mySettings 
)
inline

Function for checking if LBD is larger than UBD, or smaller by not more than the specified tolerance (absolute or relative)

This function is declared here, since it is needed in bab.cpp, ubp.cpp, and in MAiNGO.cpp

Parameters
[in]LBDis the global lower bound
[in]UBDis the global upper bound
[in]mySettingsis a pointer to MAiNGO settings

◆ print_version()

std::string maingo::print_version ( )
inline

Function printing the current version number.

This function is declared here, since it is needed in MAiNGO.cpp, MAiNGOtoGAMS.cpp and lbp.cpp

Returns
Returns a string of the version number as vX.X.X

◆ var_indexes()

template<unsigned IDim>
std::string maingo::var_indexes ( size_t *  indexes)

Function for serializing index sequences.

Parameters
[in]indexesis the array of indexes to serialize

◆ var_indexes< 1 >()

template<>
std::string maingo::var_indexes< 1 > ( size_t *  indexes)
inline

Function for serializing index sequences.

Parameters
[in]indexesis the array of indexes to serialize

◆ var_name()

template<unsigned IDim>
std::string maingo::var_name ( std::string  base,
size_t *  indexes 
)

Function for flattening indexed symbol names.

Parameters
[in]baseis the base name of the symbol
[in]indexesis the array of indexes to flatten

Variable Documentation

◆ VT_BINARY

constexpr VT maingo::VT_BINARY = babBase::enums::VT_BINARY

Redefine for easier usage

◆ VT_CONTINUOUS

constexpr VT maingo::VT_CONTINUOUS = babBase::enums::VT_CONTINUOUS

Redefine for easier usage

◆ VT_INTEGER

constexpr VT maingo::VT_INTEGER = babBase::enums::VT_INTEGER

Redefine for easier usage