MAiNGO
ubpKnitro.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 "knitroProblem.h"
15 #include "ubp.h"
16 
17 
18 namespace maingo {
19 
20 
21 namespace ubp {
22 
23 
33 
34  public:
50  UbpKnitro(mc::FFGraph &DAG, const std::vector<mc::FFVar> &DAGvars, const std::vector<mc::FFVar> &DAGfunctions, const std::vector<babBase::OptimizationVariable> &variables,
51  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);
52 
57 
58  private:
68  SUBSOLVER_RETCODE _solve_nlp(const std::vector<double> &lowerVarBounds, const std::vector<double> &upperVarBounds, double &objectiveValue, std::vector<double> &solutionPoint);
69 
71  knitro::KTRSolver _Knitro;
75  // Prevent use of default copy constructor and copy assignment operator by declaring them private:
76  UbpKnitro(const UbpKnitro &);
77  UbpKnitro &operator=(const UbpKnitro &);
78 };
79 
80 
81 } // end namespace ubp
82 
83 
84 } // end namespace maingo
UbpKnitro(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...
KnitroProblem * _theKnitroProblem
Definition: ubpKnitro.h:70
UbpKnitro & operator=(const UbpKnitro &)
Class for representing problems to be solved by Knitro, providing an interface to the problem definit...
Definition: knitroProblem.h:43
Wrapper for handling the upper bounding problems by interfacing Knitro.
Definition: ubpKnitro.h:32
Base class for wrappers for handling the upper bounding problems.
Definition: ubp.h:44
~UbpKnitro()
Destructor.
Definition: ubpKnitro.h:56
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
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 sub-problem. This needs to be re-defined in derived classes to ...
knitro::KTRSolver _Knitro
Definition: ubpKnitro.h:71
int _solverStatus
Definition: ubpKnitro.h:73