Data class for storing generic conic programs. More...
#include <dense_cp.hpp>
Public Member Functions | |
DenseCP () | |
DenseCP (const DenseCP &rhs) | |
DVector | getMergedDualSolution () const |
uint | getNC () const |
uint | getNV () const |
returnValue | init (uint nV_, uint nC_) |
BooleanType | isLP () const |
BooleanType | isQP () const |
BooleanType | isSDP () const |
DenseCP & | operator= (const DenseCP &rhs) |
returnValue | print (const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const |
returnValue | print (const char *const name, PrintScheme printScheme) const |
returnValue | printSolution (const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const |
returnValue | printSolution (const char *const name, PrintScheme printScheme) const |
returnValue | printSolutionToFile (const char *const filename, const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const |
returnValue | printSolutionToFile (std::ostream &stream, const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const |
returnValue | printSolutionToFile (const char *const filename, const char *const name, PrintScheme printScheme) const |
returnValue | printSolutionToFile (std::ostream &stream, const char *const name, PrintScheme printScheme) const |
returnValue | printToFile (const char *const filename, const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const |
returnValue | printToFile (std::ostream &stream, const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const |
returnValue | printToFile (const char *const filename, const char *const name, PrintScheme printScheme) const |
returnValue | printToFile (std::ostream &stream, const char *const name, PrintScheme printScheme) const |
returnValue | setQPsolution (const DVector &x_, const DVector &y_) |
virtual | ~DenseCP () |
Public Attributes | |
DMatrix | A |
DMatrix ** | B |
DVector | g |
DMatrix | H |
DVector | lb |
DVector | lbA |
DVector * | lbB |
uint | nS |
DVector | ub |
DVector | ubA |
DVector * | ubB |
DVector * | x |
DVector * | ylb |
DVector * | ylbA |
DVector ** | ylbB |
DVector * | yub |
DVector * | yubA |
DVector ** | yubB |
Protected Member Functions | |
void | clean () |
void | copy (const DenseCP &rhs) |
Data class for storing generic conic programs.
The class DenseCP (dense conic program) is a data class to store generic conic programs in a convenient format.
Definition at line 55 of file dense_cp.hpp.
BEGIN_NAMESPACE_ACADO DenseCP::DenseCP | ( | ) |
Default constructor.
Definition at line 44 of file dense_cp.cpp.
DenseCP::DenseCP | ( | const DenseCP & | rhs | ) |
Copy constructor (deep copy).
Definition at line 64 of file dense_cp.cpp.
|
virtual |
Destructor.
Definition at line 70 of file dense_cp.cpp.
|
protected |
Definition at line 167 of file dense_cp.cpp.
|
protected |
Definition at line 88 of file dense_cp.cpp.
DVector DenseCP::getMergedDualSolution | ( | ) | const |
Sets the primal and dual solution converting the dual solution
into the internal format (this routine expects a vector y of
dimension nV + nC, where nC is number of linear constraints and
nV the number of variables (= number of bounds) ).
Definition at line 257 of file dense_cp.cpp.
|
inline |
Returns the number of linear constraints
|
inline |
Returns the number of variables
returnValue DenseCP::init | ( | uint | nV_, |
uint | nC_ | ||
) |
Constructs an empty QP with dimensions nV and nC
Definition at line 195 of file dense_cp.cpp.
|
inline |
Returns whether or not the conic program is an LP
|
inline |
Returns whether or not the conic program is an LP
|
inline |
Returns whether or not the conic program is an SDP
Assignment operator (deep copy).
Definition at line 76 of file dense_cp.cpp.
returnValue DenseCP::print | ( | const char *const | name = DEFAULT_LABEL , |
const char *const | startString = DEFAULT_START_STRING , |
||
const char *const | endString = DEFAULT_END_STRING , |
||
uint | width = DEFAULT_WIDTH , |
||
uint | precision = DEFAULT_PRECISION , |
||
const char *const | colSeparator = DEFAULT_COL_SEPARATOR , |
||
const char *const | rowSeparator = DEFAULT_ROW_SEPARATOR |
||
) | const |
Prints CP to standard ouput stream. Various settings can be specified defining its output format.
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
Definition at line 283 of file dense_cp.cpp.
returnValue DenseCP::print | ( | const char *const | name, |
PrintScheme | printScheme | ||
) | const |
Prints CP to standard ouput stream. Various settings can be specified defining its output format.
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
Definition at line 304 of file dense_cp.cpp.
returnValue DenseCP::printSolution | ( | const char *const | name = DEFAULT_LABEL , |
const char *const | startString = DEFAULT_START_STRING , |
||
const char *const | endString = DEFAULT_END_STRING , |
||
uint | width = DEFAULT_WIDTH , |
||
uint | precision = DEFAULT_PRECISION , |
||
const char *const | colSeparator = DEFAULT_COL_SEPARATOR , |
||
const char *const | rowSeparator = DEFAULT_ROW_SEPARATOR |
||
) | const |
Prints CP solution to standard ouput stream. Various settings can be specified defining its output format.
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
Definition at line 399 of file dense_cp.cpp.
returnValue DenseCP::printSolution | ( | const char *const | name, |
PrintScheme | printScheme | ||
) | const |
Prints CP solution to standard ouput stream. Various settings can be specified defining its output format.
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
Definition at line 427 of file dense_cp.cpp.
returnValue DenseCP::printSolutionToFile | ( | const char *const | filename, |
const char *const | name = DEFAULT_LABEL , |
||
const char *const | startString = DEFAULT_START_STRING , |
||
const char *const | endString = DEFAULT_END_STRING , |
||
uint | width = DEFAULT_WIDTH , |
||
uint | precision = DEFAULT_PRECISION , |
||
const char *const | colSeparator = DEFAULT_COL_SEPARATOR , |
||
const char *const | rowSeparator = DEFAULT_ROW_SEPARATOR |
||
) | const |
Prints CP solution to file with given name. Various settings can be specified defining its output format.
[in] | filename | Filename for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
Definition at line 450 of file dense_cp.cpp.
returnValue DenseCP::printSolutionToFile | ( | std::ostream & | stream, |
const char *const | name = DEFAULT_LABEL , |
||
const char *const | startString = DEFAULT_START_STRING , |
||
const char *const | endString = DEFAULT_END_STRING , |
||
uint | width = DEFAULT_WIDTH , |
||
uint | precision = DEFAULT_PRECISION , |
||
const char *const | colSeparator = DEFAULT_COL_SEPARATOR , |
||
const char *const | rowSeparator = DEFAULT_ROW_SEPARATOR |
||
) | const |
Prints CP solution to given file. Various settings can be specified defining its output format.
[in] | stream | File for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
Definition at line 479 of file dense_cp.cpp.
returnValue DenseCP::printSolutionToFile | ( | const char *const | filename, |
const char *const | name, | ||
PrintScheme | printScheme | ||
) | const |
Prints CP solution to file with given name. Various settings can be specified defining its output format.
[in] | filename | Filename for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
Definition at line 508 of file dense_cp.cpp.
returnValue DenseCP::printSolutionToFile | ( | std::ostream & | stream, |
const char *const | name, | ||
PrintScheme | printScheme | ||
) | const |
Prints CP solution to given file. Various settings can be specified defining its output format.
[in] | stream | File for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
Definition at line 532 of file dense_cp.cpp.
returnValue DenseCP::printToFile | ( | const char *const | filename, |
const char *const | name = DEFAULT_LABEL , |
||
const char *const | startString = DEFAULT_START_STRING , |
||
const char *const | endString = DEFAULT_END_STRING , |
||
uint | width = DEFAULT_WIDTH , |
||
uint | precision = DEFAULT_PRECISION , |
||
const char *const | colSeparator = DEFAULT_COL_SEPARATOR , |
||
const char *const | rowSeparator = DEFAULT_ROW_SEPARATOR |
||
) | const |
Prints CP to file with given name. Various settings can be specified defining its output format.
[in] | filename | Filename for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
Definition at line 320 of file dense_cp.cpp.
returnValue DenseCP::printToFile | ( | std::ostream & | stream, |
const char *const | name = DEFAULT_LABEL , |
||
const char *const | startString = DEFAULT_START_STRING , |
||
const char *const | endString = DEFAULT_END_STRING , |
||
uint | width = DEFAULT_WIDTH , |
||
uint | precision = DEFAULT_PRECISION , |
||
const char *const | colSeparator = DEFAULT_COL_SEPARATOR , |
||
const char *const | rowSeparator = DEFAULT_ROW_SEPARATOR |
||
) | const |
Prints CP to given file. Various settings can be specified defining its output format.
[in] | stream | File for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | startString | Prefix before printing the numerical values. |
[in] | endString | Suffix after printing the numerical values. |
[in] | width | Total number of digits per single numerical value. |
[in] | precision | Number of decimals per single numerical value. |
[in] | colSeparator | Separator between the columns of the numerical values. |
[in] | rowSeparator | Separator between the rows of the numerical values. |
Definition at line 342 of file dense_cp.cpp.
returnValue DenseCP::printToFile | ( | const char *const | filename, |
const char *const | name, | ||
PrintScheme | printScheme | ||
) | const |
Prints CP to file with given name. Various settings can be specified defining its output format.
[in] | filename | Filename for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
Definition at line 364 of file dense_cp.cpp.
returnValue DenseCP::printToFile | ( | std::ostream & | stream, |
const char *const | name, | ||
PrintScheme | printScheme | ||
) | const |
Prints CP to given file. Various settings can be specified defining its output format.
[in] | stream | File for printing. |
[in] | name | Name label to be printed before the numerical values. |
[in] | printScheme | Print scheme defining the output format of the information. |
Definition at line 381 of file dense_cp.cpp.
returnValue DenseCP::setQPsolution | ( | const DVector & | x_, |
const DVector & | y_ | ||
) |
Sets the primal and dual solution converting the dual solution
into the internal format (this routine expects a vector y of
dimension nV + nC, where nC is number of linear constraints and
nV the number of variables (= number of bounds) ).
Definition at line 204 of file dense_cp.cpp.
DMatrix DenseCP::A |
Constraint matrix
Definition at line 387 of file dense_cp.hpp.
DMatrix** DenseCP::B |
SDP constraint tensor
Definition at line 391 of file dense_cp.hpp.
DVector DenseCP::g |
The objective gradient
Definition at line 382 of file dense_cp.hpp.
DMatrix DenseCP::H |
The Hessian matrix
Definition at line 381 of file dense_cp.hpp.
DVector DenseCP::lb |
Simple lower bounds
Definition at line 384 of file dense_cp.hpp.
DVector DenseCP::lbA |
Constraint lower bounds
Definition at line 388 of file dense_cp.hpp.
DVector* DenseCP::lbB |
SDP lower bounds
Definition at line 392 of file dense_cp.hpp.
uint DenseCP::nS |
Number of SDP constraints
Definition at line 375 of file dense_cp.hpp.
DVector DenseCP::ub |
Simple upper bounds
Definition at line 385 of file dense_cp.hpp.
DVector DenseCP::ubA |
Constraint upper bounds
Definition at line 389 of file dense_cp.hpp.
DVector* DenseCP::ubB |
SDP upper bounds
Definition at line 393 of file dense_cp.hpp.
DVector* DenseCP::x |
Primal Solution
Definition at line 398 of file dense_cp.hpp.
DVector* DenseCP::ylb |
Dual solution, lower bound
Definition at line 400 of file dense_cp.hpp.
DVector* DenseCP::ylbA |
Dual solution, LP lower bound
Definition at line 403 of file dense_cp.hpp.
DVector** DenseCP::ylbB |
Dual solution, SDB lower bound
Definition at line 406 of file dense_cp.hpp.
DVector* DenseCP::yub |
Dual solution, upper bound
Definition at line 401 of file dense_cp.hpp.
DVector* DenseCP::yubA |
Dual solution, LP upper bound
Definition at line 404 of file dense_cp.hpp.
DVector** DenseCP::yubB |
Dual solution, SDP upper bound
Definition at line 407 of file dense_cp.hpp.