PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
pbat::math::linalg Namespace Reference

Linear Algebra related functionality. More...

Namespaces

namespace  mini
 Mini linear algebra related functionality.
 

Classes

class  SparsityPattern
 Sparsity pattern precomputer to accelerate sparse matrix assembly. More...
 

Enumerations

enum class  EEigenvalueFilter { None , SpdProjection , FlipNegative }
 Bit-flag enum for SPD projection type.
 

Functions

template<class TDerivedA, class TDerivedB>
bool FilterEigenvalues (Eigen::MatrixBase< TDerivedA > const &A, EEigenvalueFilter mode, Eigen::MatrixBase< TDerivedB > &B)
 Filter eigenvalues of a symmetric matrix A and store the result in B.
 
template<class TDerivedC>
CSCMatrix SelectionMatrix (Eigen::DenseBase< TDerivedC > const &C, Index n=Index(-1))
 Construct the selection matrix S s.t. X*S selects all columns C of X.
 

Detailed Description

Linear Algebra related functionality.

Function Documentation

◆ FilterEigenvalues()

template<class TDerivedA, class TDerivedB>
bool pbat::math::linalg::FilterEigenvalues ( Eigen::MatrixBase< TDerivedA > const & A,
EEigenvalueFilter mode,
Eigen::MatrixBase< TDerivedB > & B )

Filter eigenvalues of a symmetric matrix A and store the result in B.

Template Parameters
TDerivedAType of the input matrix A
TDerivedBType of the output matrix B
Parameters
AInput matrix
modeEigenvalue filtering mode
BOutput matrix
Returns
true if filtering occured successfully
false if failed (e.g. eigen decomposition failed)

◆ SelectionMatrix()

template<class TDerivedC>
CSCMatrix pbat::math::linalg::SelectionMatrix ( Eigen::DenseBase< TDerivedC > const & C,
Index n = Index(-1) )

Construct the selection matrix S s.t. X*S selects all columns C of X.

Template Parameters
TDerivedCType of the index vector
Parameters
CVector of indices
nNumber of rows in the selection matrix
Returns
n x |C| selection matrix