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()

static JacobianMatrix< M, N > identity ( )
inlinestatic

Construct a unit matrix.

Definition at line 38 of file JacobianMatrixUtil.h.

39 {
41 }
static PlainMatrix< T, M, N > Identity()
Construct an identity matrix.
Definition: PlainMatrix.h:74

◆ passiveRotation() [1/2]

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]

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 }
static Vector2D Phi(const double phi)
Constucts a unit vector with azimuth angle equal to phi.
Definition: Vector2D.h:62

◆ scale()

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()

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()

static JacobianMatrix< M, N > zero ( )
inlinestatic

Construct a zero matrix.

Definition at line 31 of file JacobianMatrixUtil.h.

32 {
34 }
static PlainMatrix< T, M, N > Zero()
Construct a matrix initialized with zeros.
Definition: PlainMatrix.h:67

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