![]() |
Epigraph
Convex Optimization in C++
|
Public Member Functions | |
Scalar | addVariable (const std::string &name) |
Creates and returns a variable. More... | |
VectorX | addVariable (const std::string &name, size_t rows) |
Creates and returns a vector of variables. More... | |
MatrixX | addVariable (const std::string &name, size_t rows, size_t cols) |
Creates and returns a matrix of variables. More... | |
void | addConstraint (const Constraint &constraint) |
Add a single constraint to the problem. found. More... | |
void | addConstraint (const std::vector< Constraint > &constraints) |
Add multiple constraints to the problem. More... | |
void | addCostTerm (const Scalar &term) |
Add a cost term to the problem's cost function. This has to be a scalar. More... | |
void | getVariableValue (const std::string &name, double &var) |
Get the value of a scalar variable. More... | |
void | getVariableValue (const std::string &name, Eigen::VectorXd &var) |
Get the value of a vector variable. More... | |
void | getVariableValue (const std::string &name, Eigen::MatrixXd &var) |
Get the value of a matrix variable. More... | |
void | getVariable (const std::string &name, Scalar &var) |
Get a scalar variable that exists in the problem. More... | |
void | getVariable (const std::string &name, VectorX &var) |
Get a vector variable that exists in the problem. More... | |
void | getVariable (const std::string &name, MatrixX &var) |
Get a matrix variable that exists in the problem. More... | |
double | getOptimalValue () const |
Returns the evaluated cost function. Only call this after the problem has been solved. More... | |
size_t | getNumVariables () const |
Returns the number of used variables in the problem. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const OptimizationProblem &socp) |
void cvx::OptimizationProblem::addConstraint | ( | const Constraint & | constraint | ) |
Add a single constraint to the problem. found.
constraint | The constraint created by equalTo(), lessThan(), greaterThan() or box() |
void cvx::OptimizationProblem::addConstraint | ( | const std::vector< Constraint > & | constraints | ) |
Add multiple constraints to the problem.
constraint | The constraint created by equalTo(), lessThan(), greaterThan() or box() |
void cvx::OptimizationProblem::addCostTerm | ( | const Scalar & | term | ) |
Add a cost term to the problem's cost function. This has to be a scalar.
term | A scalar cost term |
Scalar cvx::OptimizationProblem::addVariable | ( | const std::string & | name | ) |
VectorX cvx::OptimizationProblem::addVariable | ( | const std::string & | name, |
size_t | rows | ||
) |
Creates and returns a vector of variables.
name | The name of the variable |
rows | The number of elements in the vector |
MatrixX cvx::OptimizationProblem::addVariable | ( | const std::string & | name, |
size_t | rows, | ||
size_t | cols | ||
) |
Creates and returns a matrix of variables.
name | The name of the variable |
rows | The number of rows of the matrix |
cols | The number of columns in the matrix |
size_t cvx::OptimizationProblem::getNumVariables | ( | ) | const |
Returns the number of used variables in the problem.
double cvx::OptimizationProblem::getOptimalValue | ( | ) | const |
Returns the evaluated cost function. Only call this after the problem has been solved.
void cvx::OptimizationProblem::getVariable | ( | const std::string & | name, |
MatrixX & | var | ||
) |
Get a matrix variable that exists in the problem.
name | The name of the variable |
var | The retured matrix variable |
void cvx::OptimizationProblem::getVariable | ( | const std::string & | name, |
Scalar & | var | ||
) |
Get a scalar variable that exists in the problem.
name | The name of the variable |
var | The retured scalar variable |
void cvx::OptimizationProblem::getVariable | ( | const std::string & | name, |
VectorX & | var | ||
) |
Get a vector variable that exists in the problem.
name | The name of the variable |
var | The retured vector variable |
void cvx::OptimizationProblem::getVariableValue | ( | const std::string & | name, |
double & | var | ||
) |
Get the value of a scalar variable.
name | The name of the variable |
var | The value stored in the variable |
void cvx::OptimizationProblem::getVariableValue | ( | const std::string & | name, |
Eigen::MatrixXd & | var | ||
) |
Get the value of a matrix variable.
name | The name of the variable |
var | The value stored in the variable |
void cvx::OptimizationProblem::getVariableValue | ( | const std::string & | name, |
Eigen::VectorXd & | var | ||
) |
Get the value of a vector variable.
name | The name of the variable |
var | The value stored in the variable |