Public Types | Public Member Functions | Protected Attributes | List of all members
Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator > Class Template Reference
Inheritance diagram for Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >:
Seldon::PetscMatrix< T, Prop, RowMajor, Allocator > Seldon::Matrix_Base< T, Allocator > Seldon::VirtualMatrix< T >

Public Types

typedef Allocator::value_type value_type
 
typedef Allocator::pointer pointer
 
typedef Allocator::const_pointer const_pointer
 
typedef Allocator::reference reference
 
typedef Allocator::const_reference const_reference
 
typedef Allocator::value_type entry_type
 
typedef Allocator::value_type access_type
 
typedef Allocator::value_type const_access_type
 

Public Member Functions

 Matrix ()
 Default constructor. More...
 
 Matrix (int i, int j)
 Main constructor. More...
 
 Matrix (Mat &A)
 Copy constructor. More...
 
 Matrix (const Matrix< T, Prop, PETScMPIAIJ, Allocator > &A)
 Copy constructor. More...
 
void Reallocate (int i, int j, int local_i=PETSC_DECIDE, int local_j=PETSC_DECIDE)
 Reallocates memory to resize the matrix. More...
 
value_type operator() (int i, int j)
 Access operator. More...
 
value_type operator() (int i, int j) const
 Access operator. More...
 
void Copy (const Matrix< T, Prop, PETScMPIAIJ, Allocator > &A)
 Duplicates a matrix. More...
 
Matrix< T, Prop, PETScMPIAIJ, Allocator > & operator= (const Matrix< T, Prop, PETScMPIAIJ, Allocator > &A)
 Duplicates a matrix (assignment operator). More...
 
template<class T0 , class Allocator0 >
void Copy (const Matrix< T0, General, RowSparse, Allocator0 > &A)
 Duplicates a matrix. More...
 
int GetLocalM () const
 Returns the number of local rows of the inner PETSc matrix. More...
 
int GetLocalN () const
 Gets the number of local columns of the inner PETSc matrix. More...
 
void Print () const
 Displays the matrix on the standard output. More...
 
void SetCommunicator (MPI_Comm mpi_communicator)
 Sets the MPI communicator. More...
 
MPI_Comm GetCommunicator () const
 Returns the MPI communicator of the current PETSc matrix. More...
 
void Clear ()
 Clears the matrix. More...
 
void Nullify ()
 Clears the matrix without releasing memory. More...
 
Mat & GetPetscMatrix ()
 Returns a reference on the inner petsc matrix. More...
 
const Mat & GetPetscMatrix () const
 
size_t GetMemorySize () const
 Returns size of A in bytes used to store the matrix.
 
void Resize (int i, int j)
 Reallocates memory to resize the matrix and keeps previous entries. More...
 
void SetData (int i, int j, pointer data)
 Changes the size of the matrix and sets its data array (low level method). More...
 
const_reference Val (int i, int j) const
 Access operator. More...
 
reference Val (int i, int j)
 Access operator. More...
 
reference operator[] (int i)
 Access to elements of the data array. More...
 
const_reference operator[] (int i) const
 Access to elements of the data array. More...
 
void Set (int, int, T)
 
void SetBuffer (int, int, T, InsertMode)
 Inserts or adds values into certain locations of a matrix. More...
 
void Flush () const
 Assembles the PETSc matrix.
 
void GetProcessorRowRange (int &i, int &j) const
 Returns the range of row indices owned by this processor. More...
 
void Copy (const Mat &A)
 Duplicates a matrix. More...
 
void Zero ()
 Sets all elements to zero. More...
 
void SetIdentity ()
 Sets the matrix to the identity.
 
void Fill ()
 Fills the matrix with 0, 1, 2, ... More...
 
void Fill (const T0 &x)
 Fills the matrix with a given value. More...
 
void FillRand ()
 Fills a matrix randomly. More...
 
void Print (int a, int b, int m, int n) const
 Displays a sub-matrix on the standard output. More...
 
void Print (int l) const
 Displays a square sub-matrix on the standard output. More...
 
