11#include <jem/base/Array.h>
12#include <jem/base/CString.h>
13#include <jem/numeric/Quaternion.h>
14#include <jem/numeric/algebra.h>
15#include <jem/numeric/func/Function.h>
17#include <jive/Array.h>
18#include <jive/util/FuncUtils.h>
20#define WARN(key) jem::System::warn() << key << "\n";
21#define ERR(key) jem::System::err() << key << "\n";
26using jem::SliceFromTo;
28using jem::numeric::dotProduct;
29using jem::numeric::Function;
30using jem::numeric::matmul;
31using jem::numeric::MatmulChain;
32using jem::numeric::norm2;
33using jem::numeric::Quaternion;
40using jive::util::FuncUtils;
51 const Vector
e1 = {1., 0., 0.};
52 const Vector
e2 = {0., 1., 0.};
53 const Vector
e3 = {0., 0., 1.};
54 const Vector
vec0 = {0., 0., 0.};
55 const double TINY = __DBL_EPSILON__ * 1e6;
64 Vector
funcGrad(
const Ref<Function> func,
const Vector &args);
73 Vector
evalFuncs(
const FuncUtils::FuncArray funcs,
const Vector &args);
82 Matrix
funcHessian(
const Ref<Function> func,
const Vector &args);
91 Matrix
gradFuncs(
const FuncUtils::FuncArray funcs,
const Vector &args);
99 Matrix
eye(
const idx_t dim = 3);
112 void logMat(
const Vector &rv,
const Matrix &R);
120 void vec2mat(
const Matrix &mat,
const Vector &vec);
128 void mat2vec(
const Vector &vec,
const Matrix &mat);
141 void expVec(
const Matrix &Exp,
const Vector &v);
153 void expVecP(
const Matrix &ExpP,
const Vector &v,
const Vector &vP);
161 double trace(
const Matrix &mat);
178 idx_t
binom(
const idx_t n,
const idx_t k);
194 Matrix
skew(
const Vector &vec);
203 Vector
unskew(
const Matrix &mat);
void vec2mat(const Matrix &mat, const Vector &vec)
Definition ParaViewModule.cpp:15
namespace for all helper functions
Definition helpers.cpp:10
double trace(const Matrix &mat)
calculate the trace of a matrix.
Definition helpers.cpp:199
Vector unskew(const Matrix &mat)
construct a axial vector from a given skew-symmetric matrix
Definition helpers.cpp:257
void expVec(const Matrix &Exp, const Vector &psi)
compute the exponential of a axial vector.
Definition helpers.cpp:139
idx_t factorial(const idx_t n)
calculates the factorial of an integer.
Definition helpers.cpp:211
Vector funcGrad(const Ref< Function > func, const Vector &args)
gets the gradient of a multivariate function.
Definition helpers.cpp:11
idx_t binom(const idx_t n, const idx_t k)
calculate the binomial coefficient.
Definition helpers.cpp:222
void logMat(const Vector &rv, const Matrix &R)
compute rotational vector from rotation matrix.
Definition helpers.cpp:99
Matrix eye(const idx_t dim)
generates an identity matrix of the given dimension.
Definition helpers.cpp:88
const double TINY
Definition helpers.h:55
Vector evalFuncs(const FuncUtils::FuncArray funcs, const Vector &args)
evaluates an array of multivariate functions.
Definition helpers.cpp:24
const Vector e3
Definition helpers.h:53
const Vector vec0
Definition helpers.h:54
Array< double, 4 > Quadix
Definition helpers.h:48
const Vector e1
Definition helpers.h:51
Matrix funcHessian(const Ref< Function > func, const Vector &args)
gets the Hessian of a multivariate function.
Definition helpers.cpp:37
Matrix gradFuncs(const FuncUtils::FuncArray funcs, const Vector &args)
gets the gradients of an array of multivariate functions.
Definition helpers.cpp:71
Matrix skew(const Vector &vec)
construct a skew symetric matrix from a given vector.
Definition helpers.cpp:242
double matrixNorm2(const Matrix &mat)
calculates the 2-norm of a matrix.
Definition helpers.cpp:231
void expVecP(const Matrix &ExpP, const Vector &psi, const Vector &psiP)
derivative of jive_helpers::expVec.
Definition helpers.cpp:159
const Vector e2
Definition helpers.h:52
void mat2vec(const Vector &vec, const Matrix &mat)
rearrange a matrix into a vector.
Definition helpers.cpp:126
Array< IdxVector, 2 > IdxVectorMatrix
Definition helpers.h:49
several compiler macros for faster testing of variables