Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::CNC_Matrix Class Reference
Collaboration diagram for Arcane::CNC_Matrix:

Public Types

enum  Storage { NONE , ROWS , COLUMNS , ROWS_AND_COLUMNS }

Public Member Functions

 CNC_Matrix (long m, long n, Storage storage=ROWS)
 CNC_Matrix (long n)
 CNC_Matrix (long n, Storage storage, bool symmetric_storage)
long m () const
long n () const
long diag_size () const
long nnz () const
bool rows_are_stored () const
bool columns_are_stored () const
Storage storage () const
bool has_symmetric_storage () const
bool is_square () const
bool is_symmetric () const
void set_symmetric_tag (bool x)
CNCSparseRowColumnrow (long i)
const CNCSparseRowColumnrow (long i) const
CNCSparseRowColumncolumn (long j)
const CNCSparseRowColumncolumn (long j) const
double diag (long i) const
void add (long i, long j, double val)
void sort ()
void clear ()
void zero ()
void allocate (long m, long n, Storage storage, bool symmetric=false)
void deallocate ()

Private Member Functions

 CNC_Matrix (const CNC_Matrix &rhs)
CNC_Matrixoperator= (const CNC_Matrix &rhs)

Private Attributes

long m_
long n_
long diag_size_
CNCSparseRowColumnrow_
CNCSparseRowColumncolumn_
double * diag_
Storage storage_
bool rows_are_stored_
bool columns_are_stored_
bool symmetric_storage_
bool symmetric_tag_

Detailed Description

Definition at line 136 of file AlephCudaMatrix.h.

Member Enumeration Documentation

◆ Storage

enum Arcane::CNC_Matrix::Storage

Definition at line 140 of file AlephCudaMatrix.h.

Constructor & Destructor Documentation

◆ CNC_Matrix() [1/4]

Arcane::CNC_Matrix::CNC_Matrix ( long m,
long n,
Storage storage = ROWS )

Constructs an m*n sparse matrix.

Parameters
Storagecan be one of ROWS, COLUMNS, ROWS_AND_COLUMNS

Definition at line 56 of file AlephCudaMatrix.cc.

◆ CNC_Matrix() [2/4]

Arcane::CNC_Matrix::CNC_Matrix ( long n)

Constructs an n*n sparse matrix, row storage is used, Non symmetric storage is used

Definition at line 72 of file AlephCudaMatrix.cc.

◆ CNC_Matrix() [3/4]

Arcane::CNC_Matrix::CNC_Matrix ( long n,
Storage storage,
bool symmetric_storage )

Constructs a square n*n sparse matrix.

Parameters
Storagecan be one of ROWS, COLUMNS, ROWS_AND_COLUMNS
symmetric_storageif set, only entries a_ij such that j <= i are stored.

Definition at line 64 of file AlephCudaMatrix.cc.

◆ CNC_Matrix() [4/4]

Arcane::CNC_Matrix::CNC_Matrix ( )

Definition at line 95 of file AlephCudaMatrix.cc.

◆ ~CNC_Matrix()

Arcane::CNC_Matrix::~CNC_Matrix ( )

Definition at line 88 of file AlephCudaMatrix.cc.

Member Function Documentation

◆ add()

void Arcane::CNC_Matrix::add ( long i,
long j,
double val )

aij <- aij + val

Definition at line 233 of file AlephCudaMatrix.cc.

References Arcane::CNCSparseRowColumn::add(), column(), and row().

Here is the call graph for this function:

◆ allocate()

void Arcane::CNC_Matrix::allocate ( long m,
long n,
Storage storage,
bool symmetric = false )

Definition at line 329 of file AlephCudaMatrix.cc.

◆ clear()

void Arcane::CNC_Matrix::clear ( )

removes all the coefficients and frees the allocated space.

Definition at line 286 of file AlephCudaMatrix.cc.

References Arcane::CNCSparseRowColumn::clear(), column(), and row().

Here is the call graph for this function:

◆ column() [1/2]

CNCSparseRowColumn & Arcane::CNC_Matrix::column ( long j)

storage should be one of COLUMN, ROWS_AND_COLUMNS

Parameters
iindex of the column, in the range [0, n-1]

Definition at line 208 of file AlephCudaMatrix.cc.

Referenced by add(), clear(), nnz(), sort(), and zero().

Here is the caller graph for this function:

◆ column() [2/2]

const CNCSparseRowColumn & Arcane::CNC_Matrix::column ( long j) const

storage should be one of COLUMNS, ROWS_AND_COLUMNS

Parameters
iindex of the column, in the range [0, n-1]

Definition at line 217 of file AlephCudaMatrix.cc.

◆ columns_are_stored()

bool Arcane::CNC_Matrix::columns_are_stored ( ) const

Definition at line 152 of file AlephCudaMatrix.cc.

◆ deallocate()

void Arcane::CNC_Matrix::deallocate ( )

