FEDRA emulsion software from the OPERA Collaboration
Invert< idim, n > Class Template Reference

#include <Dinv.hh>

Static Public Member Functions

template<class Matrix >
static bool Dinv (Matrix &rhs)
 

Detailed Description

template<unsigned int idim, unsigned int n = idim>
class Invert< idim, n >

Invert. Class to specialize calls to Dinv. Dinv computes the inverse of a square matrix if dimension $idim$ and order $n$. The content of the matrix will be replaced by its inverse. In case the inversion fails, the matrix content is destroyed. Invert specializes Dinv by the matrix order. E.g. if the order of the matrix is two, the routine Invert<2> is called which implements Cramers rule.

Author
T. Glebe

Member Function Documentation

◆ Dinv()

template<unsigned int idim, unsigned int n = idim>
template<class Matrix >
static bool Invert< idim, n >::Dinv ( Matrix &  rhs)
inlinestatic
50 {
51
52#ifdef XXX
53 if (n < 1 || n > idim) {
54 return false;
55 }
56#endif
57
58 /* Initialized data */
59 static unsigned int work[n];
60 for(unsigned int i=0; i<n; ++i) work[i] = 0;
61
62 static typename Matrix::value_type det = 0;
63
64 /* Function Body */
65
66 /* N.GT.3 CASES. FACTORIZE MATRIX AND INVERT. */
67 if (Dfactir<Matrix,n,idim>(rhs,det,work) == false) {
68 cerr << "Dfactir failed!!" << endl;
69 return false;
70 }
71 return Dfinv<Matrix,n,idim>(rhs,work);
72 } // Dinv

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