Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator > Class Template Reference

Row-major sparse-matrix class. More...

#include <Matrix_ArraySparse.hxx>

Inheritance diagram for Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >:
Seldon::Matrix_ArraySparse< T, Prop, ArrayRowSparse, Allocator >

List of all members.

Public Types

typedef Allocator::value_type value_type
typedef Prop property
typedef ArrayRowSparse storage
typedef Allocator allocator
typedef Allocator::pointer pointer
typedef Allocator::const_pointer const_pointer
typedef Allocator::reference reference
typedef Allocator::const_reference const_reference
typedef T entry_type
typedef T & access_type
typedef T const_access_type

Public Member Functions

 Matrix ()
 Default constructor.
 Matrix (int i, int j)
 Constructor.
void ClearRow (int i)
 Clears a row.
void ReallocateRow (int i, int j)
 Changes the size of a row.
void ResizeRow (int i, int j)
 Changes the size of a row.
void SwapRow (int i, int i_)
 Swaps two rows.
void ReplaceIndexRow (int i, IVect &new_index)
 Sets column numbers of non-zero entries of a row.
int GetRowSize (int i) const
 Returns the number of non-zero entries of a row.
void PrintRow (int i) const
 Displays non-zero values of a row.
void AssembleRow (int i)
 Assembles a row.
void AddInteraction (int i, int j, const T &val)
 Adds a coefficient in the matrix.
void AddInteractionRow (int, int, int *, T *)
 Adds coefficients in a row.
void AddInteractionColumn (int, int, int *, T *)
 Adds coefficients in a column.
template<class Alloc1 >
void AddInteractionRow (int i, int nb, const IVect &col, const Vector< T, VectFull, Alloc1 > &val)
 Adds coefficients in a row.
template<class Alloc1 >
void AddInteractionColumn (int i, int nb, const IVect &row, const Vector< T, VectFull, Alloc1 > &val)
 Adds coefficients in a column.
void Clear ()
void Reallocate (int i, int j)
void Resize (int i, int j)
int GetM () const
int GetM (const SeldonTranspose &status) const
int GetN () const
int GetN (const SeldonTranspose &status) const
int GetNonZeros () const
int GetDataSize () const
int * GetIndex (int i) const
T * GetData (int i) const
Vector< T, VectSparse,
Allocator > * 
GetData () const
operator() (int i, int j) const
T & Get (int i, int j)
const T & Get (int i, int j) const
T & Val (int i, int j)
const T & Val (int i, int j) const
void Set (int i, int j, const T &x)
const T & Value (int num_row, int i) const
T & Value (int num_row, int i)
int Index (int num_row, int i) const
int & Index (int num_row, int i)
void SetData (int, int, Vector< T, VectSparse, Allocator > *)
void SetData (int, int, T *, int *)
void Nullify (int i)
void Nullify ()
void Print () const
void Assemble ()
void RemoveSmallEntry (const T0 &epsilon)
void SetIdentity ()
void Zero ()
void Fill ()
void Fill (const T0 &x)
void FillRand ()
void Write (string FileName) const
void Write (ostream &FileStream) const
void WriteText (string FileName) const
void WriteText (ostream &FileStream) const
void Read (string FileName)
void Read (istream &FileStream)
void ReadText (string FileName)
void ReadText (istream &FileStream)

Protected Attributes

int m_
 Number of rows.
int n_
 Number of columns.
Vector< Vector< T, VectSparse,
Allocator >, VectFull,
NewAlloc< Vector< T,
VectSparse, Allocator > > > 
val_
 rows or columns

Detailed Description

template<class T, class Prop, class Allocator>
class Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >

Row-major sparse-matrix class.

Definition at line 175 of file Matrix_ArraySparse.hxx.


Constructor & Destructor Documentation

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::Matrix (  )  [inline]

Default constructor.

Builds an empty matrix.

Definition at line 1175 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::Matrix ( int  i,
int  j 
) [inline]

Constructor.

Builds a i by j matrix

Parameters:
i number of rows.
j number of columns.
Note:
Matrix values are not initialized.

Definition at line 1188 of file Matrix_ArraySparse.cxx.


Member Function Documentation

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AddInteraction ( int  i,
int  j,
const T &  val 
) [inline]

Adds a coefficient in the matrix.

Parameters:
[in] i row number.
[in] j column number.
[in] val coefficient to add.

Definition at line 1295 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AddInteractionColumn ( int  i,
int  nb,
int *  row_,
T *  value_ 
) [inline]

Adds coefficients in a column.

Parameters:
[in] i column number.
[in] nb number of coefficients to add.
[in] row_ row numbers of coefficients.
[in] value_ values of coefficients.

Definition at line 1331 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
template<class Alloc1 >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AddInteractionColumn ( int  i,
int  nb,
const IVect row,
const Vector< T, VectFull, Alloc1 > &  val 
) [inline]

Adds coefficients in a column.

Parameters:
[in] i column number.
[in] nb number of coefficients to add.
[in] row row numbers of coefficients.
[in] val values of coefficients.

Definition at line 1368 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AddInteractionRow ( int  i,
int  nb,
int *  col_,
T *  value_ 
) [inline]

Adds coefficients in a row.

Parameters:
[in] i row number.
[in] nb number of coefficients to add.
[in] col_ column numbers of coefficients.
[in] value_ values of coefficients.

Definition at line 1310 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
template<class Alloc1 >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AddInteractionRow ( int  i,
int  nb,
const IVect col,
const Vector< T, VectFull, Alloc1 > &  val 
) [inline]

Adds coefficients in a row.

Parameters:
[in] i row number.
[in] nb number of coefficients to add.
[in] col column numbers of coefficients.
[in] val values of coefficients.

Definition at line 1352 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AssembleRow ( int  i  )  [inline]

Assembles a row.

Parameters:
[in] i row number.
Warning:
If you are using the methods AddInteraction, you don't need to call that method.

Definition at line 1282 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
int Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::GetRowSize ( int  i  )  const [inline]

Returns the number of non-zero entries of a row.

Parameters:
[in] i row number.
Returns:
The number of non-zero entries of the row i.

Definition at line 1261 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::ReallocateRow ( int  i,
int  j 
) [inline]

Changes the size of a row.

Parameters:
[in] i row number.
[in] j new number of non-zero entries of the row.
Warning:
Data may be lost.

Definition at line 1210 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::ReplaceIndexRow ( int  i,
IVect new_index 
) [inline]

Sets column numbers of non-zero entries of a row.

Parameters:
[in] i column number.
[in] new_index new column numbers.

Definition at line 1248 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::ResizeRow ( int  i,
int  j 
) [inline]

Changes the size of a row.

Parameters:
[in] i row number.
[in] j new number of non-zero entries of the row.
Note:
Data is kept.

Definition at line 1223 of file Matrix_ArraySparse.cxx.

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::SwapRow ( int  i,
int  j 
) [inline]

Swaps two rows.

Parameters:
[in] i first row number.
[in] j second row number.

Definition at line 1235 of file Matrix_ArraySparse.cxx.


The documentation for this class was generated from the following files: