OpenVDB
9.0.1
|
Sparse, square matrix representing a 3D stencil operator of size STENCIL_SIZE. More...
#include <openvdb/math/ConjGradient.h>
Classes | |
class | ConstRow |
Read-only accessor to a row of this matrix. More... | |
class | ConstValueIter |
Iterator over the stored values in a row of this matrix. More... | |
struct | IsFiniteOp |
struct | MatrixCopyOp |
class | RowEditor |
Read/write accessor to a row of this matrix. More... | |
Public Types | |
using | ValueType = ValueType_ |
using | VectorType = Vector< ValueType > |
using | Ptr = SharedPtr< SparseStencilMatrix > |
Public Member Functions | |
SparseStencilMatrix (SizeType n) | |
Construct an n x n matrix with at most STENCIL_SIZE nonzero elements per row. More... | |
SparseStencilMatrix (const SparseStencilMatrix &) | |
Deep copy the given matrix. More... | |
void | setValue (SizeType row, SizeType col, const ValueType &) |
Set the value at the given coordinates. More... | |
ConstRow | getConstRow (SizeType row) const |
Return a read-only view onto the given row of this matrix. More... | |
RowEditor | getRowEditor (SizeType row) |
Return a read/write view onto the given row of this matrix. More... | |
template<typename VecValueType > | |
void | vectorMultiply (const Vector< VecValueType > &inVec, Vector< VecValueType > &resultVec) const |
Multiply this matrix by inVec and return the result in resultVec. More... | |
template<typename VecValueType > | |
void | vectorMultiply (const VecValueType *inVec, VecValueType *resultVec) const |
Multiply this matrix by the vector represented by the array inVec and return the result in resultVec. More... | |
template<typename OtherValueType > | |
bool | eq (const SparseStencilMatrix< OtherValueType, STENCIL_SIZE > &other, ValueType eps=Tolerance< ValueType >::value()) const |
Return true if this matrix is equivalent to the given matrix to within the specified tolerance. More... | |
bool | isFinite () const |
Return true if every element of this matrix has a finite value. More... | |
std::string | str () const |
Return a string representation of this matrix. More... | |
SizeType | numRows () const |
Return the number of rows in this matrix. More... | |
SizeType | size () const |
Return the number of rows in this matrix. More... | |
const ValueType & | getValue (SizeType row, SizeType col) const |
Return the value at the given coordinates. More... | |
const ValueType & | operator() (SizeType row, SizeType col) const |
Return the value at the given coordinates. More... | |
template<typename Scalar > | |
void | scale (const Scalar &s) |
Multiply all elements in the matrix by s;. More... | |
template<typename Scalar > | |
SparseStencilMatrix & | operator*= (const Scalar &s) |
Multiply all elements in the matrix by s;. More... | |
Static Public Attributes | |
static const ValueType | sZeroValue = zeroVal<ValueType>() |
Sparse, square matrix representing a 3D stencil operator of size STENCIL_SIZE.
The implementation is a variation on compressed row storage (CRS).
using Ptr = SharedPtr<SparseStencilMatrix> |
using ValueType = ValueType_ |
using VectorType = Vector<ValueType> |
|
inline |
Construct an n x n matrix with at most STENCIL_SIZE nonzero elements per row.
|
inline |
Deep copy the given matrix.
|
inline |
Return true
if this matrix is equivalent to the given matrix to within the specified tolerance.
|
inline |
Return a read-only view onto the given row of this matrix.
|
inline |
Return a read/write view onto the given row of this matrix.
Return the value at the given coordinates.
|
inline |
Return true
if every element of this matrix has a finite value.
|
inline |
Return the number of rows in this matrix.
Return the value at the given coordinates.
|
inline |
Multiply all elements in the matrix by s;.
|
inline |
Multiply all elements in the matrix by s;.
Set the value at the given coordinates.
|
inline |
Return the number of rows in this matrix.
|
inline |
Return a string representation of this matrix.
|
inline |
Multiply this matrix by inVec and return the result in resultVec.
ArithmeticError | if either inVec or resultVec is not of size N, where N x N is the size of this matrix. |
|
inline |
Multiply this matrix by the vector represented by the array inVec and return the result in resultVec.