Borderbasix

GENERIC.hpp
Go to the documentation of this file.
1 /*********************************************************************
2 * This file is part of the source code of BORDERBASIX software. *
3 * (C) B. Mourrain, INRIA *
4 **********************************************************************
5 History:
6 $Id: GENERIC.hpp,v 1.1.1.1 2006/10/06 08:01:40 trebuche Exp $
7 **********************************************************************/
8 #ifndef GENERIC_H
9 #define GENERIC_H
10 //----------------------------------------------------------------------
11 template<class R> struct Coef;
12 template<class R> struct Ind;
13 //----------------------------------------------------------------------
14 template<class T> class cat;
15 //----------------------------------------------------------------------
16 template<class T> struct Info;
17 //----------------------------------------------------------------------
18 template <char O, class A, class B>
19 struct OP {
20  const A & op1;
21  const B & op2;
22  OP () {};
23  OP(const OP<O,A,B> & p): op1(p.op1), op2(p.op2) {};
24  OP(const A & a, const B & b) : op1(a), op2(b) {};
25 };
26 //----------------------------------------------------------------------
27 template<char O, class R, class T> struct Coef<OP<O,R,T> >
28 {
29  typedef typename Coef<R>::coeff_t coeff_t;
30 };
31 //----------------------------------------------------------------------
32 template<char O, class T, class R> struct Ind<OP<O,R,T> >
33 {
34  typedef typename R::index_t index_t;
35 };
36 //----------------------------------------------------------------------
37 template<char O, class R, class T> struct Info<OP<O,R,T> >
38 {
39  typedef typename Info<R>::coeff_t coeff_t;
40  typedef typename Info<R>::index_t index_t;
41 };
42 //----------------------------------------------------------------------
43 template <char O, class A, class B>
44 struct S_OP {
45  const A & op1;
46  const B & op2;
47  S_OP () {};
48  S_OP(const OP<O,A,B> & p): op1(p.op1), op2(p.op2) {};
49  S_OP(const A & a, const B & b) : op1(a), op2(b) {};
50 };
51 //----------------------------------------------------------------------
52 template<char O, class R, class T> struct Coef<S_OP<O,R,T> >
53 {
54  typedef typename Coef<R>::coeff_t coeff_t;
55 };
56 //----------------------------------------------------------------------
57 template<char O, class T, class R> struct Ind<S_OP<O,R,T> >
58 {
59  typedef typename R::index_t index_t;
60 };
61 //----------------------------------------------------------------------
62 //----------------------------------------------------------------------
63 //----------------------------------------------------------------------
64 //----------------------------------------------------------------------
65 template <class A, class B>
66 struct Plus {
67  const A & op1;
68  const B & op2;
69  Plus () {};
70  Plus(const Plus<A,B> & p): op1(p.op1), op2(p.op2) {};
71  Plus(const A & a, const B & b) : op1(a), op2(b) {};
72 };
73 
74 template <class A, class B>
75 struct Minus {
76  const A & op1;
77  const B & op2;
78  Minus () {};
79  Minus(const Minus<A,B> & p): op1(p.op1), op2(p.op2) {};
80  Minus(const A & a, const B & b) : op1(a), op2(b) {};
81 };
82 
83 template <class A>
84 struct UMinus {
85  const A & op;
86  UMinus () {};
87  UMinus(const UMinus<A> & p): op(p.op) {};
88  UMinus(const A & a) : op(a){};
89 };
90 
91 template <class A, class B>
92 struct Mult {
93  const A& op1;
94  const B& op2;
95  Mult() {};
96  Mult(const Mult<A,B> & p): op1(p.op1), op2(p.op2) {};
97  Mult(const A & a, const B & b) : op1(a), op2(b) {};
98 };
99 
100 template <class A, class B>
101 struct Mult_S {
102  const A& op1;
103  const B& op2;
104  Mult_S() {};
105  Mult_S(const Mult_S<A,B> & p): op1(p.op1), op2(p.op2) {};
106  Mult_S(const A & a, const B & b) : op1(a), op2(b) {};
107 };
108 
109 template <class A, class B>
110 struct S_Mult {
111  const A& op1;
112  const B& op2;
113  S_Mult() {};
114  S_Mult(const S_Mult<A,B> & p): op1(p.op1), op2(p.op2) {};
115  S_Mult(const A & a, const B & b) : op1(a), op2(b) {};
116 };
117 
118 template <class A, class B>
119 struct Divd {
120  const A& op1;
121  const B& op2;
122  Divd() {};
123  Divd(const Divd<A,B> & p): op1(p.op1), op2(p.op2) {};
124  Divd(const A & a, const B & b) : op1(a), op2(b) {};
125 };
126 //--------------------------------------------------------------------
127 template <class R> struct Coef
128 {
129  typedef typename R::coeff_t coeff_t;
130 };
131 template <class R> struct Ind
132 {
133  typedef typename R::index_t index_t;
134 };
135 //----------------------------------------------------------------------
136 template<class R, class T> struct Coef<Plus<R,T> >
137 {
138  typedef typename Coef<R>::coeff_t coeff_t;
139 };
140 
141 template <class T, class R> struct Ind<Plus<R,T> >
142 {
143  typedef typename R::index_t index_t;
144 };
145 
146 //----------------------------------------------------------------------
147 template<class R, class T> struct Info<Plus<R,T> >
148 {
149  typedef typename Info<R>::coeff_t coeff_t;
150  typedef typename Info<R>::index_t index_t;
151 };
152 
153 //---------------------------------------------------------------------
154 template <class T, class R> struct Coef<Minus<R,T> >
155 {
156  typedef typename R::coeff_t coeff_t;
157 };
158 
159 template <class T, class R> struct Ind<Minus<R,T> >
160 {
161  typedef typename R::index_t index_t;
162 };
163 //--------------------------------------------------------------------
164 template <class T, class R> struct Coef<Mult<R,T> >
165 {
166  typedef typename R::coeff_t coeff_t;
167 };
168 
169 template <class T, class R> struct Ind<Mult<R,T> >
170 {
171  typedef typename R::index_t index_t;
172 };
173 //-------------------------------------------------------------------
174 template <class T, class R> struct Coef<Mult_S<R,T> >
175 {
176  typedef typename R::coeff_t coeff_t;
177 };
178 
179 template <class T, class R> struct Ind<Mult_S<R,T> >
180 {
181  typedef typename R::index_t index_t;
182 };
183 //-------------------------------------------------------------------
184 template <class T, class R> struct Coef<S_Mult<R,T> >
185 {
186  typedef typename T::coeff_t coeff_t;
187 };
188 
189 template <class T, class R> struct Ind<S_Mult<R,T> >
190 {
191  typedef typename T::index_t index_t;
192 };
193 //------------------------------------------------------------------
194 template <class T, class R> struct Coef<Divd<R,T> >
195 {
196  typedef typename R::coeff_t coeff_t;
197 };
198 
199 //------------------------------------------------------------------
200 template <class R> struct Coef<UMinus<R> >
201 {
202  typedef typename R::coeff_t coeff_t;
203 };
204 
205 template <class R> struct Ind<UMinus<R> >
206 {
207  typedef typename R::index_t index_t;
208 };
209 //----------------------------------------------------------------------
210 #endif // //GENERIC_H
Mult()
Definition: GENERIC.hpp:95
const B & op2
Definition: GENERIC.hpp:77
Definition: GENERIC.hpp:66
Divd(const Divd< A, B > &p)
Definition: GENERIC.hpp:123
Definition: GENERIC.hpp:16
Info< R >::coeff_t coeff_t
Definition: GENERIC.hpp:39
S_OP()
Definition: GENERIC.hpp:47
R::index_t index_t
Definition: GENERIC.hpp:181
Minus(const Minus< A, B > &p)
Definition: GENERIC.hpp:79
const B & op2
Definition: GENERIC.hpp:68
Definition: GENERIC.hpp:19
T::coeff_t coeff_t
Definition: GENERIC.hpp:186
const B & op2
Definition: GENERIC.hpp:103
const B & op2
Definition: GENERIC.hpp:21
Plus(const A &a, const B &b)
Definition: GENERIC.hpp:71
R::index_t index_t
Definition: GENERIC.hpp:171
const A & op1
Definition: GENERIC.hpp:45
Mult_S()
Definition: GENERIC.hpp:104
Minus(const A &a, const B &b)
Definition: GENERIC.hpp:80
R::coeff_t coeff_t
Definition: GENERIC.hpp:196
Definition: GENERIC.hpp:84
Mult(const Mult< A, B > &p)
Definition: GENERIC.hpp:96
Plus(const Plus< A, B > &p)
Definition: GENERIC.hpp:70
S_OP(const OP< O, A, B > &p)
Definition: GENERIC.hpp:48
const B & op2
Definition: GENERIC.hpp:94
R::coeff_t coeff_t
Definition: GENERIC.hpp:129
Divd(const A &a, const B &b)
Definition: GENERIC.hpp:124
S_OP(const A &a, const B &b)
Definition: GENERIC.hpp:49
Mult_S(const Mult_S< A, B > &p)
Definition: GENERIC.hpp:105
Definition: GENERIC.hpp:11
Mult(const A &a, const B &b)
Definition: GENERIC.hpp:97
const A & op1
Definition: GENERIC.hpp:20
UMinus()
Definition: GENERIC.hpp:86
const A & op
Definition: GENERIC.hpp:85
R::coeff_t coeff_t
Definition: GENERIC.hpp:156
Divd()
Definition: GENERIC.hpp:122
OP(const A &a, const B &b)
Definition: GENERIC.hpp:24
S_Mult(const S_Mult< A, B > &p)
Definition: GENERIC.hpp:114
R::index_t index_t
Definition: GENERIC.hpp:34
T::index_t index_t
Definition: GENERIC.hpp:191
R::coeff_t coeff_t
Definition: GENERIC.hpp:166
R::index_t index_t
Definition: GENERIC.hpp:133
const A & op1
Definition: GENERIC.hpp:102
S_Mult()
Definition: GENERIC.hpp:113
const B & op2
Definition: GENERIC.hpp:112
Definition: GENERIC.hpp:44
OP(const OP< O, A, B > &p)
Definition: GENERIC.hpp:23
OP()
Definition: GENERIC.hpp:22
const A & op1
Definition: GENERIC.hpp:111
const A & op1
Definition: GENERIC.hpp:76
const A & op1
Definition: GENERIC.hpp:120
Coef< R >::coeff_t coeff_t
Definition: GENERIC.hpp:54
Info< R >::index_t index_t
Definition: GENERIC.hpp:40
const A & op1
Definition: GENERIC.hpp:93
R::index_t index_t
Definition: GENERIC.hpp:161
R::index_t index_t
Definition: GENERIC.hpp:207
Definition: GENERIC.hpp:119
Definition: GENERIC.hpp:110
R::index_t index_t
Definition: GENERIC.hpp:143
Mult_S(const A &a, const B &b)
Definition: GENERIC.hpp:106
const B & op2
Definition: GENERIC.hpp:46
Plus()
Definition: GENERIC.hpp:69
MSKstreamtypee MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t MSKint32t a
Definition: mosek.h:3833
const B & op2
Definition: GENERIC.hpp:121
Definition: GENERIC.hpp:92
const A & op1
Definition: GENERIC.hpp:67
Minus()
Definition: GENERIC.hpp:78
Info< R >::index_t index_t
Definition: GENERIC.hpp:150
S_Mult(const A &a, const B &b)
Definition: GENERIC.hpp:115
Definition: GENERIC.hpp:101
Definition: GENERIC.hpp:14
Coef< R >::coeff_t coeff_t
Definition: GENERIC.hpp:29
R::coeff_t coeff_t
Definition: GENERIC.hpp:176
Definition: GENERIC.hpp:12
R::index_t index_t
Definition: GENERIC.hpp:59
UMinus(const UMinus< A > &p)
Definition: GENERIC.hpp:87
Definition: GENERIC.hpp:75
UMinus(const A &a)
Definition: GENERIC.hpp:88
Coef< R >::coeff_t coeff_t
Definition: GENERIC.hpp:138
Info< R >::coeff_t coeff_t
Definition: GENERIC.hpp:149
R::coeff_t coeff_t
Definition: GENERIC.hpp:202
Home  |  Download & InstallContributions