3 #ifndef CONICBUNDLE_SPARSECOEFFMATMATRIX_HXX 4 #define CONICBUNDLE_SPARSECOEFFMATMATRIX_HXX 54 typedef std::map<CH_Matrix_Classes::Integer,SparseCoeffmatVector>
SCMcolrep;
86 const CoeffmatVector* coeff_vec=0);
91 CBout(cb,incr),col_dim(0),blockrep(),colrep(0)
97 CBout(cb,incr),col_dim(0),blockrep(),colrep(0)
106 const CoeffmatVector* coeff_vec=0,
109 CBout(cb,incr),col_dim(0),blockrep(),colrep(0)
110 {
init(in_block_dim,in_col_dim,block_ind,col_ind,coeff_vec); }
183 {
return !(*
this==mat);}
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
Header declaring the classes ConicBundle::Coeffmat, ConicBundle::CoeffmatPointer, ConicBundle::Coeffm...
void form_colrep() const
rebuilds the column representation from the block representation (if needed)
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
const SCMcolrep * get_colrep() const
returns the column representation of the matrix
Definition: SparseCoeffmatMatrix.hxx:171
bool operator==(const SparseCoeffmatMatrix &mat) const
useful for testing purposes; true iff both have the same size and both have the same pointers in the ...
CoeffmatPointer operator()(CH_Matrix_Classes::Integer i, CH_Matrix_Classes::Integer j) const
returns the CoeffmatPointer of block i in column j (blockdiagonal matrix j) (may be empty) ...
defines a base class for coefficient matrices in semidefinite programming, in particular for use with...
Definition: Coeffmat.hxx:125
int delete_blocks(const CH_Matrix_Classes::Indexmatrix &delete_indices, CH_Matrix_Classes::Indexmatrix *map_to_old=0)
generates a map_to_old by deleting the specified indices and calls reassign_blocks; this map_to_old w...
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
int reassign_columns(const CH_Matrix_Classes::Indexmatrix &map_to_old)
afterwards the new column i is the previous column map_to_old(i); no multiple appearances are allowed...
int delete_columns(const CH_Matrix_Classes::Indexmatrix &delete_indices, CH_Matrix_Classes::Indexmatrix *map_to_old=0)
generates a map_to_old by deleting the specified indices and calls reassign_columns; this map_to_old ...
int init(const CH_Matrix_Classes::Indexmatrix &block_dim, CH_Matrix_Classes::Integer col_dim, const CH_Matrix_Classes::Indexmatrix *block_ind=0, const CH_Matrix_Classes::Indexmatrix *col_ind=0, const CoeffmatVector *coeff_vec=0)
first calls clear() and then it sets the new values (if one of block_ind, col_ind, or coeff_vec is !=NULL, all must be !=NULL and of the same size)
int primal_ip(CH_Matrix_Classes::Matrix &ipvec, const PSCPrimal *primal, const CH_Matrix_Classes::Indexmatrix *ind=0) const
computes the inner products of (selected) columns (which represent block diagonal symmetric matrices)...
Matrix class of symmetric matrices with real values of type Real
Definition: symmat.hxx:43
SparseCoeffmatMatrix(const SparseCoeffmatMatrix &S, const CBout *cb=0, int incr=-1)
set the output and call clear()
Definition: SparseCoeffmatMatrix.hxx:95
const CH_Matrix_Classes::Indexmatrix & blockdim() const
returns a column vector with row i giving the order of block i
Definition: SparseCoeffmatMatrix.hxx:117
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
const SparseCoeffmatVector * column(CH_Matrix_Classes::Integer i) const
returns NULL if the column is empty and a pointer to a Vector of CoeffmatPointers otherwise ...
base class for uniform use of WARNINGS and ERRORS (at some point in time)
Definition: CBout.hxx:30
stores/organizes the CoeffmatPointer pointers to Coeffmat matrices with the purpose of describing the...
Definition: SparseCoeffmatMatrix.hxx:50
std::map< CH_Matrix_Classes::Integer, CoeffmatPointer > SparseCoeffmatVector
this is used to extract a row/block or a column from a SparseCoeffmatMatrix
Definition: SparseCoeffmatMatrix.hxx:26
std::vector< SparseCoeffmatVector > SCMblockrep
each row/block is likely to have at least one nonzero entry, therefore the block representation uses ...
Definition: SparseCoeffmatMatrix.hxx:62
int reassign_blocks(const CH_Matrix_Classes::Indexmatrix &map_to_old)
afterwards the new block i is the previous block map_to_old(i); no multiple appearances are allowed...
SparseCoeffmatMatrix(const CH_Matrix_Classes::Indexmatrix &in_block_dim, CH_Matrix_Classes::Integer in_col_dim, const CH_Matrix_Classes::Indexmatrix *block_ind=0, const CH_Matrix_Classes::Indexmatrix *col_ind=0, const CoeffmatVector *coeff_vec=0, const CBout *cb=0, int incr=-1)
set the output and call init() for the given sparse information
Definition: SparseCoeffmatMatrix.hxx:102
int append_columns(const SparseCoeffmatMatrix &append_mat, const CH_Matrix_Classes::Indexmatrix *blocks=0, const CH_Matrix_Classes::Indexmatrix *cols=0)
append append_mat (or its submatrix given by blocks and/or cols) to the right
SCMcolrep * colrep
this column representation is only formed on demand and deleted on changes
Definition: SparseCoeffmatMatrix.hxx:67
CH_Matrix_Classes::Integer nzcoldim() const
returns the number of columns with nonzero coefficient matrices
Definition: SparseCoeffmatMatrix.hxx:125
SparseCoeffmatMatrix & operator=(const SparseCoeffmatMatrix &)
copy
~SparseCoeffmatMatrix()
calls clear() and exits
Matrix class for real values of type Real
Definition: matrix.hxx:74
SCMblockrep blockrep
this is the basic block representation, it holds for each row/block a sparse representation of the ro...
Definition: SparseCoeffmatMatrix.hxx:64
std::vector< CoeffmatPointer > CoeffmatVector
convenient for initializing SparseCoeffmatMatrix via the sparse (block_i,column_i,Coeffmat_i), i=1,...,nz (nonzeros) format with Indexmatrix,Indexmatrix,CoeffmatVector
Definition: SparseCoeffmatMatrix.hxx:17
SparseCoeffmatMatrix(const CBout *cb=0, int incr=-1)
set the output and call clear()
Definition: SparseCoeffmatMatrix.hxx:89
CH_Matrix_Classes::Integer rowdim() const
returns the number of blocks
Definition: SparseCoeffmatMatrix.hxx:123
CH_Matrix_Classes::Indexmatrix dense_cnt
number of dense matrices per block
Definition: SparseCoeffmatMatrix.hxx:59
CH_Matrix_Classes::Integer get_dense_cnt(CH_Matrix_Classes::Integer i) const
returns the number of dense matrices in block i
Definition: SparseCoeffmatMatrix.hxx:175
int append_blocks(const SparseCoeffmatMatrix &append_mat, const CH_Matrix_Classes::Indexmatrix *blocks=0, const CH_Matrix_Classes::Indexmatrix *cols=0)
append append_mat (or its submatrix given by blocks and/or cols) below
pointer class for Coeffmat for deleting objects on the heap if Coefmat::use_cnt is reduced to zero an...
Definition: Coeffmat.hxx:264
Integer rowdim() const
returns the row dimension
Definition: indexmat.hxx:321
const SparseCoeffmatVector * block(CH_Matrix_Classes::Integer i) const
returns NULL if the block is empty and a pointer to a Vector of CoeffmatPointers otherwise ...
void clear()
clears all (empty 0 times 0 matrix)
int project(CH_Matrix_Classes::Symmatrix &S, const CH_Matrix_Classes::Matrix &P, const CH_Matrix_Classes::Integer j) const
computes S=P^T*A.column(j)*P
CH_Matrix_Classes::Integer coldim() const
returns the number of columns (i.e. of blockdiagonal matrices)
Definition: SparseCoeffmatMatrix.hxx:121
int Gram_ip(CH_Matrix_Classes::Matrix &ipvec, const CH_Matrix_Classes::Matrix &P, const CH_Matrix_Classes::Matrix *Lam=0, const CH_Matrix_Classes::Indexmatrix *ind=0) const
computes the inner products of (selected) columns (which represent block diagonal symmetric matrices)...
std::map< CH_Matrix_Classes::Integer, SparseCoeffmatVector > SCMcolrep
this will be used for a (lazy) column representation of the matrix
Definition: SparseCoeffmatMatrix.hxx:54
CH_Matrix_Classes::Integer col_dim
number of columns in the SparseCoeffmatMatrix
Definition: SparseCoeffmatMatrix.hxx:58
bool operator!=(const SparseCoeffmatMatrix &mat) const
useful for testing purposes; false iff both have the same size and both have the same pointers in the...
Definition: SparseCoeffmatMatrix.hxx:182
CH_Matrix_Classes::Indexmatrix block_dim
column vector holding for each row the dimension of the block
Definition: SparseCoeffmatMatrix.hxx:57
PSCPrimal is the corresponding positive semidefinite object for PSCOracle like PrimalMatrix for a Mat...
Definition: PSCPrimal.hxx:46