test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Macros | Functions
invertPosDefMatrix.h File Reference
#include "Math/SMatrix.h"
#include "Math/CholeskyDecomp.h"

Go to the source code of this file.

Macros

#define SMATRIX_USE_CONSTEXPR
 

Functions

template<typename T , unsigned int N>
bool invertPosDefMatrix (ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
 
template<typename T , unsigned int N>
bool invertPosDefMatrix (ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &mIn, ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &mOut)
 
template<>
bool invertPosDefMatrix< double, 1 > (ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > &m)
 
template<>
bool invertPosDefMatrix< float, 1 > (ROOT::Math::SMatrix< float, 1, 1, ROOT::Math::MatRepSym< float, 1 > > &m)
 

Macro Definition Documentation

#define SMATRIX_USE_CONSTEXPR

Definition at line 4 of file invertPosDefMatrix.h.

Function Documentation

template<typename T , unsigned int N>
bool invertPosDefMatrix ( ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &  m)
inline
template<typename T , unsigned int N>
bool invertPosDefMatrix ( ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > const &  mIn,
ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &  mOut 
)
inline

Definition at line 32 of file invertPosDefMatrix.h.

33  {
34 
35  ROOT::Math::CholeskyDecomp<T,N> decomp(mIn);
36  if (!decomp) {
37  mOut=mIn;
38  return mOut.Invert();
39  } else
40  decomp.Invert(mOut);
41  return true;
42 
43 }
template<>
bool invertPosDefMatrix< double, 1 > ( ROOT::Math::SMatrix< double, 1, 1, ROOT::Math::MatRepSym< double, 1 > > &  m)
inline

Definition at line 21 of file invertPosDefMatrix.h.

References visualization-live-secondInstance_cfg::m.

21  {
22  m(0,0) = 1./m(0,0);
23  return true;
24 }
template<>
bool invertPosDefMatrix< float, 1 > ( ROOT::Math::SMatrix< float, 1, 1, ROOT::Math::MatRepSym< float, 1 > > &  m)
inline

Definition at line 26 of file invertPosDefMatrix.h.

References visualization-live-secondInstance_cfg::m.

26  {
27  m(0,0) = 1.f/m(0,0);
28  return true;
29 }