1 // @(#)root/minuit2:$Id$
2 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005
3 
4 /**********************************************************************
5  *                                                                    *
6  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
7  *                                                                    *
8  **********************************************************************/
9 
10 #ifndef ROOT_Minuit2_MatrixInverse
11 #define ROOT_Minuit2_MatrixInverse
12 
13 #include "Minuit2/ABTypes.h"
14 #include "Minuit2/ABObj.h"
15 
16 namespace ROOT {
17 
18 namespace Minuit2 {
19 
20 template <class mtype, class M, class T>
21 class MatrixInverse {
22 
23 public:
MatrixInverse(const M & obj)24    MatrixInverse(const M &obj) : fObject(obj) {}
25 
~MatrixInverse()26    ~MatrixInverse() {}
27 
28    typedef mtype Type;
29 
Obj()30    const M &Obj() const { return fObject; }
31 
32 private:
33    M fObject;
34 };
35 
36 template <class M, class T>
37 class MatrixInverse<vec, M, T> {
38 
39 private:
MatrixInverse(const M & obj)40    MatrixInverse(const M &obj) : fObject(obj) {}
41 
42 public:
~MatrixInverse()43    ~MatrixInverse() {}
44 
45    typedef vec Type;
46 
Obj()47    const M &Obj() const { return fObject; }
48 
49 private:
50    M fObject;
51 };
52 
53 template <class mt, class M, class T>
Inverse(const ABObj<mt,M,T> & obj)54 inline ABObj<mt, MatrixInverse<mt, ABObj<mt, M, T>, T>, T> Inverse(const ABObj<mt, M, T> &obj)
55 {
56    return ABObj<mt, MatrixInverse<mt, ABObj<mt, M, T>, T>, T>(MatrixInverse<mt, ABObj<mt, M, T>, T>(obj));
57 }
58 
59 } // namespace Minuit2
60 
61 } // namespace ROOT
62 
63 #endif // ROOT_Minuit2_MatrixInverse
64