Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::MatVec::Matrix Class Reference

Matrix with CSR storage. More...

#include <arcane/core/matvec/Matrix.h>

Collaboration diagram for Arcane::MatVec::Matrix:

Public Member Functions

 Matrix (Integer nb_row, Integer nb_column)
 Matrix (const Matrix &rhs)
void operator= (const Matrix &rhs)
Matrix clone () const
 Clone the matrix.
Integer nbRow () const
Integer nbColumn () const
void setRowsSize (IntegerConstArrayView rows_size)
 Sets the number of non-zero elements for each row.
void setValues (IntegerConstArrayView columns, RealConstArrayView values)
 Sets the values of the matrix elements.
void dump (std::ostream &o) const
 Prints the matrix.
RealConstArrayView values () const
 Matrix values.
RealArrayView values ()
 Matrix values.
IntegerConstArrayView rowsIndex () const
 Indices of the first elements of each row.
IntegerConstArrayView columns () const
 Column indices of the values.
IntegerArrayView rowsIndex ()
 Indices of the first elements of each row.
IntegerArrayView columns ()
 Column indices of the values.
void setValue (Integer row, Integer column, Real value)
 Sets the value of a matrix element.
Real value (Integer row, Integer column) const
 Returns the value of a matrix element.
void sortDiagonale ()
 Arranges the storage so that the diagonal is the first element.

Static Public Member Functions

static Matrix read (const String &filename)
 Reads the matrix in X Y format.
static Matrix readHypre (const String &filename)
 Reads the matrix in Hypre format.

Private Member Functions

 Matrix (MatrixImpl *impl)

Private Attributes

MatrixImplm_impl = nullptr
 Implementation.

Detailed Description

Matrix with CSR storage.

Matrices operate by reference

Definition at line 44 of file core/matvec/Matrix.h.

Constructor & Destructor Documentation

◆ Matrix() [1/3]

Arcane::MatVec::Matrix::Matrix ( Integer nb_row,
Integer nb_column )

Definition at line 132 of file Matrix.cc.

◆ Matrix() [2/3]

Arcane::MatVec::Matrix::Matrix ( const Matrix & rhs)

Definition at line 153 of file Matrix.cc.

◆ ~Matrix()

Arcane::MatVec::Matrix::~Matrix ( )

Definition at line 177 of file Matrix.cc.

◆ Matrix() [3/3]

Arcane::MatVec::Matrix::Matrix ( MatrixImpl * impl)
explicitprivate

Definition at line 142 of file Matrix.cc.

Member Function Documentation

◆ clone()

Matrix Arcane::MatVec::Matrix::clone ( ) const

Clone the matrix.

Definition at line 214 of file Matrix.cc.

References m_impl.

◆ columns() [1/2]

IntegerArrayView Arcane::MatVec::Matrix::columns ( )

Column indices of the values.

Definition at line 296 of file Matrix.cc.

References m_impl.

◆ columns() [2/2]

IntegerConstArrayView Arcane::MatVec::Matrix::columns ( ) const

Column indices of the values.

Definition at line 314 of file Matrix.cc.

References m_impl.

Referenced by read(), readHypre(), and setValues().

Here is the caller graph for this function:

◆ dump()

void Arcane::MatVec::Matrix::dump ( std::ostream & o) const

Prints the matrix.

Definition at line 233 of file Matrix.cc.

References m_impl.

◆ nbColumn()

Integer Arcane::MatVec::Matrix::nbColumn ( ) const

Definition at line 205 of file Matrix.cc.

◆ nbRow()

Integer Arcane::MatVec::Matrix::nbRow ( ) const

Definition at line 187 of file Matrix.cc.

◆ operator=()

void Arcane::MatVec::Matrix::operator= ( const Matrix & rhs)

Definition at line 164 of file Matrix.cc.

◆ read()

Matrix Arcane::MatVec::Matrix::read ( const String & filename)
static

Reads the matrix in X Y format.

Definition at line 1117 of file Matrix.cc.

References ARCANE_FATAL, columns(), Arcane::math::isZero(), Arcane::String::localstr(), setRowsSize(), setValues(), and values().

Here is the call graph for this function:

◆ readHypre()

Matrix Arcane::MatVec::Matrix::readHypre ( const String & filename)
static

Reads the matrix in Hypre format.

Definition at line 1152 of file Matrix.cc.

References ARCANE_FATAL, columns(), Arcane::String::localstr(), setRowsSize(), setValues(), and values().

Here is the call graph for this function:

◆ rowsIndex() [1/2]

IntegerArrayView Arcane::MatVec::Matrix::rowsIndex ( )

Indices of the first elements of each row.

Definition at line 305 of file Matrix.cc.

References m_impl.

◆ rowsIndex() [2/2]

IntegerConstArrayView Arcane::MatVec::Matrix::rowsIndex ( ) const

Indices of the first elements of each row.

Definition at line 224 of file Matrix.cc.

References m_impl.

◆ setRowsSize()

void Arcane::MatVec::Matrix::setRowsSize ( IntegerConstArrayView rows_size)

Sets the number of non-zero elements for each row.

Definition at line 269 of file Matrix.cc.

References m_impl.

Referenced by read(), and readHypre().

Here is the caller graph for this function:

◆ setValue()

void Arcane::MatVec::Matrix::setValue ( Integer row,
Integer column,
Real value )

Sets the value of a matrix element.

Definition at line 242 of file Matrix.cc.

References m_impl, and value().

Here is the call graph for this function:

◆ setValues()

void Arcane::MatVec::Matrix::setValues ( IntegerConstArrayView columns,
RealConstArrayView values )

Sets the values of the matrix elements.

Definition at line 260 of file Matrix.cc.

References columns(), m_impl, and values().

Referenced by read(), and readHypre().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sortDiagonale()

void Arcane::MatVec::Matrix::sortDiagonale ( )

Arranges the storage so that the diagonal is the first element.

Definition at line 196 of file Matrix.cc.

References m_impl.

◆ value()

Real Arcane::MatVec::Matrix::value ( Integer row,
Integer column ) const

Returns the value of a matrix element.

Definition at line 251 of file Matrix.cc.

References m_impl.

Referenced by setValue().

Here is the caller graph for this function:

◆ values() [1/2]

RealArrayView Arcane::MatVec::Matrix::values ( )

Matrix values.

Definition at line 287 of file Matrix.cc.

References m_impl.

◆ values() [2/2]

RealConstArrayView Arcane::MatVec::Matrix::values ( ) const

Matrix values.

Definition at line 278 of file Matrix.cc.

References m_impl.

Referenced by read(), readHypre(), and setValues().

Here is the caller graph for this function:

Member Data Documentation

◆ m_impl

MatrixImpl* Arcane::MatVec::Matrix::m_impl = nullptr
private

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