Sparse Symmetric Matrix. More...

#include <rsparsesymmetricmatrix.h>

Inheritance diagram for RSparseSymmetricMatrix:
[legend]
Collaboration diagram for RSparseSymmetricMatrix:
[legend]

Public Member Functions

int Compare (const RSparseSymmetricMatrix &matrix) const
 
virtual tType GetType (void) const
 
virtual double operator() (size_t i, size_t j) const
 
virtual double & operator() (size_t i, size_t j)
 
RSparseSymmetricMatrixoperator= (const RSparseSymmetricMatrix &matrix)
 
 RSparseSymmetricMatrix (size_t size, bool alllines=true, size_t init=20)
 
 RSparseSymmetricMatrix (const RSparseSymmetricMatrix &src)
 
virtual ~RSparseSymmetricMatrix (void)
 
- Public Member Functions inherited from RSparseMatrix
virtual void Clear (double val=NAN, bool clean=false)
 
int Compare (const RSparseMatrix &matrix) const
 
RCursor< RSparseVectorGetLines (void) const
 
size_t GetNbVectors (void) const
 
RSparseVectorGetValue (size_t i) const
 
virtual void Init (double val)
 
bool IsIn (size_t i) const
 
RSparseMatrixoperator= (const RSparseMatrix &matrix)
 
const RSparseVectoroperator[] (size_t i) const
 
RSparseVectoroperator[] (size_t i)
 
 RSparseMatrix (size_t nblines, size_t nbcols, bool alllines=true, size_t init=20)
 
 RSparseMatrix (const RSparseMatrix &src)
 
virtual void VerifySize (size_t newlines, size_t newcols, bool fill=false, double val=NAN)
 
virtual ~RSparseMatrix (void)
 
- Public Member Functions inherited from RGenericMatrix
virtual void Add (size_t i, size_t j, double val)
 
int Compare (const RGenericMatrix &matrix) const
 
size_t GetNbCols (void) const
 
size_t GetNbLines (void) const
 
RGenericMatrixoperator= (const RGenericMatrix &matrix)
 
template<class S >
void Print (S &stream, const RString &name, const char *format="%E", size_t colsize=12) const
 
 RGenericMatrix (size_t size)
 
 RGenericMatrix (size_t lines, size_t cols)
 
 RGenericMatrix (const RGenericMatrix &matrix)
 
virtual ~RGenericMatrix (void)
 

Additional Inherited Members

- Public Types inherited from RGenericMatrix
enum  tType {
  tNormal, tDiagonal, tLowerTriangular, tUpperTriangular,
  tSymmetric, tSparse, tSparseSymmetric, tMax
}
 
- Protected Member Functions inherited from RContainer< RSparseVector, true, true >
void Clear (size_t m=0, size_t i=0, bool force=false)
 
int Compare (const RContainer< RSparseVector, true, true > &) const
 
void Copy (const RContainer< RSparseVector, a, true > &src)
 
void DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0)
 
void DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
void DeletePtr (const TUse &tag, size_t min=0, size_t max=0)
 
void DeletePtrAt (size_t pos, bool shift, bool del)
 
void DeletePtrAt (size_t pos, bool shift)
 
void DeletePtrAt (size_t pos)
 
void Exchange (size_t pos1, size_t pos2)
 
size_t GetIncNb (void) const
 
size_t GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const
 
RSparseVectorGetInsertPtr (const TUse &tag, size_t min=0, size_t max=0)
 
RSparseVectorGetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
RSparseVectorGetInsertPtrAt (const TUse &tag, size_t pos)
 
size_t GetMaxNb (void) const
 
size_t GetMaxPos (void) const
 
size_t GetNb (void) const
 
RSparseVectorGetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
RSparseVectorGetPtr (const TUse &tag, size_t min=0, size_t max=0) const
 
const RSparseVectorGetPtrAt (size_t idx) const
 
RSparseVectorGetPtrAt (size_t idx)
 
RContainer< RSparseVector,
false, true > * 
GetPtrs (const TUse &tag, size_t min=0, size_t max=0) const
 
size_t GetTab (const void **tab, size_t min=0, size_t max=0) const
 
size_t GetTab (void **tab, size_t min=0, size_t max=0)
 
size_t GetTab (const RSparseVector **tab, size_t min=0, size_t max=0) const
 
size_t GetTab (RSparseVector **tab, size_t min=0, size_t max=0)
 
void InsertPtr (RSparseVector *ins, bool del=false, size_t min=0, size_t max=0)
 
void InsertPtrAt (RSparseVector *ins, size_t pos, bool del)
 
void InsertPtrAt (RSparseVector *ins, size_t pos)
 
void Inter (const iRContainer< RSparseVector > &src1, const iRContainer< RSparseVector > &src2)
 
bool IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
bool IsIn (const TUse &tag, size_t min=0, size_t max=0) const
 
RContaineroperator+= (const RContainer< RSparseVector, a, o > &src)
 
RContaineroperator= (const RContainer< RSparseVector, true, true > &src)
 
RContaineroperator= (const RContainer< RSparseVector, false, true > &src)
 
const RSparseVectoroperator[] (size_t idx) const
 
RSparseVectoroperator[] (size_t idx)
 
 RContainer (const RContainer< RSparseVector, true, true > &src)
 
 RContainer (const RContainer< RSparseVector, false, true > &src)
 
 RContainer (size_t m, size_t i=0)
 
void ReOrder (int sortOrder(const void *, const void *))
 
void ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max)
 
void ReOrder (void)
 
void Shift (size_t idx, bool reverse)
 
