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  * @file ubpKnitro.h
11  *
12  * @brief File containing declaration of UbpKnitro class used for solving the
13  * upper bounding problems.
14  *
15  **********************************************************************************/
16 
17 #pragma once
18 
19 #include "knitroProblem.h"
20 #include "ubp.h"
21 
22 
23 namespace maingo {
24 
25 
26 namespace ubp {
27 
28 
38 
39  public:
55  UbpKnitro(mc::FFGraph &DAG, const std::vector<mc::FFVar> &DAGvars, const std::vector<mc::FFVar> &DAGfunctions, const std::vector<babBase::OptimizationVariable> &variables,
56  const unsigned nineqIn, const unsigned neqIn, const unsigned nineqSquashIn, Settings *settingsIn, Logger *loggerIn, std::vector<Constraint> *constraintPropertiesIn, UBS_USE useIn);
57 
62 
63  private:
73  SUBSOLVER_RETCODE _solve_nlp(const std::vector<double> &lowerVarBounds, const std::vector<double> &upperVarBounds, double &objectiveValue, std::vector<double> &solutionPoint);
74 
76  knitro::KTRSolver _Knitro;
80  // Prevent use of default copy constructor and copy assignment operator by declaring them private:
81  UbpKnitro(const UbpKnitro &);
82  UbpKnitro &operator=(const UbpKnitro &);
83 };
84 
85 
86 } // end namespace ubp
87 
88 
89 } // end namespace maingo
Struct for storing settings for MAiNGO.
Definition: settings.h:143
This class contains all logging and output information.
Definition: logger.h:100
KnitroProblem * _theKnitroProblem
Definition: ubpKnitro.h:75
UbpKnitro & operator=(const UbpKnitro &)
Class for representing problems to be solved by Knitro, providing an interface to the problem definit...
Definition: knitroProblem.h:47
Wrapper for handling the upper bounding problems by interfacing Knitro.
Definition: ubpKnitro.h:37
Base class for wrappers for handling the upper bounding problems.
Definition: ubp.h:49
~UbpKnitro()
Destructor.
Definition: ubpKnitro.h:61
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
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 ...
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, Settings *settingsIn, Logger *loggerIn, std::vector< Constraint > *constraintPropertiesIn, UBS_USE useIn)
Constructor, stores information on the problem and initializes the local-subsolvers used.
knitro::KTRSolver _Knitro
Definition: ubpKnitro.h:76
int _solverStatus
Definition: ubpKnitro.h:78