Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
inverse.h
Go to the documentation of this file.
1#ifndef INVERSE_H
2#define INVERSE_H
3/*
4Various matrix inversions performed upon arrays of DynLinArr and
5DynArr classes.
6
7
8Copyright (c) 2001 Igor B. Smirnov
9
10The file can be used, copied, modified, and distributed
11according to the terms of GNU Lesser General Public License version 2.1
12as published by the Free Software Foundation,
13and provided that the above copyright notice, this permission notice,
14and notices about any modifications of the original text
15appear in all copies and in supporting documentation.
16The file is provided "as is" without express or implied warranty.
17*/
18
21
22namespace Heed {
23
24/// Matrix inversion
25/// szero == 1 indicates that the calculations are terminated
26/// owing to an attempt to divide by 0. The final matrix is not correct.
27/// serr == 1 indicates that the interval precision is broken
28/// (but the final matrix may be provided if szero=0).
29/// s_stop is a directive to stop if the interval precision is broken.
30void inverse_DynArr_prot(const DynArr<DoubleAc>& mi, DynArr<DoubleAc>& mr,
31 int& szero, int& serr, int s_stop = 1);
32
33void inverse_DynArr(const DynArr<double>& mi, DynArr<double>& mr, int& serr);
34
35/// Call inverse_DynArr_prot two times, first with inbuilt precision
36/// and the second time with the given precision.
37/// serr1 means the inversion cannot be done in a numerically precise way.
38/// In this case mr2 and serr2 are not initialised.
39/// If serr1 == 0, mr2 and serr2 are always calculated.
40/// If szero == 1, serr1 == 1 too.
41void inverse_DynArr(const DynArr<DoubleAc>& mi, DynArr<DoubleAc>& mr1,
42 int& szero, int& serr1, DynArr<DoubleAc>& mr2, int& serr2);
43
44void inverse_DynArr(const DynArr<double>& mi,
45 const DynLinArr<int>& s_var, // 1 if variable
46 DynArr<double>& mr, int& serr);
47void inverse_DynArr_prot(const DynArr<DoubleAc>& mi,
48 const DynLinArr<int>& s_var, // 1 if variable
49 DynArr<DoubleAc>& mr, int& szero, int& serr,
50 int s_stop = 1);
51
52/// Pack the matrix, call the same function declared without s_var
53/// and unpack the result.
54void inverse_DynArr(const DynArr<DoubleAc>& mi,
55 const DynLinArr<int>& s_var, // 1 if variable
56 DynArr<DoubleAc>& mr1, int& szero, int& serr1,
57 DynArr<DoubleAc>& mr2, int& serr2);
58
59DoubleAc determinant_DynArr(const DynArr<DoubleAc>& mi,
60 long q = 0); // default means total matrix
61
62DoubleAc determinant_DynArr(const DynArr<DoubleAc>& mi,
63 const DynLinArr<int>& s_var, // 1 if variable
64 long q = 0); // default means total matrix
65 // counts active rows and columns
66}
67#endif
Definition: BGMesh.cpp:6
DoubleAc determinant_DynArr(const DynArr< DoubleAc > &mi, long q)
Definition: inverse.cpp:358
void inverse_DynArr_prot(const DynArr< DoubleAc > &mi, DynArr< DoubleAc > &mr, int &szero, int &serr, int s_stop)
Definition: inverse.cpp:17
void inverse_DynArr(const DynArr< double > &mi, DynArr< double > &mr, int &serr)
Definition: inverse.cpp:99