void Transfer (RContainer< RSparseVector, a, o > &src)
 
void Union (const iRContainer< RSparseVector > &src1, const iRContainer< RSparseVector > &src2)
 
bool VerifyIndex (size_t idx) const
 
void VerifyTab (size_t max=0)
 
virtual ~RContainer (void)
 
- Protected Member Functions inherited from iRContainer< C >
iRContainerAdd (const iRContainer< C > &src)
 
void Create (const iRContainer< C > &src)
 
void DeepCopy (const iRContainer< C > &src)
 
iRContainerNormalCopy (const iRContainer< C > &src)
 
void Clear (size_t m=0, size_t i=0, bool force=false)
 
void Copy (const iRContainer< C > &src)
 
void DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0)
 
void DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
void DeletePtr (const TUse &tag, size_t min=0, size_t max=0)
 
void DeletePtrAt (size_t pos, bool shift)
 
void DeletePtrAt (size_t pos)
 
void DeletePtrAt (size_t pos, bool shift, bool del)
 
void Exchange (size_t pos1, size_t pos2)
 
size_t GetIncNb (void) const
 
size_t GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const
 
size_t GetIndex (bool order, const TUse &tag, bool &find, size_t min=0, size_t max=0) const
 
C * GetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
C * GetInsertPtr (const TUse &tag, size_t min=0, size_t max=0)
 
C * GetInsertPtrAt (const TUse &tag, size_t pos)
 
size_t GetMaxNb (void) const
 
size_t GetMaxPos (void) const
 
size_t GetNb (void) const
 
C * GetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
C * GetPtr (const TUse &tag, size_t min=0, size_t max=0) const
 
const C * GetPtrAt (size_t idx) const
 
C * GetPtrAt (size_t idx)
 
size_t GetTab (const C **tab, size_t min=0, size_t max=0) const
 
size_t GetTab (C **tab, size_t min=0, size_t max=0)
 
size_t GetTab (const void **tab, size_t min=0, size_t max=0) const
 
size_t GetTab (void **tab, size_t min=0, size_t max=0)
 
void InsertPtr (C *ins, bool del=false, size_t min=0, size_t max=0)
 
void InsertPtrAt (C *ins, size_t pos, bool del)
 
void InsertPtrAt (C *ins, size_t pos)
 
void Inter (const iRContainer< C > &src1, const iRContainer< C > &src2)
 
bool IsIn (const TUse &tag, size_t min=0, size_t max=0) const
 
bool IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
iRContaineroperator+= (const iRContainer< C > &src)
 
iRContaineroperator= (const iRContainer< C > &src)
 
const C * operator[] (size_t idx) const
 
C * operator[] (size_t idx)
 
void ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max)
 
void ReOrder (int sortOrder(const void *, const void *))
 
void ReOrder (void)
 
void Shift (size_t idx, bool reverse)
 
void Transfer (iRContainer< C > &src)
 
void Union (const iRContainer< C > &src1, const iRContainer< C > &src2)
 
bool VerifyIndex (size_t idx) const
 
void VerifyTab (size_t max=0)
 
virtual ~iRContainer (void)
 
- Static Protected Member Functions inherited from RContainer< RSparseVector, true, true >
static int SortOrder (const void *a, const void *b)
 
- Static Protected Member Functions inherited from iRContainer< C >
static int SortOrder (const void *a, const void *b)
 
- Protected Attributes inherited from RSparseMatrix
bool AllLines
 
size_t InitNbCols
 
- Protected Attributes inherited from RGenericMatrix
size_t NbCols
 
size_t NbLines
 
- Protected Attributes inherited from iRContainer< C >
size_t IncPtr
 
size_t LastPtr
 
size_t MaxPtr
 
size_t NbPtr
 
C ** Tab
 

Detailed Description

Sparse Symmetric Matrix.

The RSparseSymmetricMatrix provides a representation for a sparse symmetric matrix. It is specialized version of RSparseMatrix.

An important aspect is the use of static_cast<const RSparseSymmetricMatrix&> to ensure the call of the const version of the operator(). If static_cast<const RSparseSymmetricMatrix&> is not used, the different elements are created with uninitialized values.

Constructor & Destructor Documentation

RSparseSymmetricMatrix ( size_t  size,
bool  alllines = true,
size_t  init = 20 
)

Construct a sparse symmetric matrix.

Parameters
sizeSize of the matrix.
alllinesAll lines have a vector.
initInitial number of elements to reserve for each line.

Copy constructor of a sparse symmetric matrix.

Parameters
srcSparse symmetric matrix used as source.
virtual ~RSparseSymmetricMatrix ( void  )
virtual

Destruct the sparse matrix.

Member Function Documentation

int Compare ( const RSparseSymmetricMatrix matrix) const

Compare method used by RContainer.

Parameters
matrixMatrix to compare with.
Returns
always -1.
virtual tType GetType ( void  ) const
virtual

Get the type of the matrix.

Reimplemented from RSparseMatrix.

RSparseSymmetricMatrix& operator= ( const RSparseSymmetricMatrix matrix)

The assignment operator.

Parameters
matrixSparse Matrix used as source.
virtual double operator() ( size_t  i,
size_t  j 
) const
virtual

Return a specific element of the matrix (const version).

Parameters
iLine number of the element.
jColumn number of the element.

Reimplemented from RSparseMatrix.

virtual double& operator() ( size_t  i,
size_t  j 
)
virtual

Return a specific element of the matrix.

Parameters
iLine number of the element.
jColumn number of the element.

Reimplemented from RSparseMatrix.