Column-major symmetric sparse-matrix class. More...
#include <Matrix_ArraySparse.hxx>
Public Types | |
typedef Allocator::value_type | value_type |
typedef Prop | property |
typedef ArrayColSymSparse | 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. | |
T | operator() (int i, int j) const |
Access operator. | |
T & | Get (int i, int j) |
Access operator. | |
const T & | Get (int i, int j) const |
Access operator. | |
T & | Val (int i, int j) |
Access operator. | |
const T & | Val (int i, int j) const |
Access operator. | |
void | Set (int i, int j, const T &x) |
Sets an element of the matrix. | |
void | ClearColumn (int i) |
Clears a column. | |
void | ReallocateColumn (int i, int j) |
Reallocates column i. | |
void | ResizeColumn (int i, int j) |
Reallocates column i. | |
void | SwapColumn (int i, int i_) |
Swaps two columns. | |
void | ReplaceIndexColumn (int i, IVect &new_index) |
Sets row numbers of non-zero entries of a column. | |
int | GetColumnSize (int i) const |
Returns the number of non-zero entries of a column. | |
void | PrintColumn (int i) const |
Displays non-zero values of a column. | |
void | AssembleColumn (int i) |
Assembles a column. | |
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 |
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 |
Column-major symmetric sparse-matrix class.
Definition at line 215 of file Matrix_ArraySparse.hxx.
Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::Matrix | ( | ) | [inline] |
Default constructor.
Builds an empty matrix.
Definition at line 1386 of file Matrix_ArraySparse.cxx.
Seldon::Matrix< T, Prop, ArrayColSymSparse, 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 1399 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, 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 1723 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, 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 1703 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, 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 1757 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, 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 1682 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, 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 1739 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::AssembleColumn | ( | int | i | ) | [inline] |
Assembles a column.
[in] | i | column number. |
Definition at line 1667 of file Matrix_ArraySparse.cxx.
const T & Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::Get | ( | int | i, | |
int | j | |||
) | const [inline] |
Access operator.
Returns the value of element (i, j).
i | row index. | |
j | column index. |
Reimplemented from Seldon::Matrix_ArraySparse< T, Prop, ArrayColSymSparse, Allocator >.
Definition at line 1480 of file Matrix_ArraySparse.cxx.
T & Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::Get | ( | int | i, | |
int | j | |||
) | [inline] |
Access operator.
Returns the value of element (i, j).
i | row index. | |
j | column index. |
Reimplemented from Seldon::Matrix_ArraySparse< T, Prop, ArrayColSymSparse, Allocator >.
Definition at line 1450 of file Matrix_ArraySparse.cxx.
int Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::GetColumnSize | ( | int | i | ) | const [inline] |
Returns the number of non-zero entries of a column.
[in] | i | column number. |
Definition at line 1644 of file Matrix_ArraySparse.cxx.
T Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::operator() | ( | int | i, | |
int | j | |||
) | const [inline] |
Access operator.
Returns the value of element (i, j).
i | row index. | |
j | column index. |
Reimplemented from Seldon::Matrix_ArraySparse< T, Prop, ArrayColSymSparse, Allocator >.
Definition at line 1419 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::ReallocateColumn | ( | int | i, | |
int | j | |||
) | [inline] |
Reallocates column i.
[in] | i | column number. |
[in] | j | new number of non-zero entries in the column. |
Definition at line 1591 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::ReplaceIndexColumn | ( | int | i, | |
IVect & | new_index | |||
) | [inline] |
Sets row numbers of non-zero entries of a column.
[in] | i | column number. |
[in] | new_index | new row numbers. |
Definition at line 1630 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::ResizeColumn | ( | int | i, | |
int | j | |||
) | [inline] |
Reallocates column i.
[in] | i | column number. |
[in] | j | new number of non-zero entries in the column. |
Definition at line 1604 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::Set | ( | int | i, | |
int | j, | |||
const T & | x | |||
) | [inline] |
Sets an element of the matrix.
i | row index. | |
j | column index. | |
x | new value for the matrix element (i, j). |
Reimplemented from Seldon::Matrix_ArraySparse< T, Prop, ArrayColSymSparse, Allocator >.
Definition at line 1566 of file Matrix_ArraySparse.cxx.
void Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::SwapColumn | ( | int | i, | |
int | j | |||
) | [inline] |
Swaps two columns.
[in] | i | first column number. |
[in] | j | second column number. |
Definition at line 1617 of file Matrix_ArraySparse.cxx.
T & Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::Val | ( | int | i, | |
int | j | |||
) | [inline] |
Access operator.
Returns the value of element (i, j).
i | row index. | |
j | column index. |
Reimplemented from Seldon::Matrix_ArraySparse< T, Prop, ArrayColSymSparse, Allocator >.
Definition at line 1510 of file Matrix_ArraySparse.cxx.
const T & Seldon::Matrix< T, Prop, ArrayColSymSparse, Allocator >::Val | ( | int | i, | |
int | j | |||
) | const [inline] |
Access operator.
Returns the value of element (i, j).
i | row index. | |
j | column index. |
Reimplemented from Seldon::Matrix_ArraySparse< T, Prop, ArrayColSymSparse, Allocator >.
Definition at line 1540 of file Matrix_ArraySparse.cxx.