OpenVDB 12.0.0
 
Loading...
Searching...
No Matches
SparseStencilMatrix< ValueType_, STENCIL_SIZE >::MatrixCopyOp Struct Reference

#include <openvdb/math/ConjGradient.h>

Public Types

using ValueType
 
using VectorType
 
using Ptr
 

Public Member Functions

 MatrixCopyOp (const SparseStencilMatrix &from_, SparseStencilMatrix &to_)
 
void operator() (const SizeRange &range) const
 
 SparseStencilMatrix (SizeType n)
 Construct an n x n matrix with at most STENCIL_SIZE nonzero elements per row.
 
 SparseStencilMatrix (const SparseStencilMatrix &)
 Deep copy the given matrix.
 
SizeType numRows () const
 Return the number of rows in this matrix.
 
SizeType size () const
 
void setValue (SizeType row, SizeType col, const ValueType &)
 Set the value at the given coordinates.
 
const ValueTypegetValue (SizeType row, SizeType col) const
 Return the value at the given coordinates.
 
const ValueTypeoperator() (SizeType row, SizeType col) const
 
ConstRow getConstRow (SizeType row) const
 Return a read-only view onto the given row of this matrix.
 
RowEditor getRowEditor (SizeType row)
 Return a read/write view onto the given row of this matrix.
 
void scale (const Scalar &s)
 Multiply all elements in the matrix by s;.
 
SparseStencilMatrixoperator*= (const Scalar &s)
 
void vectorMultiply (const Vector< VecValueType > &inVec, Vector< VecValueType > &resultVec) const
 Multiply this matrix by inVec and return the result in resultVec.
 
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.
 
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.
 
bool isFinite () const
 Return true if every element of this matrix has a finite value.
 
std::string str () const
 Return a string representation of this matrix.
 

Public Attributes

const SparseStencilMatrixfrom
 
SparseStencilMatrixto
 

Static Public Attributes

static constexpr ValueType sZeroValue
 

Member Typedef Documentation

◆ Ptr

using Ptr

◆ ValueType

using ValueType

◆ VectorType

using VectorType

Constructor & Destructor Documentation

◆ MatrixCopyOp()

template<typename ValueType_, SizeType STENCIL_SIZE>
MatrixCopyOp ( const SparseStencilMatrix & from_,
SparseStencilMatrix & to_ )
inline

Member Function Documentation

◆ eq()

bool eq ( const SparseStencilMatrix< OtherValueType, STENCIL_SIZE > & other,
ValueType eps = Tolerance<ValueType>::value() ) const
inline

Return true if this matrix is equivalent to the given matrix to within the specified tolerance.

◆ getConstRow()

SparseStencilMatrix< ValueType, STENCIL_SIZE >::ConstRow getConstRow ( SizeType row) const
inline

Return a read-only view onto the given row of this matrix.

◆ getRowEditor()

SparseStencilMatrix< ValueType, STENCIL_SIZE >::RowEditor getRowEditor ( SizeType row)
inline

Return a read/write view onto the given row of this matrix.

◆ getValue()

const ValueType & getValue ( SizeType row,
SizeType col ) const
inline

Return the value at the given coordinates.

Warning
It is not safe to get values from a row while another thread is setting values in that row.

◆ isFinite()

bool isFinite ( ) const
inline

Return true if every element of this matrix has a finite value.

◆ numRows()

SizeType numRows ( ) const
inline

Return the number of rows in this matrix.

◆ operator()() [1/2]

template<typename ValueType_, SizeType STENCIL_SIZE>
void operator() ( const SizeRange & range) const
inline

◆ operator()() [2/2]

const ValueType & operator() ( SizeType row,
SizeType col ) const
inline

◆ operator*=()

SparseStencilMatrix & operator*= ( const Scalar & s)
inline

◆ scale()

void scale ( const Scalar & s)
inline

Multiply all elements in the matrix by s;.

◆ setValue()

void setValue ( SizeType row,
SizeType col,
const ValueType & val )
inline

Set the value at the given coordinates.

Warning
It is not safe to set values in the same row simultaneously from multiple threads.

◆ size()

SizeType size ( ) const
inline

◆ SparseStencilMatrix() [1/2]

SparseStencilMatrix ( const SparseStencilMatrix & other)
inline

Deep copy the given matrix.

◆ SparseStencilMatrix() [2/2]

Construct an n x n matrix with at most STENCIL_SIZE nonzero elements per row.

◆ str()

std::string str ( ) const
inline

Return a string representation of this matrix.

◆ vectorMultiply() [1/2]

void vectorMultiply ( const Vector< VecValueType > & inVec,
Vector< VecValueType > & resultVec ) const
inline

Multiply this matrix by inVec and return the result in resultVec.

Exceptions
ArithmeticErrorif either inVec or resultVec is not of size N, where N x N is the size of this matrix.

◆ vectorMultiply() [2/2]

void vectorMultiply ( const VecValueType * inVec,
VecValueType * resultVec ) const
inline

Multiply this matrix by the vector represented by the array inVec and return the result in resultVec.

Warning
Both inVec and resultVec must have at least N elements, where N x N is the size of this matrix.

Member Data Documentation

◆ from

template<typename ValueType_, SizeType STENCIL_SIZE>
const SparseStencilMatrix* from

◆ sZeroValue

ValueType sZeroValue
inlinestaticconstexpr

◆ to

template<typename ValueType_, SizeType STENCIL_SIZE>
SparseStencilMatrix* to