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  **********************************************************************************/
11 
12 #pragma once
13 
14 #include "ubp.h"
15 
16 #include "ClpFactorization.hpp"
17 #include "ClpNetworkMatrix.hpp"
18 #include "ClpSimplex.hpp"
19 
20 #include <list>
21 
22 
23 namespace maingo {
24 
25 
26 namespace ubp {
27 
28 
36 class UbpClp: public UpperBoundingSolver {
37 
38  public:
54  UbpClp(mc::FFGraph& DAG, const std::vector<mc::FFVar>& DAGvars, const std::vector<mc::FFVar>& DAGfunctions, const std::vector<babBase::OptimizationVariable>& variables,
55  const unsigned nineqIn, const unsigned neqIn, const unsigned nineqSquashIn, std::shared_ptr<Settings> settingsIn, std::shared_ptr<Logger> loggerIn, std::shared_ptr<std::vector<Constraint>> constraintPropertiesIn, UBS_USE useIn);
56 
57  private:
67  virtual SUBSOLVER_RETCODE _solve_nlp(const std::vector<double>& lowerVarBounds, const std::vector<double>& upperVarBounds, double& objectiveValue, std::vector<double>& solutionPoint);
68 
73  ClpSimplex _clp;
74  CoinPackedMatrix _matrix;
75  size_t _numrows;
77  std::vector<double> _objectiveCoeffs;
78  std::vector<double> _lowerRowBounds;
79  std::vector<double> _upperRowBounds;
80  std::vector<double> _lowerVarBounds;
81  std::vector<double> _upperVarBounds;
84  // Prevent use of default copy constructor and copy assignment operator by declaring them private:
85  UbpClp(const UbpClp&);
86  UbpClp& operator=(const UbpClp&);
87 };
88 
89 
90 } // end namespace ubp
91 
92 
93 } // end namespace maingo
Wrapper for handling the upper bounding problems by interfacing CLP.
Definition: ubpClp.h:36
double _objectiveConstant
Definition: ubpClp.h:76
std::vector< double > _upperVarBounds
Definition: ubpClp.h:81
std::vector< double > _lowerVarBounds
Definition: ubpClp.h:80
UbpClp & operator=(const UbpClp &)
std::vector< double > _lowerRowBounds
Definition: ubpClp.h:78
CoinPackedMatrix _matrix
Definition: ubpClp.h:74
Base class for wrappers for handling the upper bounding problems.
Definition: ubp.h:44
SUBSOLVER_RETCODE
Enum for representing the return codes returned by the different sub-solvers (UpperBoundingSolver, LowerBoundingSolver).
Definition: returnCodes.h:36
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
UBS_USE
Enum for communicating what the intended purpose of the solver is. This determines which settings are...
Definition: ubp.h:51
size_t _numrows
Definition: ubpClp.h:75
std::vector< double > _upperRowBounds
Definition: ubpClp.h:79
ClpSimplex _clp
Definition: ubpClp.h:73
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:50
std::vector< double > _objectiveCoeffs
Definition: ubpClp.h:77
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, std::shared_ptr< Settings > settingsIn, std::shared_ptr< Logger > loggerIn, std::shared_ptr< std::vector< Constraint >> constraintPropertiesIn, UBS_USE useIn)
Constructor, stores information on the problem and initializes the local-subsolvers used...
Definition: ubpClp.cpp:26