MAiNGO
ubpClp.h
Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  * @file ubpClp.h
11  *
12  * @brief File containing declaration of UbpClp class used for solving the upper
13  * bounding problems (or, rather, the entire problem) in the case when the
14  * original problem is an LP.
15  *
16  **********************************************************************************/
17 
18 #pragma once
19 
20 #include "ubp.h"
21 
22 #include "ClpFactorization.hpp"
23 #include "ClpNetworkMatrix.hpp"
24 #include "ClpSimplex.hpp"
25 
26 #include <list>
27 
28 
29 namespace maingo {
30 
31 
32 namespace ubp {
33 
34 
42 class UbpClp: public UpperBoundingSolver {
43 
44  public:
60  UbpClp(mc::FFGraph& DAG, const std::vector<mc::FFVar>& DAGvars, const std::vector<mc::FFVar>& DAGfunctions, const std::vector<babBase::OptimizationVariable>& variables,
61  const unsigned nineqIn, const unsigned neqIn, const unsigned nineqSquashIn, Settings* settingsIn, Logger* loggerIn, std::vector<Constraint>* constraintPropertiesIn, UBS_USE useIn);
62 
63  private:
73  virtual SUBSOLVER_RETCODE _solve_nlp(const std::vector<double>& lowerVarBounds, const std::vector<double>& upperVarBounds, double& objectiveValue, std::vector<double>& solutionPoint);
74 
79  ClpSimplex _clp;
80  CoinPackedMatrix _matrix;
81  size_t _numrows;
83  std::vector<double> _objectiveCoeffs;
84  std::vector<double> _lowerRowBounds;
85  std::vector<double> _upperRowBounds;
86  std::vector<double> _lowerVarBounds;
87  std::vector<double> _upperVarBounds;
90  // Prevent use of default copy constructor and copy assignment operator by declaring them private:
91  UbpClp(const UbpClp&);
92  UbpClp& operator=(const UbpClp&);
93 };
94 
95 
96 } // end namespace ubp
97 
98 
99 } // end namespace maingo
Wrapper for handling the upper bounding problems by interfacing CLP.
Definition: ubpClp.h:42
double _objectiveConstant
Definition: ubpClp.h:82
std::vector< double > _upperVarBounds
Definition: ubpClp.h:87
Struct for storing settings for MAiNGO.
Definition: settings.h:143
std::vector< double > _lowerVarBounds
Definition: ubpClp.h:86
UbpClp & operator=(const UbpClp &)
This class contains all logging and output information.
Definition: logger.h:100
std::vector< double > _lowerRowBounds
Definition: ubpClp.h:84
UbpClp(mc::FFGraph &DAG, const std::vector< mc::FFVar > &DAGvars, const std::vector< mc::FFVar > &DAGfunctions, const std::vector< babBase::OptimizationVariable > &variables, const unsigned nineqIn, const unsigned neqIn, const unsigned nineqSquashIn, Settings *settingsIn, Logger *loggerIn, std::vector< Constraint > *constraintPropertiesIn, UBS_USE useIn)
Constructor, stores information on the problem and initializes the local-subsolvers used.
Definition: ubpClp.cpp:32
CoinPackedMatrix _matrix
Definition: ubpClp.h:80
Base class for wrappers for handling the upper bounding problems.
Definition: ubp.h:49
SUBSOLVER_RETCODE
Enum for representing the return codes returned by the different sub-solvers (UpperBoundingSolver,...
Definition: returnCodes.h:40
namespace holding all essentials of MAiNGO
Definition: aleModel.h:31
UBS_USE
Enum for communicating what the intended purpose of the solver is. This determines which settings are...
Definition: ubp.h:56
size_t _numrows
Definition: ubpClp.h:81
std::vector< double > _upperRowBounds
Definition: ubpClp.h:85
ClpSimplex _clp
Definition: ubpClp.h:79
virtual SUBSOLVER_RETCODE _solve_nlp(const std::vector< double > &lowerVarBounds, const std::vector< double > &upperVarBounds, double &objectiveValue, std::vector< double > &solutionPoint)
Function for actually solving the NLP (actually, LP in this case) sub-problem.
Definition: ubpClp.cpp:53
std::vector< double > _objectiveCoeffs
Definition: ubpClp.h:83