Lower Triangular Matrix. More...

#include <rlowertriangularmatrix.h>

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

Public Member Functions

int Compare (const RLowerTriangularMatrix &matrix) const
 
RCursor< RVectorGetLines (void) 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)
 
RLowerTriangularMatrixoperator= (const RLowerTriangularMatrix &matrix)
 
 RLowerTriangularMatrix (size_t size)
 
 RLowerTriangularMatrix (const RLowerTriangularMatrix &matrix)
 
virtual void VerifySize (size_t newlines, size_t newcols, bool fill=false, double val=NAN)
 
virtual ~RLowerTriangularMatrix (void)
 
- Public Member Functions inherited from RMatrix
int Compare (const RMatrix &matrix) const
 
RCursor< RVectorGetLines (void) const
 
virtual void Init (double val)
 
RMatrixoperator*= (const double arg)
 
RMatrixoperator*= (const RMatrix &matrix)
 
RMatrixoperator+= (const RMatrix &matrix)
 
RMatrixoperator-= (const RMatrix &matrix)
 
RMatrixoperator/= (const double arg)
 
RMatrixoperator= (const RMatrix &matrix)
 
const RVectoroperator[] (size_t i) const
 
RVectoroperator[] (size_t i)
 
 RMatrix (size_t size)
 
 RMatrix (size_t lines, size_t cols)
 
 RMatrix (const RMatrix &matrix)
 
void Symetrize (void)
 
virtual ~RMatrix (void)
 
- Public Member Functions inherited from RGenericMatrix
virtual void Add (size_t i, size_t j, double val)
 
virtual void Clear (double val=NAN, bool clean=false)
 
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)
 

Protected Member Functions

virtual void Create (void)
 
- Protected Member Functions inherited from RMatrix
void TestThis (void) const
 
- Protected Member Functions inherited from RContainer< RVector, true, false >
void Clear (size_t m=0, size_t i=0, bool force=false)
 
int Compare (const RContainer< RVector, true, false > &) const
 
void Copy (const RContainer< RVector, a, false > &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
 
RVectorGetInsertPtr (const TUse &tag, size_t min=0, size_t max=0)
 
RVectorGetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0)
 
RVectorGetInsertPtrAt (const TUse &tag, size_t pos)
 
size_t GetMaxNb (void) const
 
size_t GetMaxPos (void) const
 
size_t GetNb (void) const
 
RVectorGetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const
 
RVectorGetPtr (const TUse &tag, size_t min=0, size_t max=0) const
 
const RVectorGetPtrAt (size_t idx) const
 
RVectorGetPtrAt (size_t idx)
 
RContainer< RVector, false,
false > * 
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 RVector **tab, size_t min=0, size_t max=0) const
 
size_t GetTab (RVector **tab, size_t min=0, size_t max=0)
 
void InsertPtr (RVector *ins, bool del=false, size_t min=0, size_t max=0)
 
void InsertPtrAt (RVector *ins, size_t pos, bool del)
 
void InsertPtrAt (RVector *ins, size_t pos)
 
void Inter (const iRContainer< RVector > &src1, const iRContainer< RVector > &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< RVector, a, o > &src)
 
RContaineroperator= (const RContainer< RVector, true, false > &src)
 
RContaineroperator= (const RContainer< RVector, false, false > &src)
 
const RVectoroperator[] (size_t idx) const
 
RVectoroperator[] (size_t idx)
 
 RContainer (const RContainer< RVector, true, false > &src)
 
 RContainer (const RContainer< RVector, false, false > &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< RVector, a, o > &src)
 
void Union (const iRContainer< RVector > &src1, const iRContainer< RVector > &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)
 

Additional Inherited Members

- Public Types inherited from RGenericMatrix
enum  tType {
  tNormal, tDiagonal, tLowerTriangular, tUpperTriangular,
  tSymmetric, tSparse, tSparseSymmetric, tMax
}
 
- Static Protected Member Functions inherited from RContainer< RVector, true, false >
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 RMatrix
bool MustCreate
 
- 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

Lower Triangular Matrix.

The RLowerTriangularMatrix class provides a representation of a lower triangular matrix.

RLowerTriangular a(2); // Square matrix of (2,2)
a(0,0)=1.0;
a(1,0)=2.0;
a(1,1)=3.0;
RCursor<RVector> Lines(c.GetLines());
for(Lines.Start();!Lines.End();Lines.Next())
{
RNumCursor<double> Cols(Lines()->GetCols());
for(Cols.Start();!Cols.End();Cols.Next())
cout<<Cols()<<"\t";
cout<<endl;
cont RLowerTriangular& b(a); // const version of a.
cout<<b(0,1)<<endl; // OK, print 0 (use the const (i,j) operator).
a(0,1)=45.0; // !!! Generate an exception since Matrix(i,j)=0 ∀ j>i
a(0,1)=0.0; // !!! Generate an exception : In fact, Matrix(i,j) cannot be written ∀ j>i

Constructor & Destructor Documentation

RLowerTriangularMatrix ( size_t  size)

Construct a square matrix of a given size.

Parameters
sizeSize of the matrix.

Construct a matrix from another one.

Parameters
matrixMatrix.
virtual ~RLowerTriangularMatrix ( void  )
virtual

Destruct the matrix.

Member Function Documentation

int Compare ( const RLowerTriangularMatrix matrix) const

Compare method used by RContainer.

Parameters
matrixMatrix to compare with.
Returns
always -1.
virtual void Create ( void  )
protectedvirtual

Create the matrix. The method should always put Init to false.

Reimplemented from RMatrix.

virtual void VerifySize ( size_t  newlines,
size_t  newcols,
bool  fill = false,
double  val = NAN 
)
virtual

Verify if the matrix has a given size, and increase them if necessary.

Parameters
newlinesNew line number.
newcolsNew column number.
fillElements must be filled with a value.
valValue used eventually to fill the elements created.

Reimplemented from RMatrix.

virtual tType GetType ( void  ) const
virtual

Get the type of the matrix.

Reimplemented from RMatrix.

Reimplemented in RSymmetricMatrix.

RCursor<RVector> GetLines ( void  ) const

Get the number of lines in the matrix.

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 RMatrix.

Reimplemented in RSymmetricMatrix.

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

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

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

Reimplemented from RMatrix.

Reimplemented in RSymmetricMatrix.

RLowerTriangularMatrix& operator= ( const RLowerTriangularMatrix matrix)

Assign operator.

Parameters
matrixMatrix.