Loading...
Searching...
No Matches
MatrixCSR.hpp
Go to the documentation of this file.
MatrixCSR< U > CastTo() const
Type-casts to different value-typed matrix.
Definition MatrixCSR-Impl.hpp:828
bool IsEqual(const MatrixCSR &other) const
Definition MatrixCSR-Impl.hpp:323
typename NonZeroContainerType::const_iterator ConstNonZeroIterator
Definition MatrixCSR.hpp:89
MatrixCSR RSub(const T &s) const
Returns input scalar - this matrix.
Definition MatrixCSR-Impl.hpp:624
T AbsMax() const
Returns absolute maximum among all elements.
Definition MatrixCSR-Impl.hpp:789
IndexContainerType::iterator IndexIterator
Definition MatrixCSR.hpp:92
IndexContainerType::const_iterator ConstIndexIterator
Definition MatrixCSR.hpp:93
MatrixCSR Add(const T &s) const
Returns this matrix + input scalar.
Definition MatrixCSR-Impl.hpp:548
void AddElement(size_t i, size_t j, const T &value)
Adds non-zero element to (i, j).
Definition MatrixCSR-Impl.hpp:235
void IAdd(const T &s)
Adds input scalar to this matrix.
Definition MatrixCSR-Impl.hpp:658
void Set(const T &s)
Sets whole matrix with input scalar.
Definition MatrixCSR-Impl.hpp:143
IndexIterator RowPointersBegin()
Returns the begin iterator of the row pointers.
Definition MatrixCSR-Impl.hpp:499
size_t NumberOfNonZeros() const
Returns the number of non-zero elements.
Definition MatrixCSR-Impl.hpp:421
size_t GetRows() const
Returns number of rows of this matrix.
Definition MatrixCSR-Impl.hpp:409
const size_t & RowPointer(size_t i) const
Returns i-th row pointer.
Definition MatrixCSR-Impl.hpp:439
IndexIterator ColumnIndicesEnd()
Returns the end iterator of the column indices.
Definition MatrixCSR-Impl.hpp:536
const T & NonZero(size_t i) const
Returns i-th non-zero element.
Definition MatrixCSR-Impl.hpp:427
void Compress(const std::initializer_list< std::initializer_list< T > > &lst, T epsilon=std::numeric_limits< T >::epsilon())
Compresses given initializer list lst into a sparse matrix.
Definition MatrixCSR-Impl.hpp:167
std::vector< T > NonZeroContainerType
Definition MatrixCSR.hpp:87
MatrixCSR & operator=(const MatrixExpression< T, R, C, ME > &m)
Compresses input (dense) matrix expression into a sparse matrix.
void IDiv(const T &s)
Divides this matrix with input scalar.
Definition MatrixCSR-Impl.hpp:700
T operator()(size_t i, size_t j) const
Returns (i,j) element.
Definition MatrixCSR-Impl.hpp:915
MatrixCSR & operator/=(const T &s)
Division assignment with input scalar.
Definition MatrixCSR-Impl.hpp:907
bool IsSquare() const
Returns true if this matrix is a square matrix.
Definition MatrixCSR-Impl.hpp:397
MatrixCSR & operator*=(const T &s)
Multiplication assignment with input scalar.
Definition MatrixCSR-Impl.hpp:890
const size_t * RowPointersData() const
Returns constant pointer of the row pointers data.
Definition MatrixCSR-Impl.hpp:463
T * NonZeroData()
Returns pointer of the non-zero elements data.
Definition MatrixCSR-Impl.hpp:451
bool operator==(const MatrixCSR &m) const
Returns true if is equal to m.
Definition MatrixCSR-Impl.hpp:928
NonZeroIterator NonZeroBegin()
Returns the begin iterator of the non-zero elements.
Definition MatrixCSR-Impl.hpp:475
const size_t & ColumnIndex(size_t i) const
Returns i-th column index.
Definition MatrixCSR-Impl.hpp:445
MatrixCSR(const MatrixExpression< T, R, C, E > &other, T epsilon=std::numeric_limits< T >::epsilon())
Compresses input (dense) matrix expression into a sparse matrix.
static MatrixCSR< T > MakeIdentity(size_t m)
Definition MatrixCSR-Impl.hpp:940
void AddRow(const NonZeroContainerType &nonZeros, const IndexContainerType &columnIndices)
Definition MatrixCSR-Impl.hpp:273
void Clear()
Clears the matrix and make it zero-dimensional.
Definition MatrixCSR-Impl.hpp:133
void IMul(const T &s)
Multiplies input scalar to this matrix.
Definition MatrixCSR-Impl.hpp:684
MatrixCSR()
Constructs an empty matrix.
Definition MatrixCSR-Impl.hpp:77
T Min() const
Returns minimum among all elements.
Definition MatrixCSR-Impl.hpp:731
bool operator!=(const MatrixCSR &m) const
Returns true if is not equal to m.
Definition MatrixCSR-Impl.hpp:934
bool IsSimilar(const MatrixCSR &other, double tol=std::numeric_limits< double >::epsilon()) const
Definition MatrixCSR-Impl.hpp:360
IndexIterator ColumnIndicesBegin()
Returns the begin iterator of the column indices.
Definition MatrixCSR-Impl.hpp:523
T AbsMin() const
Returns absolute minimum among all elements.
Definition MatrixCSR-Impl.hpp:771
Vector2UZ Size() const
Returns the size of this matrix.
Definition MatrixCSR-Impl.hpp:403
MatrixCSR Sub(const T &s) const
Returns this matrix - input scalar.
Definition MatrixCSR-Impl.hpp:565
T Avg() const
Returns average of all elements.
Definition MatrixCSR-Impl.hpp:725
void SetElement(size_t i, size_t j, const T &value)
Sets non-zero element to (i, j).
Definition MatrixCSR-Impl.hpp:303
MatrixCSR Div(const T &s) const
Returns this matrix / input scalar.
Definition MatrixCSR-Impl.hpp:601
size_t GetCols() const
Returns number of columns of this matrix.
Definition MatrixCSR-Impl.hpp:415
std::vector< size_t > IndexContainerType
Definition MatrixCSR.hpp:91
MatrixCSR & operator*=(const MatrixExpression< T, R, C, ME > &m)
Multiplication assignment with input matrix.
T Max() const
Returns maximum among all elements.
Definition MatrixCSR-Impl.hpp:751
MatrixCSR RMul(const T &s) const
Returns input scalar * this matrix.
Definition MatrixCSR-Impl.hpp:641
MatrixCSR RAdd(const T &s) const
Returns input scalar + this matrix.
Definition MatrixCSR-Impl.hpp:612
const size_t * ColumnIndicesData() const
Returns constant pointer of the column indices data.
Definition MatrixCSR-Impl.hpp:469
void ISub(const T &s)
Subtracts input scalar from this matrix.
Definition MatrixCSR-Impl.hpp:671
IndexIterator RowPointersEnd()
Returns the end iterator of the row pointers.
Definition MatrixCSR-Impl.hpp:511
MatrixCSR RDiv(const T &s) const
Returns input matrix / this scalar.
Definition MatrixCSR-Impl.hpp:647
NonZeroIterator NonZeroEnd()
Returns the end iterator of the non-zero elements.
Definition MatrixCSR-Impl.hpp:487
MatrixCSR & operator=(const MatrixCSR &other)
Copies to this matrix.
Definition MatrixCSR-Impl.hpp:113
MatrixCSR & operator-=(const T &s)
Subtraction assignment with input scalar.
Definition MatrixCSR-Impl.hpp:874
void Reserve(size_t rows, size_t cols, size_t numNonZeros)
Reserves memory space of this matrix.
Definition MatrixCSR-Impl.hpp:158
typename NonZeroContainerType::iterator NonZeroIterator
Definition MatrixCSR.hpp:88
MatrixCSR & operator+=(const T &s)
Addition assignment with input scalar.
Definition MatrixCSR-Impl.hpp:858
MatrixCSR Mul(const T &s) const
Returns this matrix * input scalar.
Definition MatrixCSR-Impl.hpp:582
Matrix expression for CSR matrix-matrix multiplication.
Definition MatrixCSR.hpp:35
size_t GetCols() const
Number of columns.
Definition MatrixCSR-Impl.hpp:41
T operator()(size_t i, size_t j) const
Returns matrix element at (i, j).
Definition MatrixCSR-Impl.hpp:47
size_t GetRows() const
Number of rows.
Definition MatrixCSR-Impl.hpp:35
Definition Matrix.hpp:30
Definition pybind11Utils.hpp:21
MatrixCSR< double > MatrixCSRD
Double-type CSR matrix.
Definition MatrixCSR.hpp:448
MatrixCSR< float > MatrixCSRF
Float-type CSR matrix.
Definition MatrixCSR.hpp:445
Definition MatrixCSR.hpp:77
1.9.8