MatrixMxN-Impl.h
Go to the documentation of this file.
853 ParallelFor(ZERO_SIZE, Cols(), ZERO_SIZE, Rows(), [&](size_t j, size_t i) { func((*this)(i, j)); });
T & operator[](size_t i)
Returns reference of i-th element.
Definition: MatrixMxN-Impl.h:786
MatrixMxN & operator*=(const T &s)
Multiplication assignment with input scalar.
Definition: MatrixMxN-Impl.h:764
T Min() const
Returns minimum among all elements.
Definition: MatrixMxN-Impl.h:500
void IDiv(const T &s)
Divides this matrix with input scalar.
Definition: MatrixMxN-Impl.h:388
static MatrixConstant< T > MakeZero(size_t m, size_t n)
Makes a m x n matrix with zeros.
Definition: MatrixMxN-Impl.h:865
bool IsEqual(const MatrixExpression< T, E > &other) const
Definition: MatrixMxN-Impl.h:144
T AbsMin(T x, T y)
Returns the absolute minimum value among the two inputs.
Definition: MathUtils-Impl.h:39
MatrixMxN Transposed() const
Returns transposed matrix.
Definition: MatrixMxN-Impl.h:689
bool IsSquare() const
Returns true if this matrix is a square matrix.
Definition: MatrixMxN-Impl.h:191
MatrixMxN & operator/=(const T &s)
Division assignment with input scalar.
Definition: MatrixMxN-Impl.h:779
MatrixScalarAdd< T, MatrixMxN > Add(const T &s) const
Returns this matrix + input scalar.
Definition: MatrixMxN-Impl.h:251
void ISub(const T &s)
Subtracts input scalar from this matrix.
Definition: MatrixMxN-Impl.h:361
MatrixScalarDiv< T, MatrixMxN > Div(const T &s) const
Returns this matrix / input scalar.
Definition: MatrixMxN-Impl.h:297
bool operator!=(const MatrixExpression< T, E > &m) const
Returns true if is not equal to m.
Definition: MatrixMxN-Impl.h:818
Matrix expression for matrix-scalar binary operation.
Definition: MatrixExpression.h:261
MatrixScalarRDiv< T, MatrixMxN > RDiv(const T &s) const
Returns input matrix / this scalar.
Definition: MatrixMxN-Impl.h:342
T * data()
Returns data pointer of this matrix.
Definition: MatrixMxN-Impl.h:215
MatrixDiagonal< T, MatrixMxN > OffDiagonal() const
Returns off-diagonal part of this matrix.
Definition: MatrixMxN-Impl.h:659
MatrixMxN()
Constructs an empty matrix.
Definition: MatrixMxN-Impl.h:16
Iterator end()
Returns the end iterator of the matrix.
Definition: MatrixMxN-Impl.h:239
Iterator begin()
Returns the begin iterator of the matrix.
Definition: MatrixMxN-Impl.h:227
Vector expression for matrix-vector multiplication.
Definition: MatrixExpression.h:296
void ForEach(Callback func) const
Iterates the matrix and invoke given func for each index.
Definition: MatrixMxN-Impl.h:825
MatrixScalarMul< T, MatrixMxN > Mul(const T &s) const
Returns this matrix * input scalar.
Definition: MatrixMxN-Impl.h:277
MatrixScalarRSub< T, MatrixMxN > RSub(const T &s) const
Returns input scalar - this matrix.
Definition: MatrixMxN-Impl.h:316
MatrixDiagonal< T, MatrixMxN > Diagonal() const
Returns diagonal part of this matrix.
Definition: MatrixMxN-Impl.h:653
MatrixTriangular< T, MatrixMxN > StrictLowerTri() const
Returns strictly lower triangle part of this matrix.
Definition: MatrixMxN-Impl.h:665
MatrixMxN & operator+=(const T &s)
Addition assignment with input scalar.
Definition: MatrixMxN-Impl.h:734
MatrixScalarAdd< T, MatrixMxN > RAdd(const T &s) const
Returns input scalar + this matrix.
Definition: MatrixMxN-Impl.h:303
MatrixMxN Inverse() const
Returns inverse matrix.
Definition: MatrixMxN-Impl.h:697
size_t Cols() const
Returns number of columns of this matrix.
Definition: MatrixMxN-Impl.h:209
void IAdd(const T &s)
Adds input scalar to this matrix.
Definition: MatrixMxN-Impl.h:348
MatrixTriangular< T, MatrixMxN > UpperTri() const
Returns upper triangle part of this matrix (including the diagonal).
Definition: MatrixMxN-Impl.h:683
void Resize(size_t m, size_t n, const T &s=T(0))
Resizes to m x n matrix with initial value s.
Definition: MatrixMxN-Impl.h:59
Definition: pybind11Utils.h:24
void ParallelFor(IndexType beginIndex, IndexType endIndex, const Function &function, ExecutionPolicy policy)
Makes a for-loop from beginIndex to endIndex in parallel.
Definition: Parallel-Impl.h:201
MatrixTypeCast< U, MatrixMxN, T > CastTo() const
Type-casts to different value-typed matrix.
static MatrixIdentity< T > MakeIdentity(size_t m)
Makes a m x m matrix with all diagonal elements to 1, and other elements to 0.
Definition: MatrixMxN-Impl.h:871
T Avg() const
Returns average of all elements.
Definition: MatrixMxN-Impl.h:494
Size2 size() const
Returns the size of this matrix.
Definition: MatrixMxN-Impl.h:197
Size2 size() const
Size of the matrix.
Definition: MatrixExpression-Impl.h:16
MatrixScalarMul< T, MatrixMxN > RMul(const T &s) const
Returns input scalar * this matrix.
Definition: MatrixMxN-Impl.h:329
T AbsMin() const
Returns absolute minimum among all elements.
Definition: MatrixMxN-Impl.h:538
void IMul(const T &s)
Multiplies input scalar to this matrix.
Definition: MatrixMxN-Impl.h:374
T Determinant() const
Returns determinant of this matrix.
Definition: MatrixMxN-Impl.h:589
size_t Rows() const
Number of rows.
Definition: MatrixExpression-Impl.h:22
void Set(const T &s)
Sets whole matrix with input scalar.
Definition: MatrixMxN-Impl.h:66
size_t size() const
Size of the vector.
Definition: VectorExpression-Impl.h:18
const MatrixMxN< T > & operator()() const
Returns actual implementation (the subclass).
Definition: MatrixExpression-Impl.h:34
void SetOffDiagonal(const T &s)
Sets off-diagonal elements with input scalar.
Definition: MatrixMxN-Impl.h:111
bool IsSimilar(const MatrixExpression< T, E > &other, double tol=std::numeric_limits< double >::epsilon()) const
Definition: MatrixMxN-Impl.h:168
T Max() const
Returns maximum among all elements.
Definition: MatrixMxN-Impl.h:519
void ParallelForEach(Callback func)
Iterates the matrix and invoke given func for each index in parallel.
Definition: MatrixMxN-Impl.h:851
void ForEachIndex(Callback func) const
Iterates the matrix and invoke given func for each index.
Definition: MatrixMxN-Impl.h:838
MatrixTriangular< T, MatrixMxN > LowerTri() const
Returns lower triangle part of this matrix (including the diagonal).
Definition: MatrixMxN-Impl.h:677
MatrixScalarSub< T, MatrixMxN > Sub(const T &s) const
Returns this matrix - input scalar.
Definition: MatrixMxN-Impl.h:264
MatrixMxN & operator-=(const T &s)
Subtraction assignment with input scalar.
Definition: MatrixMxN-Impl.h:749
void Transpose()
Transposes this matrix.
Definition: MatrixMxN-Impl.h:394
T AbsMax() const
Returns absolute maximum among all elements.
Definition: MatrixMxN-Impl.h:555
T AbsMax(T x, T y)
Returns the absolute maximum value among the two inputs.
Definition: MathUtils-Impl.h:45
void SetRow(size_t i, const VectorExpression< T, E > &row)
Sets i-th row with input vector.
Definition: MatrixMxN-Impl.h:124
size_t Rows() const
Returns number of rows of this matrix.
Definition: MatrixMxN-Impl.h:203
size_t Cols() const
Number of columns.
Definition: MatrixExpression-Impl.h:28
void SetDiagonal(const T &s)
Sets diagonal elements with input scalar.
Definition: MatrixMxN-Impl.h:101
void SetColumn(size_t j, const VectorExpression< T, E > &col)
Sets j-th column with input vector.
Definition: MatrixMxN-Impl.h:134
Value ParallelReduce(IndexType beginIndex, IndexType endIndex, const Value &identity, const Function &function, const Reduce &reduce, ExecutionPolicy policy)
Performs reduce operation in parallel.
Definition: Parallel-Impl.h:407
void ParallelForEachIndex(Callback func) const
Iterates the matrix and invoke given func for each index in parallel using multi-threading.
Definition: MatrixMxN-Impl.h:858
MatrixTriangular< T, MatrixMxN > StrictUpperTri() const
Returns strictly upper triangle part of this matrix.
Definition: MatrixMxN-Impl.h:671
Matrix expression for matrix-matrix multiplication.
Definition: MatrixExpression.h:323
typename ContainerType::ConstIterator ConstIterator
Definition: MatrixMxN.h:33
bool operator==(const MatrixExpression< T, E > &m) const
Returns true if is equal to m.
Definition: MatrixMxN-Impl.h:811