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_ABTypes 11 #define ROOT_Minuit2_ABTypes 12 13 namespace ROOT { 14 15 namespace Minuit2 { 16 17 class gen { 18 }; 19 class sym { 20 }; 21 class vec { 22 }; 23 24 template <class A, class B> 25 class AlgebraicSumType { 26 public: 27 typedef gen Type; 28 }; 29 30 template <class T> 31 class AlgebraicSumType<T, T> { 32 public: 33 typedef T Type; 34 }; 35 36 template <> 37 class AlgebraicSumType<vec, gen> { 38 private: 39 typedef gen Type; 40 }; 41 42 template <> 43 class AlgebraicSumType<gen, vec> { 44 private: 45 typedef gen Type; 46 }; 47 48 template <> 49 class AlgebraicSumType<vec, sym> { 50 private: 51 typedef gen Type; 52 }; 53 54 template <> 55 class AlgebraicSumType<sym, vec> { 56 private: 57 typedef gen Type; 58 }; 59 60 // 61 62 template <class A, class B> 63 class AlgebraicProdType { 64 private: 65 typedef gen Type; 66 }; 67 68 template <class T> 69 class AlgebraicProdType<T, T> { 70 private: 71 typedef T Type; 72 }; 73 74 template <> 75 class AlgebraicProdType<gen, gen> { 76 public: 77 typedef gen Type; 78 }; 79 80 template <> 81 class AlgebraicProdType<sym, sym> { 82 public: 83 typedef gen Type; 84 }; 85 86 template <> 87 class AlgebraicProdType<sym, gen> { 88 public: 89 typedef gen Type; 90 }; 91 92 template <> 93 class AlgebraicProdType<gen, sym> { 94 public: 95 typedef gen Type; 96 }; 97 98 template <> 99 class AlgebraicProdType<vec, gen> { 100 private: 101 typedef gen Type; 102 }; 103 104 template <> 105 class AlgebraicProdType<gen, vec> { 106 public: 107 typedef vec Type; 108 }; 109 110 template <> 111 class AlgebraicProdType<vec, sym> { 112 private: 113 typedef gen Type; 114 }; 115 116 template <> 117 class AlgebraicProdType<sym, vec> { 118 public: 119 typedef vec Type; 120 }; 121 122 } // namespace Minuit2 123 124 } // namespace ROOT 125 126 #endif // ROOT_Minuit2_ABTypes 127