Implementation of dense matrix, i.e. matrix storing explicitly all of its elements including zeros.
More...
|
| DenseMatrix (const DenseMatrix &matrix) |
| Copy constructor.
|
|
| DenseMatrix (const RealAllocatorType &allocator=RealAllocatorType()) |
| Constructor only with values allocator.
|
|
| DenseMatrix (DenseMatrix &&matrix) noexcept=default |
| Move constructor.
|
|
| DenseMatrix (Index rows, Index columns, const RealAllocatorType &allocator=RealAllocatorType()) |
| Constructor with matrix dimensions.
|
|
template<typename Value > |
| DenseMatrix (std::initializer_list< std::initializer_list< Value > > data, const RealAllocatorType &allocator=RealAllocatorType()) |
| Constructor with 2D initializer list.
|
|
ConstViewType | getConstView () const |
| Returns a non-modifiable view of the dense matrix.
|
|
template<typename Matrix1 , typename Matrix2 , int tileDim = 32> |
void | getMatrixProduct (const Matrix1 &matrix1, const Matrix2 &matrix2, Real matrixMultiplicator=1.0) |
|
template<typename Matrix , int tileDim = 32> |
void | getTransposition (const Matrix &matrix, Real matrixMultiplicator=1.0) |
|
ViewType | getView () |
| Returns a modifiable view of the dense matrix.
|
|
void | load (const String &fileName) |
| Method for loading the matrix from the file with given filename.
|
|
void | load (File &file) override |
| Method for loading the matrix from a file.
|
|
DenseMatrix & | operator= (const DenseMatrix &matrix) |
| Copy-assignment of exactly the same matrix type.
|
|
template<typename Real , typename Device , typename Index , ElementsOrganization Organization, typename RealAllocator > |
DenseMatrix< Real, Device, Index, Organization, RealAllocator > & | operator= (const DenseMatrix< Real, Device, Index, Organization, RealAllocator > &matrix) |
|
template<typename RHSReal , typename RHSDevice , typename RHSIndex , typename RHSRealAllocator > |
DenseMatrix & | operator= (const DenseMatrix< RHSReal, RHSDevice, RHSIndex, Organization, RHSRealAllocator > &matrix) |
| Assignment operator with the same organization.
|
|
template<typename RHSReal , typename RHSDevice , typename RHSIndex , typename RHSRealAllocator > |
DenseMatrix< Real, Device, Index, Organization, RealAllocator > & | operator= (const DenseMatrix< RHSReal, RHSDevice, RHSIndex, Organization, RHSRealAllocator > &matrix) |
|
template<typename RHSReal , typename RHSDevice , typename RHSIndex , ElementsOrganization RHSOrganization, typename RHSRealAllocator > |
DenseMatrix & | operator= (const DenseMatrix< RHSReal, RHSDevice, RHSIndex, RHSOrganization, RHSRealAllocator > &matrix) |
| Assignment operator with other dense matrices.
|
|
template<typename RHSReal , typename RHSDevice , typename RHSIndex , ElementsOrganization RHSOrganization, typename RHSRealAllocator > |
DenseMatrix< Real, Device, Index, Organization, RealAllocator > & | operator= (const DenseMatrix< RHSReal, RHSDevice, RHSIndex, RHSOrganization, RHSRealAllocator > &matrix) |
|
template<typename RHSReal , typename RHSDevice , typename RHSIndex > |
DenseMatrix & | operator= (const DenseMatrixView< RHSReal, RHSDevice, RHSIndex, Organization > &matrix) |
| Assignment operator with matrix view having the same elements organization.
|
|
template<typename RHSReal , typename RHSDevice , typename RHSIndex > |
DenseMatrix< Real, Device, Index, Organization, RealAllocator > & | operator= (const DenseMatrixView< RHSReal, RHSDevice, RHSIndex, Organization > &matrix) |
|
template<typename RHSReal , typename RHSDevice , typename RHSIndex , ElementsOrganization RHSOrganization> |
DenseMatrix & | operator= (const DenseMatrixView< RHSReal, RHSDevice, RHSIndex, RHSOrganization > &matrix) |
| Assignment operator with other dense matrices.
|
|
template<typename RHSReal , typename RHSDevice , typename RHSIndex , ElementsOrganization RHSOrganization> |
DenseMatrix< Real, Device, Index, Organization, RealAllocator > & | operator= (const DenseMatrixView< RHSReal, RHSDevice, RHSIndex, RHSOrganization > &matrix) |
|
template<typename RHSMatrix > |
DenseMatrix & | operator= (const RHSMatrix &matrix) |
| Assignment operator with other (sparse) types of matrices.
|
|
template<typename RHSMatrix > |
DenseMatrix< Real, Device, Index, Organization, RealAllocator > & | operator= (const RHSMatrix &matrix) |
|
DenseMatrix & | operator= (DenseMatrix &&matrix) noexcept(false) |
| Move-assignment of exactly the same matrix type.
|
|
template<typename Real , typename Device , typename Index , ElementsOrganization Organization, typename RealAllocator > |
DenseMatrix< Real, Device, Index, Organization, RealAllocator > & | operator= (DenseMatrix< Real, Device, Index, Organization, RealAllocator > &&matrix) noexcept(false) |
|
void | reset () |
| Resets the matrix to zero dimensions.
|
|
void | save (const String &fileName) const |
| Method for saving the matrix to the file with given filename.
|
|
void | save (File &file) const override |
| Method for saving the matrix to a file.
|
|
void | setDimensions (Index rows, Index columns) |
| Set number of rows and columns of this matrix.
|
|
template<typename MapIndex , typename MapValue > |
void | setElements (const std::map< std::pair< MapIndex, MapIndex >, MapValue > &map) |
| This method sets the dense matrix elements from std::map.
|
|
template<typename Value > |
void | setElements (std::initializer_list< std::initializer_list< Value > > data) |
| This method recreates the dense matrix from 2D initializer list.
|
|
template<typename Matrix > |
void | setLike (const Matrix &matrix) |
| Set the number of matrix rows and columns by the given matrix.
|
|
template<typename Matrix_ > |
void | setLike (const Matrix_ &matrix) |
|
template<typename RowCapacitiesVector > |
void | setRowCapacities (const RowCapacitiesVector &rowCapacities) |
| This method is only for the compatibility with the sparse matrices.
|
|
virtual | ~Object ()=default |
| Destructor.
|
|
virtual std::string | getSerializationTypeVirtual () const |
|
void | load (const String &fileName) |
| Method for restoring the object from a file.
|
|
void | save (const String &fileName) const |
| Method for saving the object to a file as a binary data.
|
|
__cuda_callable__ | DenseMatrixBase ()=default |
| Constructor without parameters.
|
|
__cuda_callable__ | DenseMatrixBase (const DenseMatrixBase &matrix)=default |
| Copy constructor.
|
|
__cuda_callable__ | DenseMatrixBase (DenseMatrixBase &&matrix) noexcept=default |
| Move constructor.
|
|
__cuda_callable__ | DenseMatrixBase (IndexType rows, IndexType columns, typename Base::ValuesViewType values) |
| Constructor with matrix dimensions and values.
|
|
__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 Matrix > |
void | addMatrix (const Matrix &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.
|
|
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__ Real | getElement (IndexType row, IndexType column) const |
| Returns value of matrix element at position given by its row and column index.
|
|
__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_ > |
bool | operator!= (const DenseMatrixBase< Real_, Device_, Index_, Organization > &matrix) const |
| Comparison operator with another dense matrix view.
|
|
__cuda_callable__ Real & | operator() (IndexType row, IndexType column) |
| Returns non-constant reference to element at row row and column column.
|
|
__cuda_callable__ const Real & | operator() (IndexType row, IndexType column) const |
| Returns constant reference to element at row row and column column.
|
|
DenseMatrixBase & | operator= (const DenseMatrixBase &)=delete |
| Copy-assignment operator.
|
|
DenseMatrixBase & | operator= (DenseMatrixBase &&)=delete |
| Move-assignment operator.
|
|
template<typename Real_ , typename Device_ , typename Index_ > |
bool | operator== (const DenseMatrixBase< Real_, Device_, Index_, Organization > &matrix) const |
| Comparison operator with another dense matrix view.
|
|
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 Fetch , typename Reduce , typename Keep , typename FetchValue > |
void | reduceRows (IndexType begin, IndexType end, Fetch &fetch, const Reduce &reduce, Keep &keep, const FetchValue &identity) const |
|
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 &v) |
| Sets all matrix elements to value v.
|
|
template<typename InVector , typename OutVector > |
void | vectorProduct (const InVector &inVector, OutVector &outVector, const RealType &matrixMultiplicator=1.0, const RealType &outVectorMultiplicator=0.0, IndexType begin=0, IndexType end=0) const |
| Computes product of matrix and vector.
|
|
__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.
|
|
virtual IndexType | getNonzeroElementsCount () const |
| Computes a current number of nonzero matrix elements.
|
|
__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 |
|