Template Numerical Library version\ main:bb09b17
|
A common base class for MultidiagonalMatrix and MultidiagonalMatrixView. More...
#include <TNL/Matrices/MultidiagonalMatrixBase.h>
Public Types | |
using | ConstRowView = typename RowView::ConstRowView |
Type for accessing constant matrix rows. | |
using | DeviceType = Device |
The device where the matrix is allocated. | |
using | DiagonalOffsetsView |
using | HostDiagonalOffsetsView |
using | IndexerType = details::MultidiagonalMatrixIndexer< Index, Organization == Algorithms::Segments::RowMajorOrder > |
using | IndexType = Index |
The type used for matrix elements indexing. | |
using | RealType = typename Base::RealType |
The type of matrix elements. | |
using | RowView = MultidiagonalMatrixRowView< typename Base::ValuesViewType, IndexerType, DiagonalOffsetsView > |
Type for accessing matrix rows. | |
Public Types inherited from TNL::Matrices::MatrixBase< Real, Device, Index, GeneralMatrix, Organization > | |
using | ConstValuesViewType |
Type of constant vector view holding values of matrix elements. | |
using | DeviceType |
The device where the matrix is allocated. | |
using | IndexType |
The type used for matrix elements indexing. | |
using | RealType |
The type of matrix elements. | |
using | RowCapacitiesType |
using | ValuesViewType |
Type of vector view holding values of matrix elements. | |
Public Member Functions | |
__cuda_callable__ | MultidiagonalMatrixBase ()=default |
Constructor with no parameters. | |
__cuda_callable__ | MultidiagonalMatrixBase (const MultidiagonalMatrixBase &)=default |
Copy constructor. | |
__cuda_callable__ | MultidiagonalMatrixBase (MultidiagonalMatrixBase &&) noexcept=default |
Move constructor. | |
__cuda_callable__ | MultidiagonalMatrixBase (typename Base::ValuesViewType values, DiagonalOffsetsView diagonalOffsets, HostDiagonalOffsetsView hostDiagonalOffsets, IndexerType indexer) |
Constructor with all necessary data and views. | |
__cuda_callable__ void | addElement (IndexType row, IndexType column, const RealType &value, const RealType &thisElementMultiplicator=1.0) |
Add element at given row and column to given value. | |
template<typename Real_ , typename Device_ , typename Index_ , ElementsOrganization Organization_> | |
void | addMatrix (const MultidiagonalMatrixBase< Real_, Device_, Index_, Organization_ > &matrix, const RealType &matrixMultiplicator=1.0, const RealType &thisMatrixMultiplicator=1.0) |
template<typename Function > | |
void | forAllElements (Function &function) |
This method calls forElements for all matrix rows. | |
template<typename Function > | |
void | forAllElements (Function &function) const |
This method calls forElements for all matrix rows (for constant instances). | |
template<typename Function > | |
void | forAllRows (Function &&function) |
Method for parallel iteration over all matrix rows. | |
template<typename Function > | |
void | forAllRows (Function &&function) const |
Method for parallel iteration over all matrix rows for constant instances. | |
template<typename Function > | |
void | forElements (IndexType begin, IndexType end, Function &function) |
Method for iteration over all matrix rows for non-constant instances. | |
template<typename Function > | |
void | forElements (IndexType begin, IndexType end, Function &function) const |
Method for iteration over all matrix rows for constant instances. | |
template<typename Function > | |
void | forRows (IndexType begin, IndexType end, Function &&function) |
Method for parallel iteration over matrix rows from interval [begin, end) . | |
template<typename Function > | |
void | forRows (IndexType begin, IndexType end, Function &&function) const |
Method for parallel iteration over matrix rows from interval [begin, end) for constant instances. | |
template<typename Vector > | |
void | getCompressedRowLengths (Vector &rowLengths) const |
Computes number of non-zeros in each row. | |
__cuda_callable__ DiagonalOffsetsView | getDiagonalOffsets () |
Returns a view for the vector of diagonal offsets. | |
__cuda_callable__ DiagonalOffsetsView::ConstViewType | getDiagonalOffsets () const |
Returns a view for the vector of diagonal offsets. | |
__cuda_callable__ IndexType | getDiagonalsCount () const |
Returns number of diagonals. | |
__cuda_callable__ RealType | getElement (IndexType row, IndexType column) const |
Returns value of matrix element at position given by its row and column index. | |
__cuda_callable__ IndexerType & | getIndexer () |
This method returns matrix elements indexer used by this matrix. | |
__cuda_callable__ const IndexerType & | getIndexer () const |
This method returns matrix elements indexer used by this matrix. | |
IndexType | getNonzeroElementsCount () const override |
Returns number of non-zero matrix elements. | |
__cuda_callable__ RowView | getRow (IndexType rowIdx) |
Non-constant getter of simple structure for accessing given matrix row. | |
__cuda_callable__ ConstRowView | getRow (IndexType rowIdx) const |
Constant getter of simple structure for accessing given matrix row. | |
template<typename Vector > | |
void | getRowCapacities (Vector &rowCapacities) const |
Compute capacities of all rows. | |
template<typename Real_ , typename Device_ , typename Index_ , ElementsOrganization Organization_> | |
bool | operator!= (const MultidiagonalMatrixBase< Real_, Device_, Index_, Organization_ > &matrix) const |
Comparison operator with another multidiagonal matrix. | |
MultidiagonalMatrixBase & | operator= (const MultidiagonalMatrixBase &)=delete |
Copy-assignment operator. | |
MultidiagonalMatrixBase & | operator= (MultidiagonalMatrixBase &&)=delete |
Move-assignment operator. | |
template<typename Real_ , typename Device_ , typename Index_ , ElementsOrganization Organization_> | |
bool | operator== (const MultidiagonalMatrixBase< Real_, Device_, Index_, Organization_ > &matrix) const |
Comparison operator with another multidiagonal matrix. | |
void | print (std::ostream &str) const |
Method for printing the matrix to output stream. | |
template<typename Fetch , typename Reduce , typename Keep , typename FetchReal > | |
void | reduceAllRows (Fetch &&fetch, const Reduce &reduce, Keep &&keep, const FetchReal &identity) const |
Method for performing general reduction on all matrix rows for constant instances. | |
template<typename Fetch , typename Reduce , typename Keep , typename FetchReal > | |
void | reduceRows (IndexType begin, IndexType end, Fetch &&fetch, const Reduce &reduce, Keep &&keep, const FetchReal &identity) const |
Method for performing general reduction on matrix rows for constant instances. | |
template<typename Function > | |
void | sequentialForAllRows (Function &function) |
This method calls sequentialForRows for all matrix rows. | |
template<typename Function > | |
void | sequentialForAllRows (Function &function) const |
This method calls sequentialForRows for all matrix rows (for constant instances). | |
template<typename Function > | |
void | sequentialForRows (IndexType begin, IndexType end, Function &function) |
Method for sequential iteration over all matrix rows for non-constant instances. | |
template<typename Function > | |
void | sequentialForRows (IndexType begin, IndexType end, Function &function) const |
Method for sequential iteration over all matrix rows for constant instances. | |
__cuda_callable__ void | setElement (IndexType row, IndexType column, const RealType &value) |
Sets element at given row and column to given value. | |
void | setValue (const RealType &value) |
Set all matrix elements to given value. | |
template<typename InVector , typename OutVector > | |
void | vectorProduct (const InVector &inVector, OutVector &outVector, RealType matrixMultiplicator=1.0, RealType outVectorMultiplicator=0.0, IndexType begin=0, IndexType end=0) const |
Computes product of matrix and vector. | |
Public Member Functions inherited from TNL::Matrices::MatrixBase< Real, Device, Index, GeneralMatrix, Organization > | |
__cuda_callable__ | MatrixBase ()=default |
Basic constructor with no parameters. | |
__cuda_callable__ | MatrixBase (const MatrixBase &view)=default |
Shallow copy constructor. | |
__cuda_callable__ | MatrixBase (IndexType rows, IndexType columns, ValuesViewType values) |
Constructor with matrix dimensions and matrix elements values. | |
__cuda_callable__ | MatrixBase (MatrixBase &&view) noexcept=default |
Move constructor. | |
IndexType | getAllocatedElementsCount () const |
Tells the number of allocated matrix elements. | |
__cuda_callable__ IndexType | getColumns () const |
Returns number of matrix columns. | |
__cuda_callable__ IndexType | getRows () const |
Returns number of matrix rows. | |
__cuda_callable__ ValuesViewType & | getValues () |
Returns a reference to a vector with the matrix elements values. | |
__cuda_callable__ const ValuesViewType & | getValues () const |
Returns a constant reference to a vector with the matrix elements values. | |
bool | operator!= (const Matrix &matrix) const |
Comparison operator with another arbitrary matrix view type. | |
bool | operator!= (const MatrixT &matrix) const |
__cuda_callable__ MatrixBase & | operator= (const MatrixBase &)=delete |
Copy-assignment operator. | |
__cuda_callable__ MatrixBase & | operator= (MatrixBase &&)=delete |
Move-assignment operator. | |
bool | operator== (const Matrix &matrix) const |
Comparison operator with another arbitrary matrix view type. | |
bool | operator== (const MatrixT &matrix) const |
Static Public Member Functions | |
static std::string | getSerializationType () |
Returns string with serialization type. | |
Static Public Member Functions inherited from TNL::Matrices::MatrixBase< Real, Device, Index, GeneralMatrix, Organization > | |
static constexpr ElementsOrganization | getOrganization () |
Matrix elements organization getter. | |
static constexpr bool | isBinary () |
Test of binary matrix type. | |
static constexpr bool | isSymmetric () |
Test of symmetric matrix type. | |
Protected Member Functions | |
__cuda_callable__ void | bind (typename Base::ValuesViewType values, DiagonalOffsetsView diagonalOffsets, HostDiagonalOffsetsView hostDiagonalOffsets, IndexerType indexer) |
Re-initializes the internal attributes of the base class. | |
Protected Member Functions inherited from TNL::Matrices::MatrixBase< Real, Device, Index, GeneralMatrix, Organization > | |
__cuda_callable__ void | bind (IndexType rows, IndexType columns, ValuesViewType values) |
Re-initializes the internal attributes of the base class. | |
Protected Attributes | |
DiagonalOffsetsView | diagonalOffsets |
HostDiagonalOffsetsView | hostDiagonalOffsets |
IndexerType | indexer |
Protected Attributes inherited from TNL::Matrices::MatrixBase< Real, Device, Index, GeneralMatrix, Organization > | |
IndexType | columns |
IndexType | rows |
ValuesViewType | values |
A common base class for MultidiagonalMatrix and MultidiagonalMatrixView.
Real | is a type of matrix elements. |
Device | is a device where the matrix is allocated. |
Index | is a type for indexing of the matrix elements. |
Organization | tells the ordering of matrix elements. It is either RowMajorOrder or ColumnMajorOrder. |
using TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::DiagonalOffsetsView |
using TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::HostDiagonalOffsetsView |
__cuda_callable__ TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::MultidiagonalMatrixBase | ( | typename Base::ValuesViewType | values, |
DiagonalOffsetsView | diagonalOffsets, | ||
HostDiagonalOffsetsView | hostDiagonalOffsets, | ||
IndexerType | indexer ) |
Constructor with all necessary data and views.
values | is a vector view with matrix elements values |
diagonalOffsets | is a vector view with diagonals offsets |
hostDiagonalOffsets | is a vector view with a copy of diagonals offsets on the host |
indexer | is an indexer of matrix elements |
__cuda_callable__ void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::addElement | ( | IndexType | row, |
IndexType | column, | ||
const RealType & | value, | ||
const RealType & | thisElementMultiplicator = 1.0 ) |
Add element at given row and column to given value.
This method can be called from the host system (CPU) no matter where the matrix is allocated. If the matrix is allocated on GPU this method can be called even from device kernels. If the matrix is allocated in GPU device this method is called from CPU, it transfers values of each matrix element separately and so the performance is very low. For higher performance see. MultidiagonalMatrix::getRow or MultidiagonalMatrix::forElements and MultidiagonalMatrix::forAllElements. The call may fail if the matrix row capacity is exhausted.
row | is row index of the element. |
column | is columns index of the element. |
value | is the value the element will be set to. |
thisElementMultiplicator | is multiplicator the original matrix element value is multiplied by before addition of given value. |
|
protected |
Re-initializes the internal attributes of the base class.
Note that this function is protected to ensure that the user cannot modify the base class of a matrix. For the same reason, in future code development we also need to make sure that all non-const functions in the base class return by value and not by reference.
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::forAllElements | ( | Function & | function | ) |
This method calls forElements for all matrix rows.
See MultidiagonalMatrix::forElements.
Function | is a type of lambda function that will operate on matrix elements. |
function | is an instance of the lambda function to be called in each row. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::forAllElements | ( | Function & | function | ) | const |
This method calls forElements for all matrix rows (for constant instances).
See MultidiagonalMatrix::forElements.
Function | is a type of lambda function that will operate on matrix elements. |
function | is an instance of the lambda function to be called in each row. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::forAllRows | ( | Function && | function | ) |
Method for parallel iteration over all matrix rows.
In each row, given lambda function is performed. Each row is processed by at most one thread unlike the method MultidiagonalMatrixBase::forAllElements where more than one thread can be mapped to each row.
Function | is type of the lambda function. |
function | is an instance of the lambda function to be called for each row. |
RowView represents matrix row - see TNL::Matrices::MultidiagonalMatrixBase::RowView.
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::forAllRows | ( | Function && | function | ) | const |
Method for parallel iteration over all matrix rows for constant instances.
In each row, given lambda function is performed. Each row is processed by at most one thread unlike the method MultidiagonalMatrixBase::forAllElements where more than one thread can be mapped to each row.
Function | is type of the lambda function. |
function | is an instance of the lambda function to be called for each row. |
ConstRowView represents matrix row - see TNL::Matrices::MultidiagonalMatrixBase::ConstRowView.
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::forElements | ( | IndexType | begin, |
IndexType | end, | ||
Function & | function ) |
Method for iteration over all matrix rows for non-constant instances.
Function | is type of lambda function that will operate on matrix elements. It should have form like |
where
rowIdx is an index of the matrix row.
localIdx parameter is a rank of the non-zero element in given row. It is also, in fact, index of the matrix subdiagonal.
columnIdx is a column index of the matrix element.
value is a reference to the matrix element value. It can be used even for changing the matrix element value.
begin | defines beginning of the range [begin, end) of rows to be processed. |
end | defines ending of the range [begin, end) of rows to be processed. |
function | is an instance of the lambda function to be called in each row. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::forElements | ( | IndexType | begin, |
IndexType | end, | ||
Function & | function ) const |
Method for iteration over all matrix rows for constant instances.
Function | is type of lambda function that will operate on matrix elements. It should have form like |
where
rowIdx is an index of the matrix row.
localIdx parameter is a rank of the non-zero element in given row. It is also, in fact, index of the matrix subdiagonal.
columnIdx is a column index of the matrix element.
value is the matrix element value.
begin | defines beginning of the range [begin, end) of rows to be processed. |
end | defines ending of the range [begin, end) of rows to be processed. |
function | is an instance of the lambda function to be called in each row. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::forRows | ( | IndexType | begin, |
IndexType | end, | ||
Function && | function ) |
Method for parallel iteration over matrix rows from interval [begin, end)
.
In each row, given lambda function is performed. Each row is processed by at most one thread unlike the method MultidiagonalMatrixBase::forElements where more than one thread can be mapped to each row.
Function | is type of the lambda function. |
begin | defines beginning of the range [begin, end) of rows to be processed. |
end | defines ending of the range [begin, end) of rows to be processed. |
function | is an instance of the lambda function to be called for each row. |
RowView represents matrix row - see TNL::Matrices::MultidiagonalMatrixBase::RowView.
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::forRows | ( | IndexType | begin, |
IndexType | end, | ||
Function && | function ) const |
Method for parallel iteration over matrix rows from interval [begin, end)
for constant instances.
In each row, given lambda function is performed. Each row is processed by at most one thread unlike the method MultidiagonalMatrixBase::forElements where more than one thread can be mapped to each row.
Function | is type of the lambda function. |
begin | defines beginning of the range [begin, end) of rows to be processed. |
end | defines ending of the range [begin, end) of rows to be processed. |
function | is an instance of the lambda function to be called for each row. |
ConstRowView represents matrix row - see TNL::Matrices::MultidiagonalMatrixBase::ConstRowView.
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::getCompressedRowLengths | ( | Vector & | rowLengths | ) | const |
Computes number of non-zeros in each row.
rowLengths | is a vector into which the number of non-zeros in each row will be stored. |
|
nodiscard |
Returns number of diagonals.
|
nodiscard |
Returns value of matrix element at position given by its row and column index.
This method can be called from the host system (CPU) no matter where the matrix is allocated. If the matrix is allocated on GPU this method can be called even from device kernels. If the matrix is allocated in GPU device this method is called from CPU, it transfers values of each matrix element separately and so the performance is very low. For higher performance see. MultidiagonalMatrix::getRow or MultidiagonalMatrix::forElements and MultidiagonalMatrix::forAllElements.
row | is a row index of the matrix element. |
column | i a column index of the matrix element. |
|
nodiscard |
This method returns matrix elements indexer used by this matrix.
|
nodiscard |
This method returns matrix elements indexer used by this matrix.
|
nodiscardoverridevirtual |
Returns number of non-zero matrix elements.
This method really counts the non-zero matrix elements and so it returns zero for matrix having all allocated elements set to zero.
Reimplemented from TNL::Matrices::MatrixBase< Real, Device, Index, GeneralMatrix, Organization >.
|
nodiscard |
Non-constant getter of simple structure for accessing given matrix row.
rowIdx | is matrix row index. |
|
nodiscard |
Constant getter of simple structure for accessing given matrix row.
rowIdx | is matrix row index. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::getRowCapacities | ( | Vector & | rowCapacities | ) | const |
Compute capacities of all rows.
The row capacities are not stored explicitly and must be computed.
rowCapacities | is a vector where the row capacities will be stored. |
|
staticnodiscard |
Returns string with serialization type.
The string has a form Matrices::MultidiagonalMatrix< RealType, [any_device], IndexType, Organization, [any_allocator], [any_allocator] >
.
See MultidiagonalMatrix::getSerializationType.
|
nodiscard |
Comparison operator with another multidiagonal matrix.
Real_ | is Real type of the source matrix. |
Device_ | is Device type of the source matrix. |
Index_ | is Index type of the source matrix. |
Organization_ | is Organization of the source matrix. |
matrix | is the source matrix view. |
|
delete |
Copy-assignment operator.
It is a deleted function, because matrix assignment in general requires reallocation.
|
nodiscard |
Comparison operator with another multidiagonal matrix.
Real_ | is Real type of the source matrix. |
Device_ | is Device type of the source matrix. |
Index_ | is Index type of the source matrix. |
Organization_ | is Organization of the source matrix. |
matrix | is the source matrix view. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::print | ( | std::ostream & | str | ) | const |
Method for printing the matrix to output stream.
str | is the output stream. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::reduceAllRows | ( | Fetch && | fetch, |
const Reduce & | reduce, | ||
Keep && | keep, | ||
const FetchReal & | identity ) const |
Method for performing general reduction on all matrix rows for constant instances.
Fetch | is a type of lambda function for data fetch declared as |
The return type of this lambda can be any non void.
Reduce | is a type of lambda function for reduction declared as |
Keep | is a type of lambda function for storing results of reduction in each row. It is declared as |
FetchValue | is type returned by the Fetch lambda function. |
fetch | is an instance of lambda function for data fetch. |
reduce | is an instance of lambda function for reduction. |
keep | in an instance of lambda function for storing results. |
identity | is the identity element for the reduction operation, i.e. element which does not change the result of the reduction. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::reduceRows | ( | IndexType | begin, |
IndexType | end, | ||
Fetch && | fetch, | ||
const Reduce & | reduce, | ||
Keep && | keep, | ||
const FetchReal & | identity ) const |
Method for performing general reduction on matrix rows for constant instances.
Fetch | is a type of lambda function for data fetch declared as |
The return type of this lambda can be any non void.
Reduce | is a type of lambda function for reduction declared as |
Keep | is a type of lambda function for storing results of reduction in each row. It is declared as |
FetchValue | is type returned by the Fetch lambda function. |
begin | defines beginning of the range [begin, end) of rows to be processed. |
end | defines ending of the range [begin, end) of rows to be processed. |
fetch | is an instance of lambda function for data fetch. |
reduce | is an instance of lambda function for reduction. |
keep | in an instance of lambda function for storing results. |
identity | is the identity element for the reduction operation, i.e. element which does not change the result of the reduction. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::sequentialForAllRows | ( | Function & | function | ) |
This method calls sequentialForRows for all matrix rows.
See MultidiagonalMatrixBase::sequentialForAllRows.
Function | is a type of lambda function that will operate on matrix elements. |
function | is an instance of the lambda function to be called in each row. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::sequentialForAllRows | ( | Function & | function | ) | const |
This method calls sequentialForRows for all matrix rows (for constant instances).
See MultidiagonalMatrixBase::sequentialForRows.
Function | is a type of lambda function that will operate on matrix elements. |
function | is an instance of the lambda function to be called in each row. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::sequentialForRows | ( | IndexType | begin, |
IndexType | end, | ||
Function & | function ) |
Method for sequential iteration over all matrix rows for non-constant instances.
Function | is type of lambda function that will operate on matrix elements. It should have form like |
RowView represents matrix row - see TNL::Matrices::MultidiagonalMatrixBase::RowView.
begin | defines beginning of the range [begin, end) of rows to be processed. |
end | defines ending of the range [begin, end) of rows to be processed. |
function | is an instance of the lambda function to be called in each row. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::sequentialForRows | ( | IndexType | begin, |
IndexType | end, | ||
Function & | function ) const |
Method for sequential iteration over all matrix rows for constant instances.
Function | is type of lambda function that will operate on matrix elements. It should have form like |
ConstRowView represents matrix row - see TNL::Matrices::MultidiagonalMatrixBase::ConstRowView.
begin | defines beginning of the range [begin, end) of rows to be processed. |
end | defines ending of the range [begin, end) of rows to be processed. |
function | is an instance of the lambda function to be called in each row. |
__cuda_callable__ void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::setElement | ( | IndexType | row, |
IndexType | column, | ||
const RealType & | value ) |
Sets element at given row and column to given value.
This method can be called from the host system (CPU) no matter where the matrix is allocated. If the matrix is allocated on GPU this method can be called even from device kernels. If the matrix is allocated in GPU device this method is called from CPU, it transfers values of each matrix element separately and so the performance is very low. For higher performance see. MultidiagonalMatrix::getRow or MultidiagonalMatrix::forElements and MultidiagonalMatrix::forAllElements. The call may fail if the matrix row capacity is exhausted.
row | is row index of the element. |
column | is columns index of the element. |
value | is the value the element will be set to. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::setValue | ( | const RealType & | value | ) |
Set all matrix elements to given value.
value | is the new value of all matrix elements. |
void TNL::Matrices::MultidiagonalMatrixBase< Real, Device, Index, Organization >::vectorProduct | ( | const InVector & | inVector, |
OutVector & | outVector, | ||
RealType | matrixMultiplicator = 1.0, | ||
RealType | outVectorMultiplicator = 0.0, | ||
IndexType | begin = 0, | ||
IndexType | end = 0 ) const |
Computes product of matrix and vector.
More precisely, it computes:
InVector | is type of input vector. It can be TNL::Containers::Vector, TNL::Containers::VectorView, TNL::Containers::Array, TNL::Containers::ArrayView, or similar container. |
OutVector | is type of output vector. It can be TNL::Containers::Vector, TNL::Containers::VectorView, TNL::Containers::Array, TNL::Containers::ArrayView, or similar container. |
inVector | is input vector. |
outVector | is output vector. |
matrixMultiplicator | is a factor by which the matrix is multiplied. It is one by default. |
outVectorMultiplicator | is a factor by which the outVector is multiplied before added to the result of matrix-vector product. It is zero by default. |
begin | is the beginning of the rows range for which the vector product is computed. It is zero by default. |
end | is the end of the rows range for which the vector product is computed. It is number if the matrix rows by default. |