Definition at line 305 of file AlephCudaMatrix.cc.

◆ diag()

double Arcane::CNC_Matrix::diag ( long i) const

returns aii.

Definition at line 225 of file AlephCudaMatrix.cc.

◆ diag_size()

long Arcane::CNC_Matrix::diag_size ( ) const

Definition at line 124 of file AlephCudaMatrix.cc.

◆ has_symmetric_storage()

bool Arcane::CNC_Matrix::has_symmetric_storage ( ) const

Definition at line 162 of file AlephCudaMatrix.cc.

◆ is_square()

bool Arcane::CNC_Matrix::is_square ( ) const

Definition at line 167 of file AlephCudaMatrix.cc.

◆ is_symmetric()

bool Arcane::CNC_Matrix::is_symmetric ( ) const

Definition at line 172 of file AlephCudaMatrix.cc.

◆ m()

long Arcane::CNC_Matrix::m ( ) const

Definition at line 114 of file AlephCudaMatrix.cc.

◆ n()

long Arcane::CNC_Matrix::n ( ) const

Definition at line 119 of file AlephCudaMatrix.cc.

◆ nnz()

long Arcane::CNC_Matrix::nnz ( ) const

number of non-zero coefficients

Definition at line 129 of file AlephCudaMatrix.cc.

References column(), and row().

Here is the call graph for this function:

◆ row() [1/2]

CNCSparseRowColumn & Arcane::CNC_Matrix::row ( long i)

storage should be one of ROWS, ROWS_AND_COLUMNS

Parameters
iindex of the row, in the range [0, m-1]

Definition at line 190 of file AlephCudaMatrix.cc.

Referenced by add(), clear(), nnz(), sort(), and zero().

Here is the caller graph for this function:

◆ row() [2/2]

const CNCSparseRowColumn & Arcane::CNC_Matrix::row ( long i) const

storage should be one of ROWS, ROWS_AND_COLUMNS

Parameters
iindex of the row, in the range [0, m-1]

Definition at line 199 of file AlephCudaMatrix.cc.

◆ rows_are_stored()

bool Arcane::CNC_Matrix::rows_are_stored ( ) const

Definition at line 147 of file AlephCudaMatrix.cc.

◆ set_symmetric_tag()

void Arcane::CNC_Matrix::set_symmetric_tag ( bool x)

For symmetric matrices that are not stored in symmetric mode, one may want to give a hint that the matrix is symmetric.

Definition at line 181 of file AlephCudaMatrix.cc.

◆ sort()

void Arcane::CNC_Matrix::sort ( )

sorts rows and columns by increasing coefficients

Definition at line 251 of file AlephCudaMatrix.cc.

References column(), row(), and Arcane::CNCSparseRowColumn::sort().

Here is the call graph for this function:

◆ storage()

CNC_Matrix::Storage Arcane::CNC_Matrix::storage ( ) const

Definition at line 157 of file AlephCudaMatrix.cc.

◆ zero()

void Arcane::CNC_Matrix::zero ( )

removes all the coefficients, but keeps the allocated storage, that will be used by subsequent calls to add().

Definition at line 267 of file AlephCudaMatrix.cc.

References column(), row(), and Arcane::CNCSparseRowColumn::zero().

Here is the call graph for this function:

Member Data Documentation

◆ column_

CNCSparseRowColumn* Arcane::CNC_Matrix::column_
private

Definition at line 244 of file AlephCudaMatrix.h.

◆ columns_are_stored_

bool Arcane::CNC_Matrix::columns_are_stored_
private

Definition at line 249 of file AlephCudaMatrix.h.

◆ diag_

double* Arcane::CNC_Matrix::diag_
private

Definition at line 245 of file AlephCudaMatrix.h.

◆ diag_size_

long Arcane::CNC_Matrix::diag_size_
private

Definition at line 241 of file AlephCudaMatrix.h.

◆ m_

long Arcane::CNC_Matrix::m_
private

Definition at line 239 of file AlephCudaMatrix.h.

◆ n_

long Arcane::CNC_Matrix::n_
private

Definition at line 240 of file AlephCudaMatrix.h.

◆ row_

CNCSparseRowColumn* Arcane::CNC_Matrix::row_
private

Definition at line 243 of file AlephCudaMatrix.h.

◆ rows_are_stored_

bool Arcane::CNC_Matrix::rows_are_stored_
private

Definition at line 248 of file AlephCudaMatrix.h.

◆ storage_

Storage Arcane::CNC_Matrix::storage_
private

Definition at line 247 of file AlephCudaMatrix.h.

◆ symmetric_storage_

bool Arcane::CNC_Matrix::symmetric_storage_
private

Definition at line 250 of file AlephCudaMatrix.h.

◆ symmetric_tag_

bool Arcane::CNC_Matrix::symmetric_tag_
private

Definition at line 251 of file AlephCudaMatrix.h.


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