Row-major sparse-matrix class. More...
#include <Matrix_ArraySparse.hxx>
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 |
T | 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 |
Row-major sparse-matrix class.
Definition at line 175 of file Matrix_ArraySparse.hxx.
Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::Matrix | ( | ) | [inline] |
Default constructor.
Builds an empty matrix.
Definition at line 1175 of file Matrix_ArraySparse.cxx.
Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::Matrix | ( | int | i, | |
int | j | |||
) | [inline] |
Constructor.
Builds a i by j matrix
i | number of rows. | |
j | number of columns. |
Definition at line 1188 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AddInteraction | ( | int | i, | |
int | j, | |||
const T & | val | |||
) | [inline] |
Adds a coefficient in the matrix.
[in] | i | row number. |
[in] | j | column number. |
[in] | val | coefficient to add. |
Definition at line 1295 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AddInteractionColumn | ( | int | i, | |
int | nb, | |||
int * | row_, | |||
T * | value_ | |||
) | [inline] |
Adds coefficients in a column.
[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.
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.
[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.
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AddInteractionRow | ( | int | i, | |
int | nb, | |||
int * | col_, | |||
T * | value_ | |||
) | [inline] |
Adds coefficients in a row.
[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.
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.
[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.
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::AssembleRow | ( | int | i | ) | [inline] |
Assembles a row.
[in] | i | row number. |
Definition at line 1282 of file Matrix_ArraySparse.cxx.
int Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::GetRowSize | ( | int | i | ) | const [inline] |
Returns the number of non-zero entries of a row.
[in] | i | row number. |
Definition at line 1261 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::ReallocateRow | ( | int | i, | |
int | j | |||
) | [inline] |
Changes the size of a row.
[in] | i | row number. |
[in] | j | new number of non-zero entries of the row. |
Definition at line 1210 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::ReplaceIndexRow | ( | int | i, | |
IVect & | new_index | |||
) | [inline] |
Sets column numbers of non-zero entries of a row.
[in] | i | column number. |
[in] | new_index | new column numbers. |
Definition at line 1248 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::ResizeRow | ( | int | i, | |
int | j | |||
) | [inline] |
Changes the size of a row.
[in] | i | row number. |
[in] | j | new number of non-zero entries of the row. |
Definition at line 1223 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayRowSparse, Allocator >::SwapRow | ( | int | i, | |
int | j | |||
) | [inline] |
Swaps two rows.
[in] | i | first row number. |
[in] | j | second row number. |
Definition at line 1235 of file Matrix_ArraySparse.cxx.