FEDRA emulsion software from the OPERA Collaboration
Invert< 2 > Class Reference

#include <Dinv.hh>

Static Public Member Functions

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

Detailed Description

Invert<2>. $2\times2$ (sub-)matrix. Use Cramers rule.

Author
T. Glebe

Member Function Documentation

◆ Dinv()

template<class Matrix >
static bool Invert< 2 >::Dinv ( Matrix &  rhs)
inlinestatic
131 {
132
133 typename Matrix::value_type* a = rhs.Array();
134 typename Matrix::value_type det = a[0] * a[3] - a[2] * a[1];
135
136 if (det == 0.) { return false; }
137
138 typename Matrix::value_type s = 1. / det;
139 typename Matrix::value_type c11 = s * a[3];
140
141 a[2] = -s * a[2];
142 a[1] = -s * a[1];
143 a[3] = s * a[0];
144 a[0] = c11;
145 return true;
146 }
void a()
Definition: check_aligned.C:59
s
Definition: check_shower.C:55

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