void Write (string FileName, bool with_size) const
 Writes the matrix in a file. More...
 
void Write (ostream &FileStream, bool with_size) const
 Writes the matrix to an output stream. More...
 
void WriteText (string FileName) const
 Writes the matrix in a file. More...
 
void WriteText (ostream &FileStream) const
 Writes the matrix to an output stream. More...
 
void Read (string FileName)
 Reads the matrix from a file. More...
 
void Read (istream &FileStream)
 Reads the matrix from an input stream. More...
 
void ReadText (string FileName)
 Reads the matrix from a file. More...
 
void ReadText (istream &FileStream)
 Reads the matrix from an input stream. More...
 
pointer GetData () const
 Returns a pointer to the data array. More...
 
const_pointer GetDataConst () const
 Returns a const pointer to the data array. More...
 
void * GetDataVoid () const
 Returns a pointer of type "void*" to the data array. More...
 
const void * GetDataConstVoid () const
 Returns a pointer of type "const void*" to the data array. More...
 
int GetM () const
 Returns the number of rows. More...
 
int GetM (const Seldon::SeldonTranspose &status) const
 Returns the number of rows of the matrix possibly transposed. More...
 
int GetM (const CBLAS_TRANSPOSE &status) const
 Returns the number of rows of the matrix possibly transposed. More...
 
int GetN () const
 Returns the number of columns. More...
 
int GetN (const Seldon::SeldonTranspose &status) const
 Returns the number of columns of the matrix possibly transposed. More...
 
int GetN (const CBLAS_TRANSPOSE &status) const
 Returns the number of columns of the matrix possibly transposed. More...
 
long GetSize () const
 Returns the number of elements in the matrix. More...
 

Protected Attributes

Mat petsc_matrix_
 Encapsulated PETSc matrix.
 
MPI_Comm mpi_communicator_
 The MPI communicator to use.
 
bool petsc_matrix_deallocated_
 Boolean to indicate if the inner PETSc matrix is destroyed or not.
 
pointer data_
 
int m_
 
int n_
 

Detailed Description

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

Definition at line 188 of file PetscMatrix.hxx.

Constructor & Destructor Documentation

◆ Matrix() [1/4]

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::Matrix
inline

Default constructor.

On exit, the matrix is an empty 0x0 matrix.

Definition at line 697 of file PetscMatrixInline.cxx.

◆ Matrix() [2/4]

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

Main constructor.

Builds a i x j collection matrix.

Parameters
[in]inumber of rows of matrices.
[in]jnumber of columns of matrices.

Definition at line 709 of file PetscMatrixInline.cxx.

◆ Matrix() [3/4]

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::Matrix ( Mat &  A)
inline

Copy constructor.

Parameters
[in]APETCs matrix to be copied.

Definition at line 722 of file PetscMatrixInline.cxx.

◆ Matrix() [4/4]

template<class T , class Prop , class Allocator >
Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::Matrix ( const Matrix< T, Prop, PETScMPIAIJ, Allocator > &  A)
inline

Copy constructor.

Parameters
[in]Amatrix to be copied.

Definition at line 734 of file PetscMatrixInline.cxx.

Member Function Documentation

◆ Clear()

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Clear
inlineinherited

Clears the matrix.

Destructs the matrix.

Warning
On exit, the matrix is an empty 0x0 matrix.

Definition at line 109 of file PetscMatrixInline.cxx.

◆ Copy() [1/3]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Copy ( const Mat &  A)
inherited

Duplicates a matrix.

Parameters
Amatrix to be copied.
Note
Memory is duplicated: 'A' is therefore independent from the current instance after the copy.

Definition at line 37 of file PetscMatrix.cxx.

◆ Copy() [2/3]

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::Copy ( const Matrix< T, Prop, PETScMPIAIJ, Allocator > &  A)
inline

Duplicates a matrix.

Parameters
Amatrix to be copied.
Note
Memory is duplicated: 'A' is therefore independent from the current instance after the copy.

Definition at line 840 of file PetscMatrixInline.cxx.

◆ Copy() [3/3]

