dReal4
|
Wrapper class for nlopt. More...
#include </home/soonhokong/work/dreal4/dreal/optimization/nlopt_optimizer.h>
Public Member Functions | |
NloptOptimizer (nlopt::algorithm algorithm, Box bound, const Config &config) | |
Constructs an NloptOptimizer instance given algorithm and the bound box . More... | |
NloptOptimizer (const NloptOptimizer &)=delete | |
Deleted copy-constructor. | |
NloptOptimizer (NloptOptimizer &&)=default | |
Deleted move-constructor. | |
NloptOptimizer & | operator= (const NloptOptimizer &)=delete |
Deleted copy-assignment operator. | |
NloptOptimizer & | operator= (NloptOptimizer &&)=delete |
Deleted move-assignment operator. | |
~NloptOptimizer ()=default | |
Destructor. | |
void | SetMinObjective (const Expression &objective) |
Specifies the objective function. | |
void | AddConstraint (const Formula &formula) |
Specifies a constraint. More... | |
void | AddRelationalConstraint (const Formula &formula) |
Specifies a relational constraint. More... | |
void | AddConstraints (const std::vector< Formula > &formulas) |
Specifies constraints. | |
nlopt::result | Optimize (std::vector< double > *x, double *opt_f) |
Runs optimization. More... | |
nlopt::result | Optimize (std::vector< double > *x, double *opt_f, const Environment &env) |
Runs optimization. More... | |
Wrapper class for nlopt.
NloptOptimizer | ( | nlopt::algorithm | algorithm, |
Box | bound, | ||
const Config & | config | ||
) |
Constructs an NloptOptimizer instance given algorithm
and the bound box
.
void AddConstraint | ( | const Formula & | formula | ) |
Specifies a constraint.
formula
should be one of the following kinds: 1) A relational formula (i.e. x >= y) 2) A negation of a relational formula (i.e. ¬(x > y)) 3) A conjunction of 1) or 2). std::runtime_error | if the above condition does not meet. |
void AddRelationalConstraint | ( | const Formula & | formula | ) |
Specifies a relational constraint.
formula
is a relational constraint. nlopt::result Optimize | ( | std::vector< double > * | x, |
double * | opt_f | ||
) |
Runs optimization.
Uses x
as an initial value for the optimization and updates it with a solution. opt_f
will be updated with the found optimal value.
nlopt::result Optimize | ( | std::vector< double > * | x, |
double * | opt_f, | ||
const Environment & | env | ||
) |
Runs optimization.
env
should be provided so that we can have full information to evaluate those functions.