Belle II Software development
JacobianMatrixUtil Struct Reference

Collection of functions related to jacobian matrices. More...

#include <JacobianMatrixUtil.h>

Static Public Member Functions

template<unsigned int M, unsigned int N = M>
static JacobianMatrix< M, N > zero ()
 Construct a zero matrix.
 
template<int M, int N = M>
static JacobianMatrix< M, N > identity ()
 Construct a unit matrix.
 
template<int N>
static JacobianMatrix< N, N > passiveRotation (int i, int j, double phi)
 Construct a passive rotation matrix around coordinates i and j.
 
template<int N>
static JacobianMatrix< N, N > passiveRotation (int i, int j, const Vector2D &phiVec)
 Construct a passive rotation matrix around coordinates i and j.
 
template<int N>
static JacobianMatrix< N > scale (const ParameterVector< N > &scales)
 Calculates the jacobian matrix for a scaling in each parameter.
 
template<int M1, int N1, int M2, int N2>
static JacobianMatrix< M1+M2, N1+N2 > stackBlocks (const JacobianMatrix< M1, N1 > &block1, const JacobianMatrix< M2, N2 > &block2)
 Combines two jacobian matrices by putting them in two blocks diagonal to each other in a larger matrix.
 

Detailed Description

Collection of functions related to jacobian matrices.

Definition at line 27 of file JacobianMatrixUtil.h.

Member Function Documentation

◆ identity()

template<int M, int N = M>
static JacobianMatrix< M, N > identity ( )
inlinestatic

Construct a unit matrix.

Definition at line 38 of file JacobianMatrixUtil.h.

39 {
40 return JacobianMatrix<M, N>::Identity();
41 }

◆ passiveRotation() [1/2]

template<int N>
static JacobianMatrix< N, N > passiveRotation ( int i,
int j,
const Vector2D & phiVec )
inlinestatic

Construct a passive rotation matrix around coordinates i and j.

Definition at line 52 of file JacobianMatrixUtil.h.

53 {
54 assert(i < N);
55 assert(j < N);
56 JacobianMatrix<N, N> result = identity<N>();
57 result(i, i) = phiVec.x();
58 result(i, j) = phiVec.y();
59 result(j, i) = -phiVec.y();
60 result(j, j) = phiVec.x();
61 return result;
62 }

◆ passiveRotation() [2/2]

template<int N>
static JacobianMatrix< N, N > passiveRotation ( int i,
int j,
double phi )
inlinestatic

Construct a passive rotation matrix around coordinates i and j.

Definition at line 45 of file JacobianMatrixUtil.h.

46 {
47 return passiveRotation<N>(i, j, Vector2D::Phi(phi));
48 }

◆ scale()

template<int N>
static JacobianMatrix< N > scale ( const ParameterVector< N > & scales)
inlinestatic

Calculates the jacobian matrix for a scaling in each parameter.

Definition at line 66 of file JacobianMatrixUtil.h.

67 {
68 JacobianMatrix<N> result = zero<N>();
69 mapToEigen(result).diagonal() = mapToEigen(scales);
70 return result;
71 }

◆ stackBlocks()

template<int M1, int N1, int M2, int N2>
static JacobianMatrix< M1+M2, N1+N2 > stackBlocks ( const JacobianMatrix< M1, N1 > & block1,
const JacobianMatrix< M2, N2 > & block2 )
inlinestatic

Combines two jacobian matrices by putting them in two blocks diagonal to each other in a larger matrix.

Definition at line 76 of file JacobianMatrixUtil.h.

78 {
79 JacobianMatrix < M1 + M2, N1 + N2 > result;
80 mapToEigen(result) << mapToEigen(block1), Eigen::Matrix<double, M1, N2>::Zero(),
81 Eigen::Matrix<double, M2, N1>::Zero(), mapToEigen(block2);
82 return result;
83 }

◆ zero()

template<unsigned int M, unsigned int N = M>
static JacobianMatrix< M, N > zero ( )
inlinestatic

Construct a zero matrix.

Definition at line 31 of file JacobianMatrixUtil.h.

32 {
33 return JacobianMatrix<M, N>::Zero();
34 }

The documentation for this struct was generated from the following file: