Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
EigenVulpes Namespace Reference

Classes

class  SymMat
 Eigen expression representing a rank-1-derived symmetric matrix. More...
class  RowMat
 Eigen expression representing a vector inserted as one matrix row. More...
class  OneComponentVector
 Eigen expression for a vector with a single non-zero component. More...

Functions

template<Eigen::Index CrossId, class ArgType>
SymMat< CrossId, ArgType > makeSymMat (const Eigen::MatrixBase< ArgType > &arg)
 Build a SymMat expression from a column vector.
template<Eigen::Index RowId, class ArgType>
RowMat< RowId, ArgType > makeRowMat (const Eigen::MatrixBase< ArgType > &arg)
 Build a RowMat expression from a column vector.
template<typename Derived>
auto toMap (Eigen::MatrixBase< Derived > &mat)
 View a dense Eigen matrix/vector as a mutable Eigen::Map.
template<typename Derived>
auto toConstMap (const Eigen::MatrixBase< Derived > &mat)
 View a dense Eigen matrix/vector as a read-only Eigen::Map.
bool compareEigenMatrices (const Eigen::MatrixXd &mat1, const Eigen::MatrixXd &mat2, const double tolerance=1e-12)
 Compare two dense matrices for approximate equality.
bool compareEigenVectors (const Eigen::VectorXd &vec1, const Eigen::VectorXd &vec2, const double tolerance=1e-12)
 Compare two dense vectors for approximate equality.

Function Documentation

◆ compareEigenMatrices()

bool EigenVulpes::compareEigenMatrices ( const Eigen::MatrixXd & mat1,
const Eigen::MatrixXd & mat2,
const double tolerance = 1e-12 )
inline

Compare two dense matrices for approximate equality.

Matrices are considered equal if their dimensions match and the norm of their difference is within tolerance of the second matrix's norm. On mismatch, a diagnostic message is printed to stdout.

Parameters
mat1First matrix.
mat2Second (reference) matrix.
toleranceRelative tolerance applied to mat2's norm.
Returns
true if the matrices match in size and are numerically close.

◆ compareEigenVectors()

bool EigenVulpes::compareEigenVectors ( const Eigen::VectorXd & vec1,
const Eigen::VectorXd & vec2,
const double tolerance = 1e-12 )
inline

Compare two dense vectors for approximate equality.

Vectors are considered equal if their sizes match and the norm of their difference is within tolerance of the second vector's norm. On mismatch, a diagnostic message is printed to stdout.

Parameters
vec1First vector.
vec2Second (reference) vector.
toleranceRelative tolerance applied to vec2's norm.
Returns
true if the vectors match in size and are numerically close.

◆ makeRowMat()

template<Eigen::Index RowId, class ArgType>
RowMat< RowId, ArgType > EigenVulpes::makeRowMat ( const Eigen::MatrixBase< ArgType > & arg)

Build a RowMat expression from a column vector.

Template Parameters
RowIdRow index that carries the vector's coefficients.
ArgTypeEigen type of the underlying column vector.
Parameters
argThe column vector to wrap.
Returns
A RowMat<RowId, ArgType> expression over arg.

◆ makeSymMat()

template<Eigen::Index CrossId, class ArgType>
SymMat< CrossId, ArgType > EigenVulpes::makeSymMat ( const Eigen::MatrixBase< ArgType > & arg)

Build a SymMat expression from a column vector.

Template Parameters
CrossIdRow/column index that carries the vector's coefficients.
ArgTypeEigen type of the underlying column vector.
Parameters
argThe column vector to wrap.
Returns
A SymMat<CrossId, ArgType> expression over arg.

◆ toConstMap()

template<typename Derived>
auto EigenVulpes::toConstMap ( const Eigen::MatrixBase< Derived > & mat)

View a dense Eigen matrix/vector as a read-only Eigen::Map.

Template Parameters
DerivedConcrete Eigen type of mat.
Parameters
matThe matrix/vector to map.
Returns
A const Eigen::Map sharing storage with mat.

◆ toMap()

template<typename Derived>
auto EigenVulpes::toMap ( Eigen::MatrixBase< Derived > & mat)

View a dense Eigen matrix/vector as a mutable Eigen::Map.

Template Parameters
DerivedConcrete Eigen type of mat.
Parameters
matThe matrix/vector to map (must not be a temporary).
Returns
An Eigen::Map sharing storage with mat.