3 #ifndef CONICBUNDLE_COEFFMAT_HXX 4 #define CONICBUNDLE_COEFFMAT_HXX 72 virtual std::ostream&
print_id(std::ostream& out)
const {
return out<<
"NoInfo";}
96 std::ostream&
print_id(std::ostream& out)
const {
return out<<name.c_str();}
107 {
return (cip==0)? 0: cip->
clone();}
139 {CM_type=
CM_unspec;infop=0;use_cnt=0;deletion_by_CoeffmatPointer=del_by_CoeffmatPointer;}
145 {deletion_by_CoeffmatPointer=dbMP;}
203 virtual int dense()
const =0;
206 virtual int sparse()
const =0;
232 virtual int equal(
const Coeffmat* p,
double tol=1e-6)
const =0;
235 virtual std::ostream& display(std::ostream& o)
const =0;
238 virtual std::ostream& out(std::ostream& o)
const =0;
241 virtual std::istream& in(std::istream& i) =0;
310 { init(cfmp);
return *
this; }
318 {
return coeffmatp==cfmp; }
326 {
return coeffmatp!=cfmp; }
334 {
return coeffmatp<cfmp; }
342 {
return coeffmatp>cfmp; }
346 {assert(coeffmatp);
return *coeffmatp;}
350 {assert(coeffmatp);
return coeffmatp;}
void set_scalefactor(CH_Matrix_Classes::Real sf)
sets the scale factor
Definition: Coeffmat.hxx:68
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
virtual Coeffmattype get_type() const
returns its Coeffmattype
Definition: Coeffmat.hxx:147
Coeffmat * operator->() const
returns the pointers (may not be called if empty)
Definition: Coeffmat.hxx:349
bool operator<(const Coeffmat *cfmp) const
compares the pointers
Definition: Coeffmat.hxx:333
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
CoeffmatPointer & operator=(Coeffmat *cfmp)
calls init(cfmp), NULL is allowed
Definition: Coeffmat.hxx:309
for CMlowrankdd
Definition: Coeffmat.hxx:33
CoeffmatPointer()
default initialization to an empty pointer
Definition: Coeffmat.hxx:285
for CMsymdense
Definition: Coeffmat.hxx:31
allows to memorize the scalings applied to a Coeffmat and offers the basis for storing further user d...
Definition: Coeffmat.hxx:52
virtual CoeffmatInfo * clone() const
generates a new copy of itself on the heap
Definition: Coeffmat.hxx:63
Coeffmat * coeffmat_read(std::istream &in)
reads the next Coeffmat from in into an object on the heap and returns a pointer to it...
defines a base class for coefficient matrices in semidefinite programming, in particular for use with...
Definition: Coeffmat.hxx:125
Matrix class for integral values of type Integer
Definition: indexmat.hxx:195
bool operator!=(const CoeffmatPointer &mp) const
compares the pointers
Definition: Coeffmat.hxx:321
std::ostream & print_id(std::ostream &out) const
outputs the name
Definition: Coeffmat.hxx:96
CoeffmatPointer(const CoeffmatPointer &mp)
calls init(mp.coeffmatp)
Definition: Coeffmat.hxx:295
for CMsingleton
Definition: Coeffmat.hxx:38
virtual CoeffmatInfo * get_info()
returns the user information
Definition: Coeffmat.hxx:149
bool operator!=(const Coeffmat *cfmp) const
compares the pointers
Definition: Coeffmat.hxx:325
std::string name
well, this is the name
Definition: Coeffmat.hxx:87
Matrix class of symmetric matrices with real values of type Real
Definition: symmat.hxx:43
bool operator>(const CoeffmatPointer &mp) const
compares the pointers
Definition: Coeffmat.hxx:337
for CMgramdense
Definition: Coeffmat.hxx:36
for CMsymsparse
Definition: Coeffmat.hxx:32
Header declaring the class CH_Matrix_Classes::Symmatrix for symmetric matrices with Real elements...
CH_Matrix_Classes::Integer use_cnt
Each CoeffmatPointer pointing to his increase the use_cnt by one and it reduces it by one once it sto...
Definition: Coeffmat.hxx:130
CoeffmatPointer & operator=(const CoeffmatPointer &mp)
calls init(mp.coeffmatp)
Definition: Coeffmat.hxx:305
conic bundle method solver for sum of convex functions. See the ConicBundle_Manual for a quick introd...
Definition: CBSolver.hxx:22
CoeffmatPointer(Coeffmat *cfmp)
calls init() (cfmp==NULL is allowed)
Definition: Coeffmat.hxx:289
Coeffmat * coeffmatp
holds the pointer to Coeffmat, may be NULL == empty
Definition: Coeffmat.hxx:267
bool operator==(const Coeffmat *cfmp) const
compares the pointers
Definition: Coeffmat.hxx:317
Coeffmat(bool del_by_CoeffmatPointer=true)
default constructor; set del_by_CoeffmatPointer==true if a CoeffmatPointer reducing the use_cnt to ze...
Definition: Coeffmat.hxx:138
Coeffmattype CM_type
in order to enable type identification
Definition: Coeffmat.hxx:134
CMIName(std::string in_name, CH_Matrix_Classes::Real sf=1.)
initalize name and scale factor
Definition: Coeffmat.hxx:90
CoeffmatInfo * infop
allows the user to specify and output additional information
Definition: Coeffmat.hxx:135
void init(Coeffmat *cfmp)
initialize the Pointer to hold cfmp (==NULL is allowed for empty); for the coeffmat stored previously...
Definition: Coeffmat.hxx:271
extends CoeffmatInfo to store a name (e.g. of the constraint it represents)
Definition: Coeffmat.hxx:84
CoeffmatInfo * clone() const
generates a new copy of itself on the heap
Definition: Coeffmat.hxx:94
Header declaring the output class CBout.
Matrix class of symmetric matrices with real values of type Real
Definition: sparssym.hxx:89
any user defined constraint may use this
Definition: Coeffmat.hxx:30
bool deletion_by_CoeffmatPointer
set deletion_by_CoeffmatPointer==true if a CoeffmatPointer reducing the use_cnt to zero should delete...
Definition: Coeffmat.hxx:132
for CMlowranksd
Definition: Coeffmat.hxx:34
virtual void set_info(CoeffmatInfo *cip)
deletes the old and sets new user information
Definition: Coeffmat.hxx:153
void multiply(CH_Matrix_Classes::Real sf)
scales the scale factor
Definition: Coeffmat.hxx:70
~CoeffmatPointer()
calls init(0) first
Definition: Coeffmat.hxx:301
bool operator>(const Coeffmat *cfmp) const
compares the pointers
Definition: Coeffmat.hxx:341
for CMgramsparse
Definition: Coeffmat.hxx:37
Matrix class for real values of type Real
Definition: matrix.hxx:74
bool operator==(const CoeffmatPointer &mp) const
compares the pointers
Definition: Coeffmat.hxx:313
CoeffmatInfo(CH_Matrix_Classes::Real sf=1.)
default value is 1 for no scaling
Definition: Coeffmat.hxx:58
Matrix class of sparse matrices with real values of type Real
Definition: sparsmat.hxx:74
for CMlowrankss
Definition: Coeffmat.hxx:35
CH_Matrix_Classes::Real scalefactor
scaling value
Definition: Coeffmat.hxx:55
All derived classes share a common Memarray memory manager, which is generated with the first user an...
Definition: memarray.hxx:117
pointer class for Coeffmat for deleting objects on the heap if Coefmat::use_cnt is reduced to zero an...
Definition: Coeffmat.hxx:264
Header for simple memory management tools that support frequent allocation and deallocation of arrays...
bool operator<(const CoeffmatPointer &mp) const
compares the pointers
Definition: Coeffmat.hxx:329
Coeffmat * ptr() const
returns the pointer (may return NULL)
Definition: Coeffmat.hxx:353
CH_Matrix_Classes::Real get_scalefactor() const
returns the scale factor
Definition: Coeffmat.hxx:66
for CMgramsparse_withoutdiag
Definition: Coeffmat.hxx:39
virtual const CoeffmatInfo * get_info() const
returns the user information in const form
Definition: Coeffmat.hxx:151
virtual std::ostream & print_id(std::ostream &out) const
output a name if there is one for recognizing the type
Definition: Coeffmat.hxx:72
bool equal(const Matrix &A, const Matrix &B)
returns true if both matrices have the same size and the same elements
Definition: matrix.hxx:1433
Coeffmattype
for recognizing the type when writing and reading the problem
Definition: Coeffmat.hxx:29
Real ip(const Matrix &A, const Matrix &B)
returns the usual inner product of A and B, i.e., the sum of A(i,j)*B(i,j) over all i...
Definition: matrix.hxx:1165
void set_deletion_by_CoeffmatPointer(bool dbMP)
if set to true any CoeffmatPointer that reduces use_cnt to zero will delete this object ...
Definition: Coeffmat.hxx:144
Coeffmat & operator*() const
returns the object pointed to (may not be called if empty)
Definition: Coeffmat.hxx:345