template<class T , class Prop , class Allocator >
template<class T0 , class Allocator0 >
void Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::Copy ( const Matrix< T0, General, RowSparse, Allocator0 > &  A)

Duplicates a matrix.

Parameters
Amatrix to be copied.
Note
Memory is duplicated: 'A' is therefore independent from the current instance after the copy.

Definition at line 379 of file PetscMatrix.cxx.

◆ Fill() [1/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Fill
inherited

Fills the matrix with 0, 1, 2, ...

On exit, the matrix is filled with 0, 1, 2, 3, ... The order of those numbers depends on the storage.

Definition at line 76 of file PetscMatrix.cxx.

◆ Fill() [2/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Fill ( const T0 &  x)
inherited

Fills the matrix with a given value.

Parameters
xthe value to fill the matrix with.

Definition at line 89 of file PetscMatrix.cxx.

◆ FillRand()

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::FillRand
inherited

Fills a matrix randomly.

Note
The random generator is very basic.

Definition at line 101 of file PetscMatrix.cxx.

◆ GetCommunicator()

MPI_Comm Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::GetCommunicator
inlineinherited

Returns the MPI communicator of the current PETSc matrix.

Returns
The MPI communicator of the current PETSc matrix.

Definition at line 87 of file PetscMatrixInline.cxx.

◆ GetData()

template<class T , class Allocator >
Matrix_Base< T, Allocator >::pointer Seldon::Matrix_Base< T, Allocator >::GetData
inlineinherited

Returns a pointer to the data array.

Returns a pointer to data, i.e. the data array 'data_'.

Returns
A pointer to the data array.

Definition at line 241 of file Matrix_BaseInline.cxx.

◆ GetDataConst()

template<class T , class Allocator >
Matrix_Base< T, Allocator >::const_pointer Seldon::Matrix_Base< T, Allocator >::GetDataConst
inlineinherited

Returns a const pointer to the data array.

Returns a const pointer to data, i.e. the data array 'data_'.

Returns
A const pointer to the data array.

Definition at line 254 of file Matrix_BaseInline.cxx.

◆ GetDataConstVoid()

template<class T , class Allocator >
const void * Seldon::Matrix_Base< T, Allocator >::GetDataConstVoid
inlineinherited

Returns a pointer of type "const void*" to the data array.

Returns a pointer of type "const void*" to data, i.e. the data array 'data_'.

Returns
A const pointer of type "void*" to the data array.

Definition at line 280 of file Matrix_BaseInline.cxx.

◆ GetDataVoid()

template<class T , class Allocator >
void * Seldon::Matrix_Base< T, Allocator >::GetDataVoid
inlineinherited

Returns a pointer of type "void*" to the data array.

Returns a pointer of type "void*" to data, i.e. the data array 'data_'.

Returns
A pointer of type "void*" to the data array.

Definition at line 267 of file Matrix_BaseInline.cxx.

◆ GetLocalM()

template<class T , class Prop , class Allocator >
int Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::GetLocalM

Returns the number of local rows of the inner PETSc matrix.

Returns
The number of local rows of the inner PETSc matrix.

Definition at line 422 of file PetscMatrix.cxx.

◆ GetLocalN()

template<class T , class Prop , class Allocator >
int Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::GetLocalN

Gets the number of local columns of the inner PETSc matrix.

Returns
The number of local columns of the inner PETSc matrix.

Definition at line 437 of file PetscMatrix.cxx.

◆ GetM() [1/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetM
inlineinherited

Returns the number of rows.

Returns
The number of rows.

Definition at line 69 of file Matrix_BaseInline.cxx.

◆ GetM() [2/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetM ( const CBLAS_TRANSPOSE &  status) const
inlineinherited

Returns the number of rows of the matrix possibly transposed.

Parameters
statusassumed status about the transposition of the matrix.
Returns
The number of rows of the possibly-transposed matrix.

Definition at line 122 of file Matrix_BaseInline.cxx.

◆ GetM() [3/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetM ( const Seldon::SeldonTranspose status) const
inlineinherited

Returns the number of rows of the matrix possibly transposed.

Parameters
statusassumed status about the transposition of the matrix.
Returns
The number of rows of the possibly-transposed matrix.

Definition at line 92 of file Matrix_BaseInline.cxx.

◆ GetN() [1/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetN
inlineinherited

Returns the number of columns.

Returns
The number of columns.

Definition at line 80 of file Matrix_BaseInline.cxx.

◆ GetN() [2/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetN ( const CBLAS_TRANSPOSE &  status) const
inlineinherited

Returns the number of columns of the matrix possibly transposed.

Parameters
statusassumed status about the transposition of the matrix.
Returns
The number of columns of the possibly-transposed matrix.

Definition at line 137 of file Matrix_BaseInline.cxx.

◆ GetN() [3/3]

template<class T >
int Seldon::VirtualMatrix< T >::GetN ( const Seldon::SeldonTranspose status) const
inlineinherited

Returns the number of columns of the matrix possibly transposed.

Parameters
statusassumed status about the transposition of the matrix.
Returns
The number of columns of the possibly-transposed matrix.

Definition at line 107 of file Matrix_BaseInline.cxx.

◆ GetPetscMatrix()

const Mat & Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::GetPetscMatrix
inlineinherited

Returns a reference on the inner petsc matrix.

Returns a const reference on the inner petsc matrix.

Returns
A reference on the inner petsc matrix.
A const reference on the inner petsc matrix.

Definition at line 141 of file PetscMatrixInline.cxx.

◆ GetProcessorRowRange()

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::GetProcessorRowRange ( int &  i,
int &  j 
) const
inlineinherited

Returns the range of row indices owned by this processor.

The matrix is laid out with the first $n_1$ rows on the first processor, next $n_2$ rows on the second, etc. If the current processor is $k$, this method returns $n_k$ in i and $n_{k+1}$ in j. If i is set to PETSC_NULL on entry, it is not modified by this function. Same is true for j.

Parameters
[in,out]ithe index of the first local row.
[in,out]jthe index of the last local row, plus 1.

Definition at line 319 of file PetscMatrixInline.cxx.

◆ GetSize()

template<class T >
long Seldon::VirtualMatrix< T >::GetSize
inlineinherited

Returns the number of elements in the matrix.

Returns the number of elements in the matrix, i.e. the number of rows multiplied by the number of columns.

Returns
The number of elements in the matrix.

Definition at line 153 of file Matrix_BaseInline.cxx.

◆ Nullify()

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Nullify
inlineinherited

Clears the matrix without releasing memory.

On exit, the matrix is empty and the memory has not been released. It is useful for low level manipulations on a Matrix instance.

Warning
Memory is not released except for me_.

Definition at line 128 of file PetscMatrixInline.cxx.

◆ operator()() [1/2]

template<class T , class Prop , class Allocator >
Matrix< T, Prop, PETScMPIAIJ, Allocator >::value_type Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::operator() ( int  i,
int  j 
)
inline

Access operator.

Returns the value of element (i, j).

Parameters
irow index.
jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 773 of file PetscMatrixInline.cxx.

◆ operator()() [2/2]

template<class T , class Prop , class Allocator >
Matrix< T, Prop, PETScMPIAIJ, Allocator >::value_type Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::operator() ( int  i,
int  j 
) const
inline

Access operator.

Returns the value of element (i, j).

Parameters
irow index.
jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 807 of file PetscMatrixInline.cxx.

◆ operator=()

template<class T , class Prop , class Allocator >
Matrix< T, Prop, PETScMPIAIJ, Allocator > & Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::operator= ( const Matrix< T, Prop, PETScMPIAIJ, Allocator > &  A)
inline

Duplicates a matrix (assignment operator).

Parameters
Amatrix to be copied.
Note
Memory is duplicated: 'A' is therefore independent from the current instance after the copy.

Definition at line 857 of file PetscMatrixInline.cxx.

◆ operator[]() [1/2]

PetscMatrix< T, Prop, RowMajor , Allocator >::reference Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::operator[] ( int  i)
inlineinherited

Access to elements of the data array.

Provides a direct access to the data array.

Parameters
iindex.
Returns
i-th element of the data array.

Definition at line 248 of file PetscMatrixInline.cxx.

◆ operator[]() [2/2]

PetscMatrix< T, Prop, RowMajor , Allocator >::const_reference Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::operator[] ( int  i) const
inlineinherited

Access to elements of the data array.

Provides a direct access to the data array.

Parameters
iindex.
Returns
i-th element of the data array.

Definition at line 262 of file PetscMatrixInline.cxx.

◆ Print() [1/3]

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::Print

Displays the matrix on the standard output.

Displays elements on the standard output, in text format. Each row is displayed on a single line and elements of a row are delimited by tabulations.

Definition at line 454 of file PetscMatrix.cxx.

◆ Print() [2/3]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Print ( int  a,
int  b,
int  m,
int  n 
) const
inherited

Displays a sub-matrix on the standard output.

The sub-matrix is defined by its upper-left corner (a, b) and its bottom-right corner (m, n). So, elements with indices in [a, m] x [b, n] are displayed on the standard output, in text format. Each row is displayed on a single line and elements of a row are delimited by tabulations.

Parameters
arow index of the upper-left corner.
bcolumn index of the upper-left corner.
mrow index of the bottom-right corner.
ncolumn index of the bottom-right corner.

Definition at line 122 of file PetscMatrix.cxx.

◆ Print() [3/3]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Print ( int  l) const
inherited

Displays a square sub-matrix on the standard output.

The sub-matrix is defined by its bottom-right corner (l, l). So, elements with indices in [0, 0] x [l, l] are displayed on the standard output, in text format. Each row is displayed on a single line and elements of a row are delimited by tabulations.

Parameters
ldimension of the square matrix to be displayed.

Definition at line 139 of file PetscMatrix.cxx.

◆ Read() [1/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Read ( istream &  FileStream)
inherited

Reads the matrix from an input stream.

Reads a matrix in binary format from an input stream. The number of rows (integer) and the number of columns (integer) are read, and matrix elements are then read in the same order as it should be in memory (e.g. row-major storage).

Parameters
FileStreaminput stream.

Definition at line 280 of file PetscMatrix.cxx.

◆ Read() [2/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Read ( string  FileName)
inherited

Reads the matrix from a file.

Reads a matrix stored in binary format in a file. The number of rows (integer) and the number of columns (integer) are read, and matrix elements are then read in the same order as it should be in memory (e.g. row-major storage).

Parameters
FileNameinput file name.

Definition at line 252 of file PetscMatrix.cxx.

◆ ReadText() [1/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::ReadText ( istream &  FileStream)
inherited

Reads the matrix from an input stream.

Reads a matrix in text format from an input stream.

Parameters
FileStreaminput stream.

Definition at line 318 of file PetscMatrix.cxx.

◆ ReadText() [2/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::ReadText ( string  FileName)
inherited

Reads the matrix from a file.

Reads a matrix stored in text format in a file.

Parameters
FileNameinput file name.

Definition at line 293 of file PetscMatrix.cxx.

◆ Reallocate()

template<class T , class Prop , class Allocator >
void Seldon::Matrix< T, Prop, PETScMPIAIJ, Allocator >::Reallocate ( int  i,
int  j,
int  local_i = PETSC_DECIDE,
int  local_j = PETSC_DECIDE 
)
inline

Reallocates memory to resize the matrix.

On exit, the matrix is a i x i matrix.

Parameters
inumber of rows.
jnumber of columns.
Warning
Depending on your allocator, data may be lost.

Definition at line 750 of file PetscMatrixInline.cxx.

◆ Resize()

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Resize ( int  i,
int  j 
)
inlineinherited

Reallocates memory to resize the matrix and keeps previous entries.

On exit, the matrix is a i x j matrix.

Parameters
inew number of rows.
jnew number of columns.
Warning
The previous entries are kept, extra-entries may not be initialized (depending of the allocator).

Definition at line 178 of file PetscMatrixInline.cxx.

◆ SetBuffer()

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::SetBuffer ( int  i,
int  j,
value,
InsertMode  insert_mode = INSERT_VALUES 
)
inlineinherited

Inserts or adds values into certain locations of a matrix.

Warning
These values may be cached, so 'Flush' must be called after all calls to SetBuffer() have been completed.
Parameters
[in]irow index where to insert the value.
[in]icolumn index where to insert the value.
[in]valuethe value to insert.
[in]insert_modeeither INSERT_VALUES or ADD_VALUES, where ADD_VALUES adds the value to the entry, and INSERT_VALUES replaces existing entry with new value.

Definition at line 287 of file PetscMatrixInline.cxx.

◆ SetCommunicator()

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::SetCommunicator ( MPI_Comm  mpi_communicator)
inlineinherited

Sets the MPI communicator.

Parameters
[in]mpi_communicatorthe mpi communicator to be set.

Definition at line 75 of file PetscMatrixInline.cxx.

◆ SetData()

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::SetData ( int  i,
int  j,
pointer  data 
)
inlineinherited

Changes the size of the matrix and sets its data array (low level method).

The matrix is first cleared (memory is freed). The matrix is then resized to a i x j matrix, and the data array of the matrix is set to 'data'. 'data' elements are not duplicated: the new data array of the matrix is the 'data' array. It is useful to create a matrix from pre-existing data.

Parameters
inew number of rows.
jnew number of columns.
datanew array storing elements.
Warning
'data' has to be used carefully outside the object. Unless you use 'Nullify', 'data' will be freed by the destructor, which means that 'data' must have been allocated carefully. The matrix allocator should be compatible.
Note
This method should only be used by advanced users.

Definition at line 203 of file PetscMatrixInline.cxx.

◆ Val() [1/2]

PetscMatrix< T, Prop, RowMajor , Allocator >::reference Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Val ( int  i,
int  j 
)
inlineinherited

Access operator.

Returns the value of element (i, j).

Parameters
irow index.
jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 234 of file PetscMatrixInline.cxx.

◆ Val() [2/2]

PetscMatrix< T, Prop, RowMajor , Allocator >::const_reference Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Val ( int  i,
int  j 
) const
inlineinherited

Access operator.

Returns the value of element (i, j).

Parameters
irow index.
jcolumn index.
Returns
Element (i, j) of the matrix.

Definition at line 219 of file PetscMatrixInline.cxx.

◆ Write() [1/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Write ( ostream &  FileStream,
bool  with_size 
) const
inherited

Writes the matrix to an output stream.

Writes the matrix to an output stream in binary format. The number of rows (integer) and the number of columns (integer) are written, and matrix elements are then written in the same order as in memory (e.g. row-major storage).

Parameters
FileStreamoutput stream.

Definition at line 189 of file PetscMatrix.cxx.

◆ Write() [2/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Write ( string  FileName,
bool  with_size 
) const
inherited

Writes the matrix in a file.

Stores the matrix in a file in binary format. The number of rows (integer) and the number of columns (integer) are written, and matrix elements are then written in the same order as in memory (e.g. row-major storage).

Parameters
FileNameoutput file name.

Definition at line 161 of file PetscMatrix.cxx.

◆ WriteText() [1/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::WriteText ( ostream &  FileStream) const
inherited

Writes the matrix to an output stream.

Writes the matrix to an output stream in text format. Only matrix elements are written (not dimensions). Each row is written on a single line and elements of a row are delimited by tabulations.

Parameters
FileStreamoutput stream.

Definition at line 236 of file PetscMatrix.cxx.

◆ WriteText() [2/2]

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::WriteText ( string  FileName) const
inherited

Writes the matrix in a file.

Stores the matrix in a file in text format. Only matrix elements are written (not dimensions). Each row is written on a single line and elements of a row are delimited by tabulations.

Parameters
FileNameoutput file name.

Definition at line 206 of file PetscMatrix.cxx.

◆ Zero()

void Seldon::PetscMatrix< T, Prop, RowMajor , Allocator >::Zero
inherited

Sets all elements to zero.

Warning
It fills the memory with zeros. If the matrix stores complex structures, use 'Fill' instead.

Definition at line 55 of file PetscMatrix.cxx.


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