dynLattice
Loading...
Searching...
No Matches
Typedefs | Functions | Variables
jive_helpers Namespace Reference

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 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.
 
Vector unskew (const Matrix &mat)
 construct a axial vector from a given skew-symmetric matrix
 

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 Documentation

◆ IdxVectorMatrix

typedef Array<IdxVector, 2> jive_helpers::IdxVectorMatrix

◆ Quadix

typedef Array<double, 4> jive_helpers::Quadix

Function Documentation

◆ binom()

idx_t jive_helpers::binom ( const idx_t  n,
const idx_t  k 
)
Parameters
nparameter n
kparameter k
Returns
binomial coefficient nCk

◆ evalFuncs()

Vector jive_helpers::evalFuncs ( const FuncUtils::FuncArray  funcs,
const Vector &  args 
)
Parameters
funcsarray of functions to evaluate
argspoint to evaluate at
Returns
results of the evaluation

◆ expVec()

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)\).

See also
Wikipedia
Parameters
[out]Expresulting matrix exponential
[in]vaxial rotation vector

◆ expVecP()

void jive_helpers::expVecP ( const Matrix &  ExpP,
const Vector &  v,
const Vector &  vP 
)
See also
jive_helpers::expVec
Differentiation rules
Parameters
[out]ExpPresulting matrix exponential
[in]vaxial rotation vector
[in]vPderivative of the axial rotation vector

◆ eye()

Matrix jive_helpers::eye ( const idx_t  dim = 3)
Parameters
dimdimension of the identity matrix (default 3)
Returns
identity matrix

◆ factorial()

idx_t jive_helpers::factorial ( const idx_t  n)
Parameters
ninteger to calculate the factorial from
Returns
the calculated factorial

◆ funcGrad()

Vector jive_helpers::funcGrad ( const Ref< Function >  func,
const Vector &  args 
)
Parameters
funcfunction of which to evaluate the gradient
argspoint to evaluate the gradient
Returns
gradient

◆ funcHessian()

Matrix jive_helpers::funcHessian ( const Ref< Function >  func,
const Vector &  args 
)
Parameters
funcfunction of which to evaluate the Hessian
argspoint to evaluate the Hessian
Returns
Hessian

◆ gradFuncs()

Matrix jive_helpers::gradFuncs ( const FuncUtils::FuncArray  funcs,
const Vector &  args 
)
Parameters
funcsarray of functions of which to evaluate the gradient
argspoint to evaluate the gradient
Returns
Matrix of the gradients

◆ logMat()

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.

See also
Wikipedia
Parameters
[out]rvrotational vector
[in]Rrotational matrix

◆ mat2vec()

void jive_helpers::mat2vec ( const Vector &  vec,
const Matrix &  mat 
)
Parameters
[out]matmatrix of given dimensions
[in]vecvector (needs to have fitting dimension)

◆ matrixNorm2()

double jive_helpers::matrixNorm2 ( const Matrix &  mat)
Parameters
matmatrix
Returns
resulting 2-norm

◆ skew()

Matrix jive_helpers::skew ( const Vector &  vec)
Parameters
vecvector to be changed to skew symmetric matrix
Returns
skew symmetric matrix

◆ trace()

double jive_helpers::trace ( const Matrix &  mat)
Parameters
matmatrix to get the trace of
Returns
the trace of the given matrix

◆ unskew()

Vector jive_helpers::unskew ( const Matrix &  mat)
Parameters
matskew symmetric matrix
Returns
axial vector

◆ vec2mat()

void jive_helpers::vec2mat ( const Matrix &  mat,
const Vector &  vec 
)
Parameters
[out]matmatrix of given dimensions
[in]vecvector (needs to have fitting dimension)

Variable Documentation

◆ e1

const Vector jive_helpers::e1 = {1., 0., 0.}

◆ e2

const Vector jive_helpers::e2 = {0., 1., 0.}

◆ e3

const Vector jive_helpers::e3 = {0., 0., 1.}

◆ TINY

const double jive_helpers::TINY = __DBL_EPSILON__ * 1e6

◆ vec0

const Vector jive_helpers::vec0 = {0., 0., 0.}