13 #ifndef __MLPACK_CORE_OPTIMIZERS_SDP_SDP_HPP 14 #define __MLPACK_CORE_OPTIMIZERS_SDP_SDP_HPP 19 namespace optimization {
39 template <
typename ObjectiveMatrixType>
68 const size_t numSparseConstraints,
69 const size_t numDenseConstraints);
72 size_t N()
const {
return c.n_rows; }
74 size_t N2bar()
const {
return N() * (
N() + 1) / 2; }
87 ObjectiveMatrixType&
C() {
return c; }
89 const ObjectiveMatrixType&
C()
const {
return c; }
126 ObjectiveMatrixType
c;
143 #include "sdp_impl.hpp" const arma::vec & DenseB() const
Return the vector of dense B values.
const ObjectiveMatrixType & C() const
Return the sparse objective function matrix (sparseC).
ObjectiveMatrixType & C()
Modify the sparse objective function matrix (sparseC).
Linear algebra utility functions, generally performed on matrices or vectors.
std::vector< arma::sp_mat > sparseA
A_i for each sparse constraint.
arma::vec denseB
b_i for each dense constraint.
const std::vector< arma::sp_mat > & SparseA() const
Return the vector of sparse A matrices (which correspond to the sparse constraints).
bool HasLinearlyIndependentConstraints() const
Check whether or not the constraint matrices are linearly independent.
size_t N() const
Return number of rows and columns in the objective matrix C.
const arma::vec & SparseB() const
Return the vector of sparse B values.
size_t NumConstraints() const
Return the total number of constraints in the SDP.
const std::vector< arma::mat > & DenseA() const
Return the vector of dense A matrices (which correspond to the dense constraints).
SDP()
Initialize this SDP to an empty state.
arma::vec sparseB
b_i for each sparse constraint.
size_t NumDenseConstraints() const
Return the number of dense constraints (constraints with dense Ai) in the SDP.
size_t NumSparseConstraints() const
Return the number of sparse constraints (constraints with sparse Ai) in the SDP.
ObjectiveMatrixType c
Objective function matrix c.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
std::vector< arma::mat > & DenseA()
Modify the veector of dense A matrices (which correspond to the dense constraints).
std::vector< arma::sp_mat > & SparseA()
Modify the veector of sparse A matrices (which correspond to the sparse constraints).
std::vector< arma::mat > denseA
A_i for each dense constraint.
Specify an SDP in primal form.
ObjectiveMatrixType objective_matrix_type
arma::vec & DenseB()
Modify the vector of dense B values.
arma::vec & SparseB()
Modify the vector of sparse B values.