20 #define HUMOTO_CONFIG_SECTION_ID "SolverParameters" 21 #define HUMOTO_CONFIG_CONSTRUCTOR SolverParameters 22 #define HUMOTO_CONFIG_ENTRIES \ 23 HUMOTO_CONFIG_PARENT_CLASS(SolverParametersBase) \ 24 HUMOTO_CONFIG_SCALAR_(regularization_factor) \ 25 HUMOTO_CONFIG_MEMBER_CLASS(options_, "QPmadParameters") 26 #include HUMOTO_CONFIG_DEFINE_ACCESSORS 33 #define HUMOTO_CONFIG_SECTION_ID "QPmadParameters" 34 #define HUMOTO_CONFIG_CONSTRUCTOR QPmadParameters 35 #define HUMOTO_CONFIG_ENTRIES \ 36 HUMOTO_CONFIG_ENUM_(hessian_type)\ 37 HUMOTO_CONFIG_SCALAR_(tolerance)\ 38 HUMOTO_CONFIG_SCALAR_(max_iter) 39 #include HUMOTO_CONFIG_DEFINE_ACCESSORS 62 regularization_factor_ = 0;
92 hierarchy.
getQPProblem(qp_problem_, sol_structure,
false);
102 "Regularization factor must be nonnegative.");
104 if (parameters_.regularization_factor_ > 0)
106 qp_problem_.
regularize(parameters_.regularization_factor_);
109 ::qpmad::Solver::ReturnStatus qp_status =
122 case ::qpmad::Solver::OK:
125 case ::qpmad::Solver::MAXIMAL_NUMBER_OF_ITERATIONS:
171 setParameters(parameters);
184 const std::string &name =
"qpmad")
const 187 qp_problem_.
log(logger, subname);
humoto::QPProblem_ILU_ALU qp_problem_
const humoto::constraints::ContainerALU & getGeneralConstraints() const
get container with general constraints
void solveHierarchy(humoto::Solution &solution, const humoto::OptimizationProblem &hierarchy)
Solve the hierarchy.
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
#define HUMOTO_ASSERT(condition, message)
void setDefaults()
Set members to their default values.
Default configurable base is strict.
Analog of 'sol_structure' struct in Octave code. [determine_solution_structure.m].
Container of the solution.
Represents log entry name.
Solver(const SolverParameters ¶meters)
Set parameters.
const Eigen::VectorXd & getSolutionLowerBounds() const
Get LB vector: 'LB <= X'.
const Eigen::VectorXd & getGradient() const
Const accessor.
SolverStatus::Status return_status_
Eigen::VectorXd & getUpperBounds()
Get upper bounds (ub vectors from 'A*x <= ub').
Eigen::MatrixXd & getA()
Get matrix A from general constraints: 'A*x = b', 'lb <= A*x <= ub'.
An optimization problem [initialize_stack.m, simulation_loop.m].
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
const Eigen::VectorXd & getSolutionUpperBounds() const
Get UB vector: 'X <= UB'.
A QP problem with constraints of a specific type.
void initialize(const humoto::OptimizationProblem &hierarchy, const humoto::SolutionStructure &sol_structure)
Initialize solver.
The root namespace of HuMoTo.
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="qpmad") const
Log a QP problem.
Parameters of the solver.
Mixin solver interface (QP solver)
Solver()
Default constructor (with default parameters)
void regularize(const double regularization_factor)
Adds regularization to the Hessian.
double regularization_factor_
Regularization factor (disabled if = 0)
LogEntryName & add(const char *name)
extends entry name with a subname
SolverParameters()
Default constructor.
void solve(humoto::Solution &solution, const humoto::OptimizationProblem &hierarchy)
Solve an optimization problem (using previously specified parameters)
Eigen::VectorXd & getLowerBounds()
Get lower bounds (lb/ub vectors from 'lb <= A*x <= ub').
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="qp_problem") const
Log a QP problem.
void setDefaults()
Set members to their default values.
const Eigen::MatrixXd & getHessian() const
Const accessor.
void getQPProblem(QPProblemBase< t_QPConstraints > &qp_problem, const humoto::SolutionStructure &sol_structure, const bool initialize_upper_triangular_part=true) const
Form a QP problem.
::qpmad::Solver::ReturnStatus qpmad_return_value_
The return value of qpmad.