|
dynLattice
|
namespace for all helper functions
Typedefs | |
| typedef Array< double, 4 > | Quadix |
| typedef Array< IdxVector, 2 > | IdxVectorMatrix |
Functions | |
| Vector | funcGrad (const Ref< Function > func, const Vector &args) |
| gets the gradient of a multivariate function. | |
| Vector | evalFuncs (const FuncUtils::FuncArray funcs, const Vector &args) |
| evaluates an array of multivariate functions. | |
| Matrix | funcHessian (const Ref< Function > func, const Vector &args) |
| gets the Hessian of a multivariate function. | |
| Matrix | gradFuncs (const FuncUtils::FuncArray funcs, const Vector &args) |
| gets the gradients of an array of multivariate functions. | |
| Matrix | eye (const idx_t dim=3) |
| generates an identity matrix of the given dimension. | |
| void | logMat (const Vector &rv, const Matrix &R) |
| compute rotational vector from rotation matrix. | |
| void | vec2mat (const Matrix &mat, const Vector &vec) |
| rearrange a vector into a matrix. | |
| void | mat2vec (const Vector &vec, const Matrix &mat) |
| rearrange a matrix into a vector. | |
| void | mul3 (const Matrix &C, const Matrix &A, const Matrix &B) |
| C = A * B for 3 x 3 matrices without heap allocation. | |
| void | mul3 (const Vector &y, const Matrix &A, const Vector &x) |
| y = A * x for a 3 x 3 matrix without heap allocation. | |
| void | expVec (const Matrix &Exp, const Vector &v) |
| compute the exponential of a axial vector. | |
| void | expVecP (const Matrix &ExpP, const Vector &v, const Vector &vP) |
| derivative of jive_helpers::expVec. | |
| double | trace (const Matrix &mat) |
| calculate the trace of a matrix. | |
| idx_t | factorial (const idx_t n) |
| calculates the factorial of an integer. | |
| idx_t | binom (const idx_t n, const idx_t k) |
| calculate the binomial coefficient. | |
| double | matrixNorm2 (const Matrix &mat) |
| calculates the 2-norm of a matrix. | |
| Matrix | skew (const Vector &vec) |
| construct a skew symetric matrix from a given vector. | |
| void | skew (const Matrix &S, const Vector &vec) |
| fill an existing 3 x 3 matrix with the skew symmetric matrix of a vector | |
| Vector | unskew (const Matrix &mat) |
| construct a axial vector from a given skew-symmetric matrix | |
| void | setDofValue (jive::util::Constraints &cons, const idx_t idof, const double rval) |
| prescribe the value of a dof, i.e. constrain idof = rval. | |
| void | linkDofs (jive::util::Constraints &cons, const idx_t idof, const idx_t jdof, const double coeff) |
| link a slave dof to a master dof, i.e. constrain idof = coeff * jdof. | |
Variables | |
| const Vector | e1 = {1., 0., 0.} |
| const Vector | e2 = {0., 1., 0.} |
| const Vector | e3 = {0., 0., 1.} |
| const Vector | vec0 = {0., 0., 0.} |
| const double | TINY = __DBL_EPSILON__ * 1e6 |
| typedef Array<IdxVector, 2> jive_helpers::IdxVectorMatrix |
| typedef Array<double, 4> jive_helpers::Quadix |
| idx_t jive_helpers::binom | ( | const idx_t | n, |
| const idx_t | k | ||
| ) |
| [in] | n | Parameter n |
| [in] | k | Parameter k |
| Vector jive_helpers::evalFuncs | ( | const FuncUtils::FuncArray | funcs, |
| const Vector & | args | ||
| ) |
| [in] | funcs | array of functions to evaluate |
| [in] | args | point to evaluate at |
| void jive_helpers::expVec | ( | const Matrix & | Exp, |
| const Vector & | v | ||
| ) |
It computes the matrix exponential of the skew-symmetric matrix of this vector so when \(\Theta=[\theta\times]\) this function will return \(\exp(\Theta)\).
| [out] | Exp | 3 x 3 matrix exponential |
| [in] | v | 3-component axial rotation vector |
| void jive_helpers::expVecP | ( | const Matrix & | ExpP, |
| const Vector & | v, | ||
| const Vector & | vP | ||
| ) |
| [out] | ExpP | Derivative of the 3 x 3 matrix exponential |
| [in] | v | 3-component axial rotation vector |
| [in] | vP | Derivative of the axial rotation vector |
| Matrix jive_helpers::eye | ( | const idx_t | dim = 3 | ) |
| [in] | dim | dimension of the identity matrix (default 3) |
| idx_t jive_helpers::factorial | ( | const idx_t | n | ) |
| [in] | n | Integer to calculate the factorial from |
| Vector jive_helpers::funcGrad | ( | const Ref< Function > | func, |
| const Vector & | args | ||
| ) |
| [in] | func | function of which to evaluate the gradient |
| [in] | args | point to evaluate the gradient |
| Matrix jive_helpers::funcHessian | ( | const Ref< Function > | func, |
| const Vector & | args | ||
| ) |
| [in] | func | function of which to evaluate the Hessian |
| [in] | args | point to evaluate the Hessian |
| Matrix jive_helpers::gradFuncs | ( | const FuncUtils::FuncArray | funcs, |
| const Vector & | args | ||
| ) |
| [in] | funcs | array of functions of which to evaluate the gradient |
| [in] | args | point to evaluate the gradient |
| void jive_helpers::linkDofs | ( | jive::util::Constraints & | cons, |
| const idx_t | idof, | ||
| const idx_t | jdof, | ||
| const double | coeff | ||
| ) |
| [in,out] | cons | constraints to modify |
| [in] | idof | slave dof index |
| [in] | jdof | master dof index |
| [in] | coeff | coefficient of the master dof |
| void jive_helpers::logMat | ( | const Vector & | rv, |
| const Matrix & | R | ||
| ) |
This function computes the logarithmic map of a rotation matrix as a member of the Lie group SO(3) to the Lie algebra \(\mathfrak{so}(3)\). It returns the axial vector of the rotation matrix.
| [out] | rv | 3-component rotational vector |
| [in] | R | 3 x 3 rotational matrix |
| void jive_helpers::mat2vec | ( | const Vector & | vec, |
| const Matrix & | mat | ||
| ) |
| [out] | vec | Vector populated with the matrix values by row |
| [in] | mat | Matrix whose entry count matches the vector size |
| double jive_helpers::matrixNorm2 | ( | const Matrix & | mat | ) |
| [in] | mat | Matrix |
| void jive_helpers::mul3 | ( | const Matrix & | C, |
| const Matrix & | A, | ||
| const Matrix & | B | ||
| ) |
The product is formed on the stack first, so C may alias A or B (unlike jem::numeric::matmul(C, A, B)); the 3 x 3 sizes are fixed, which makes it faster than the general matmul. Use it for every 3 x 3 product in hot code.
| [out] | C | 3 x 3 result |
| [in] | A | 3 x 3 left factor |
| [in] | B | 3 x 3 right factor |
| void jive_helpers::mul3 | ( | const Vector & | y, |
| const Matrix & | A, | ||
| const Vector & | x | ||
| ) |
x is copied first, so y may alias x. The sums are formed in the same order as in jem::numeric::matmul (starting from zero), so the results are the same.
| [out] | y | 3 vector result |
| [in] | A | 3 x 3 matrix (may be a transposed view) |
| [in] | x | 3 vector |
| void jive_helpers::setDofValue | ( | jive::util::Constraints & | cons, |
| const idx_t | idof, | ||
| const double | rval | ||
| ) |
| [in,out] | cons | constraints to modify |
| [in] | idof | dof index to prescribe |
| [in] | rval | prescribed value |
| void jive_helpers::skew | ( | const Matrix & | S, |
| const Vector & | vec | ||
| ) |
Does not create a new matrix, so it is the form for hot code.
| [out] | S | 3 x 3 skew symmetric matrix |
| [in] | vec | Vector |
| Matrix jive_helpers::skew | ( | const Vector & | vec | ) |
Convenient form for set-up code; it creates a new matrix. In hot code use the form below with a work matrix.
| [in] | vec | Vector to be changed to a skew-symmetric matrix |
| double jive_helpers::trace | ( | const Matrix & | mat | ) |
| [in] | mat | Matrix to get the trace of |
| Vector jive_helpers::unskew | ( | const Matrix & | mat | ) |
| [in] | mat | Skew-symmetric matrix |
| void jive_helpers::vec2mat | ( | const Matrix & | mat, |
| const Vector & | vec | ||
| ) |
| [out] | mat | Matrix populated from the vector values by row |
| [in] | vec | Vector whose size matches the number of matrix entries |
| const Vector jive_helpers::e1 = {1., 0., 0.} |
| const Vector jive_helpers::e2 = {0., 1., 0.} |
| const Vector jive_helpers::e3 = {0., 0., 1.} |
| const double jive_helpers::TINY = __DBL_EPSILON__ * 1e6 |
| const Vector jive_helpers::vec0 = {0., 0., 0.} |