|
| SDP () |
| Initialize this SDP to an empty state. More...
|
|
| SDP (const size_t n, const size_t numSparseConstraints, const size_t numDenseConstraints) |
| Initialize this SDP to one which structurally has size n. More...
|
|
ObjectiveMatrixType & | C () |
| Modify the sparse objective function matrix (sparseC). More...
|
|
const ObjectiveMatrixType & | C () const |
| Return the sparse objective function matrix (sparseC). More...
|
|
const std::vector< arma::mat > & | DenseA () const |
| Return the vector of dense A matrices (which correspond to the dense constraints). More...
|
|
std::vector< arma::mat > & | DenseA () |
| Modify the veector of dense A matrices (which correspond to the dense constraints). More...
|
|
const arma::vec & | DenseB () const |
| Return the vector of dense B values. More...
|
|
arma::vec & | DenseB () |
| Modify the vector of dense B values. More...
|
|
bool | HasLinearlyIndependentConstraints () const |
| Check whether or not the constraint matrices are linearly independent. More...
|
|
size_t | N () const |
| Return number of rows and columns in the objective matrix C. More...
|
|
size_t | N2bar () const |
|
size_t | NumConstraints () const |
| Return the total number of constraints in the SDP. More...
|
|
size_t | NumDenseConstraints () const |
| Return the number of dense constraints (constraints with dense Ai) in the SDP. More...
|
|
size_t | NumSparseConstraints () const |
| Return the number of sparse constraints (constraints with sparse Ai) in the SDP. More...
|
|
const std::vector< arma::sp_mat > & | SparseA () const |
| Return the vector of sparse A matrices (which correspond to the sparse constraints). More...
|
|
std::vector< arma::sp_mat > & | SparseA () |
| Modify the veector of sparse A matrices (which correspond to the sparse constraints). More...
|
|
const arma::vec & | SparseB () const |
| Return the vector of sparse B values. More...
|
|
arma::vec & | SparseB () |
| Modify the vector of sparse B values. More...
|
|
template<typename ObjectiveMatrixType>
class mlpack::optimization::SDP< ObjectiveMatrixType >
Specify an SDP in primal form.
min dot(C, X) s.t. dot(Ai, X) = bi, i=1,...,m, X >= 0
This representation allows the constraint matrices Ai to be specified as either dense matrices (arma::mat) or sparse matrices (arma::sp_mat). After initializing the SDP object, you will need to set the constraints yourself, via the SparseA(), SparseB(), DenseA(), DenseB(), and C() functions. Note that for each matrix you add to either SparseA() or DenseA(), you must add the corresponding b value to the corresponding vector SparseB() or DenseB().
The objective matrix (C) may be stored as either dense or sparse depending on the ObjectiveMatrixType parameter.
- Template Parameters
-
ObjectiveMatrixType | Should be either arma::mat or arma::sp_mat. |
Definition at line 39 of file sdp.hpp.
template<typename ObjectiveMatrixType>
template<typename ObjectiveMatrixType>
mlpack::optimization::SDP< ObjectiveMatrixType >::SDP |
( |
const size_t |
n, |
|
|
const size_t |
numSparseConstraints, |
|
|
const size_t |
numDenseConstraints |
|
) |
| |
Initialize this SDP to one which structurally has size n.
To set the constraints you will still need to access through SparseA(), DenseA(), SparseB(), DenseB(), and C(). Consider using move semantics to keep things fast. As with the previous constructor, there is no error checking for the sake of speed, so if you build an invalid SDP, whatever solver you use will gladly try to solve it! (And it will probably crash horribly.)
- Parameters
-
n | Number of rows (and columns) in the objective matrix C. |
numSparseConstraints | Number of sparse constraints. |
numDenseConstraints | Number of dense constraints. |