Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
adbinaryoperators.hpp
Go to the documentation of this file.
1 /*
2  adbinaryoperators.hpp ADType expression templates (2 operands)
3  This file is part of gstlibs.
4 
5  Copyright (C) 2011 Christophe Prud'homme
6 
7  gstlibs is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  gstlibs is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with gstlibs; if not, write to the Free Software
19  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 
22 // Generated source file. Do not edit.
23 // /home/prudhomm/Devel/FEEL/feel/feel/feelopt/adgenerate.cpp Jun 22 2011 01:46:56
24 
25 #ifndef AD_BOPS_HPP
26 #define AD_BOPS_HPP
27 
28 /****************************************************************************
29  * Addition Operators
30  ****************************************************************************/
31 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
32 
33  This file is part of the Feel library
34 
35  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
36  Date: 2008-02-14
37 
38  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
39 
40  This library is free software; you can redistribute it and/or
41  modify it under the terms of the GNU Lesser General Public
42  License as published by the Free Software Foundation; either
43  version 3.0 of the License, or (at your option) any later version.
44 
45  This library is distributed in the hope that it will be useful,
46  but WITHOUT ANY WARRANTY; without even the implied warranty of
47  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
48  Lesser General Public License for more details.
49 
50  You should have received a copy of the GNU Lesser General Public
51  License along with this library; if not, write to the Free Software
52  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
53 */
59 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
60 
61 
62 //------------------------------- AD operators ------------------------------------------
63 
64 template<class E1, class E2>
65 inline
66 ADExpr< ADBinaryAdd< ADExpr<E1>, ADExpr<E2> > >
67 operator+ ( const ADExpr<E1> &v, const ADExpr<E2> &w )
68 {
69  typedef ADBinaryAdd<ADExpr<E1>, ADExpr<E2> > expr_t;
70  return ADExpr<expr_t> ( expr_t ( v , w ) );
71 }
72 template<class E, int Nvar, int order, int Var>
73 inline
74 ADExpr<ADBinaryAdd<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
75 operator+ ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
76 {
77  typedef typename E::value_type A;
78  typedef ADBinaryAdd<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
79  return ADExpr<expr_t>( expr_t ( e, v ) );
80 }
81 
82 template<typename A, int Nvar, int order, int Var1, int Var2>
83 inline
84 ADExpr<ADBinaryAdd<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
85 operator+ ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
86 {
87  typedef ADBinaryAdd<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
88  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
89 }
90 
91 template<class E, int Nvar, int order, int Var>
92 inline
93 ADExpr<ADBinaryAdd<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
94 operator+ ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
95 {
96  typedef typename E::value_type A;
97  typedef ADBinaryAdd<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
98  return ADExpr<expr_t> ( expr_t ( v , e ) );
99 }
100 
101 template<typename A, typename C, int Nvar, int order, int Var>
102 inline
103 ADExpr<ADBinaryAdd<ADCst<C>,ADType<A, Nvar, order, Var> > >
104 operator+ ( C a, const ADType<A, Nvar, order, Var> &e )
105 {
106  typedef ADBinaryAdd<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
107  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
108 }
109 
110 template<typename A, typename C, int Nvar, int order, int Var>
111 inline
112 ADExpr<ADBinaryAdd<ADType<A, Nvar, order, Var>,ADCst<C> > >
113 operator+ ( const ADType<A, Nvar, order, Var> &e, C a )
114 {
115  typedef ADBinaryAdd<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
116  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
117 }
118 
119 template<class E, class C>
120 inline
121 ADExpr<ADBinaryAdd<ADCst<C>,ADExpr<E> > >
122 operator+ ( C t, const ADExpr<E> &e )
123 {
124  typedef ADBinaryAdd<ADCst<C>,ADExpr<E> > expr_t;
125  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
126 }
127 
128 template<class E, class C>
129 inline
130 ADExpr<ADBinaryAdd<ADExpr<E>,ADCst<C> > >
131 operator+ ( const ADExpr<E> &e, C t )
132 {
133  typedef ADBinaryAdd<ADExpr<E>,ADCst<C> > expr_t;
134  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
135 }
136 
137 /****************************************************************************
138  * Subtraction Operators
139  ****************************************************************************/
140 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
141 
142  This file is part of the Feel library
143 
144  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
145  Date: 2008-02-14
146 
147  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
148 
149  This library is free software; you can redistribute it and/or
150  modify it under the terms of the GNU Lesser General Public
151  License as published by the Free Software Foundation; either
152  version 3.0 of the License, or (at your option) any later version.
153 
154  This library is distributed in the hope that it will be useful,
155  but WITHOUT ANY WARRANTY; without even the implied warranty of
156  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
157  Lesser General Public License for more details.
158 
159  You should have received a copy of the GNU Lesser General Public
160  License along with this library; if not, write to the Free Software
161  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
162 */
168 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
169 
170 
171 //------------------------------- AD operators ------------------------------------------
172 
173 template<class E1, class E2>
174 inline
175 ADExpr< ADBinarySubtract< ADExpr<E1>, ADExpr<E2> > >
176 operator- ( const ADExpr<E1> &v, const ADExpr<E2> &w )
177 {
178  typedef ADBinarySubtract<ADExpr<E1>, ADExpr<E2> > expr_t;
179  return ADExpr<expr_t> ( expr_t ( v , w ) );
180 }
181 template<class E, int Nvar, int order, int Var>
182 inline
183 ADExpr<ADBinarySubtract<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
184 operator- ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
185 {
186  typedef typename E::value_type A;
187  typedef ADBinarySubtract<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
188  return ADExpr<expr_t>( expr_t ( e, v ) );
189 }
190 
191 template<typename A, int Nvar, int order, int Var1, int Var2>
192 inline
193 ADExpr<ADBinarySubtract<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
194 operator- ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
195 {
196  typedef ADBinarySubtract<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
197  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
198 }
199 
200 template<class E, int Nvar, int order, int Var>
201 inline
202 ADExpr<ADBinarySubtract<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
203 operator- ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
204 {
205  typedef typename E::value_type A;
206  typedef ADBinarySubtract<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
207  return ADExpr<expr_t> ( expr_t ( v , e ) );
208 }
209 
210 template<typename A, typename C, int Nvar, int order, int Var>
211 inline
212 ADExpr<ADBinarySubtract<ADCst<C>,ADType<A, Nvar, order, Var> > >
213 operator- ( C a, const ADType<A, Nvar, order, Var> &e )
214 {
215  typedef ADBinarySubtract<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
216  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
217 }
218 
219 template<typename A, typename C, int Nvar, int order, int Var>
220 inline
221 ADExpr<ADBinarySubtract<ADType<A, Nvar, order, Var>,ADCst<C> > >
222 operator- ( const ADType<A, Nvar, order, Var> &e, C a )
223 {
224  typedef ADBinarySubtract<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
225  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
226 }
227 
228 template<class E, class C>
229 inline
230 ADExpr<ADBinarySubtract<ADCst<C>,ADExpr<E> > >
231 operator- ( C t, const ADExpr<E> &e )
232 {
233  typedef ADBinarySubtract<ADCst<C>,ADExpr<E> > expr_t;
234  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
235 }
236 
237 template<class E, class C>
238 inline
239 ADExpr<ADBinarySubtract<ADExpr<E>,ADCst<C> > >
240 operator- ( const ADExpr<E> &e, C t )
241 {
242  typedef ADBinarySubtract<ADExpr<E>,ADCst<C> > expr_t;
243  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
244 }
245 
246 /****************************************************************************
247  * Multiplication Operators
248  ****************************************************************************/
249 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
250 
251  This file is part of the Feel library
252 
253  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
254  Date: 2008-02-14
255 
256  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
257 
258  This library is free software; you can redistribute it and/or
259  modify it under the terms of the GNU Lesser General Public
260  License as published by the Free Software Foundation; either
261  version 3.0 of the License, or (at your option) any later version.
262 
263  This library is distributed in the hope that it will be useful,
264  but WITHOUT ANY WARRANTY; without even the implied warranty of
265  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
266  Lesser General Public License for more details.
267 
268  You should have received a copy of the GNU Lesser General Public
269  License along with this library; if not, write to the Free Software
270  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
271 */
277 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
278 
279 
280 //------------------------------- AD operators ------------------------------------------
281 
282 template<class E1, class E2>
283 inline
284 ADExpr< ADBinaryMultiply< ADExpr<E1>, ADExpr<E2> > >
285 operator* ( const ADExpr<E1> &v, const ADExpr<E2> &w )
286 {
287  typedef ADBinaryMultiply<ADExpr<E1>, ADExpr<E2> > expr_t;
288  return ADExpr<expr_t> ( expr_t ( v , w ) );
289 }
290 template<class E, int Nvar, int order, int Var>
291 inline
292 ADExpr<ADBinaryMultiply<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
293 operator* ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
294 {
295  typedef typename E::value_type A;
296  typedef ADBinaryMultiply<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
297  return ADExpr<expr_t>( expr_t ( e, v ) );
298 }
299 
300 template<typename A, int Nvar, int order, int Var1, int Var2>
301 inline
302 ADExpr<ADBinaryMultiply<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
303 operator* ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
304 {
305  typedef ADBinaryMultiply<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
306  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
307 }
308 
309 template<class E, int Nvar, int order, int Var>
310 inline
311 ADExpr<ADBinaryMultiply<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
312 operator* ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
313 {
314  typedef typename E::value_type A;
315  typedef ADBinaryMultiply<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
316  return ADExpr<expr_t> ( expr_t ( v , e ) );
317 }
318 
319 template<typename A, typename C, int Nvar, int order, int Var>
320 inline
321 ADExpr<ADBinaryMultiply<ADCst<C>,ADType<A, Nvar, order, Var> > >
322 operator* ( C a, const ADType<A, Nvar, order, Var> &e )
323 {
324  typedef ADBinaryMultiply<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
325  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
326 }
327 
328 template<typename A, typename C, int Nvar, int order, int Var>
329 inline
330 ADExpr<ADBinaryMultiply<ADType<A, Nvar, order, Var>,ADCst<C> > >
331 operator* ( const ADType<A, Nvar, order, Var> &e, C a )
332 {
333  typedef ADBinaryMultiply<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
334  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
335 }
336 
337 template<class E, class C>
338 inline
339 ADExpr<ADBinaryMultiply<ADCst<C>,ADExpr<E> > >
340 operator* ( C t, const ADExpr<E> &e )
341 {
342  typedef ADBinaryMultiply<ADCst<C>,ADExpr<E> > expr_t;
343  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
344 }
345 
346 template<class E, class C>
347 inline
348 ADExpr<ADBinaryMultiply<ADExpr<E>,ADCst<C> > >
349 operator* ( const ADExpr<E> &e, C t )
350 {
351  typedef ADBinaryMultiply<ADExpr<E>,ADCst<C> > expr_t;
352  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
353 }
354 
355 /****************************************************************************
356  * Division Operators
357  ****************************************************************************/
358 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
359 
360  This file is part of the Feel library
361 
362  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
363  Date: 2008-02-14
364 
365  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
366 
367  This library is free software; you can redistribute it and/or
368  modify it under the terms of the GNU Lesser General Public
369  License as published by the Free Software Foundation; either
370  version 3.0 of the License, or (at your option) any later version.
371 
372  This library is distributed in the hope that it will be useful,
373  but WITHOUT ANY WARRANTY; without even the implied warranty of
374  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
375  Lesser General Public License for more details.
376 
377  You should have received a copy of the GNU Lesser General Public
378  License along with this library; if not, write to the Free Software
379  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
380 */
386 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
387 
388 
389 //------------------------------- AD operators ------------------------------------------
390 
391 template<class E1, class E2>
392 inline
393 ADExpr< ADBinaryDivide< ADExpr<E1>, ADExpr<E2> > >
394 operator/ ( const ADExpr<E1> &v, const ADExpr<E2> &w )
395 {
396  typedef ADBinaryDivide<ADExpr<E1>, ADExpr<E2> > expr_t;
397  return ADExpr<expr_t> ( expr_t ( v , w ) );
398 }
399 template<class E, int Nvar, int order, int Var>
400 inline
401 ADExpr<ADBinaryDivide<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
402 operator/ ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
403 {
404  typedef typename E::value_type A;
405  typedef ADBinaryDivide<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
406  return ADExpr<expr_t>( expr_t ( e, v ) );
407 }
408 
409 template<typename A, int Nvar, int order, int Var1, int Var2>
410 inline
411 ADExpr<ADBinaryDivide<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
412 operator/ ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
413 {
414  typedef ADBinaryDivide<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
415  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
416 }
417 
418 template<class E, int Nvar, int order, int Var>
419 inline
420 ADExpr<ADBinaryDivide<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
421 operator/ ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
422 {
423  typedef typename E::value_type A;
424  typedef ADBinaryDivide<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
425  return ADExpr<expr_t> ( expr_t ( v , e ) );
426 }
427 
428 template<typename A, typename C, int Nvar, int order, int Var>
429 inline
430 ADExpr<ADBinaryDivide<ADCst<C>,ADType<A, Nvar, order, Var> > >
431 operator/ ( C a, const ADType<A, Nvar, order, Var> &e )
432 {
433  typedef ADBinaryDivide<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
434  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
435 }
436 
437 template<typename A, typename C, int Nvar, int order, int Var>
438 inline
439 ADExpr<ADBinaryDivide<ADType<A, Nvar, order, Var>,ADCst<C> > >
440 operator/ ( const ADType<A, Nvar, order, Var> &e, C a )
441 {
442  typedef ADBinaryDivide<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
443  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
444 }
445 
446 template<class E, class C>
447 inline
448 ADExpr<ADBinaryDivide<ADCst<C>,ADExpr<E> > >
449 operator/ ( C t, const ADExpr<E> &e )
450 {
451  typedef ADBinaryDivide<ADCst<C>,ADExpr<E> > expr_t;
452  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
453 }
454 
455 template<class E, class C>
456 inline
457 ADExpr<ADBinaryDivide<ADExpr<E>,ADCst<C> > >
458 operator/ ( const ADExpr<E> &e, C t )
459 {
460  typedef ADBinaryDivide<ADExpr<E>,ADCst<C> > expr_t;
461  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
462 }
463 
464 /****************************************************************************
465  * Pow Operators
466  ****************************************************************************/
467 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
468 
469  This file is part of the Feel library
470 
471  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
472  Date: 2008-02-14
473 
474  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
475 
476  This library is free software; you can redistribute it and/or
477  modify it under the terms of the GNU Lesser General Public
478  License as published by the Free Software Foundation; either
479  version 3.0 of the License, or (at your option) any later version.
480 
481  This library is distributed in the hope that it will be useful,
482  but WITHOUT ANY WARRANTY; without even the implied warranty of
483  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484  Lesser General Public License for more details.
485 
486  You should have received a copy of the GNU Lesser General Public
487  License along with this library; if not, write to the Free Software
488  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
489 */
495 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
496 
497 
498 //------------------------------- AD operators ------------------------------------------
499 
500 template<class E1, class E2>
501 inline
502 ADExpr< ADBinaryPow< ADExpr<E1>, ADExpr<E2> > >
503 operator^ ( const ADExpr<E1> &v, const ADExpr<E2> &w )
504 {
505  typedef ADBinaryPow<ADExpr<E1>, ADExpr<E2> > expr_t;
506  return ADExpr<expr_t> ( expr_t ( v , w ) );
507 }
508 template<class E, int Nvar, int order, int Var>
509 inline
510 ADExpr<ADBinaryPow<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
511 operator^ ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
512 {
513  typedef typename E::value_type A;
514  typedef ADBinaryPow<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
515  return ADExpr<expr_t>( expr_t ( e, v ) );
516 }
517 
518 template<typename A, int Nvar, int order, int Var1, int Var2>
519 inline
520 ADExpr<ADBinaryPow<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
521 operator^ ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
522 {
523  typedef ADBinaryPow<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
524  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
525 }
526 
527 template<class E, int Nvar, int order, int Var>
528 inline
529 ADExpr<ADBinaryPow<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
530 operator^ ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
531 {
532  typedef typename E::value_type A;
533  typedef ADBinaryPow<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
534  return ADExpr<expr_t> ( expr_t ( v , e ) );
535 }
536 
537 template<typename A, typename C, int Nvar, int order, int Var>
538 inline
539 ADExpr<ADBinaryPow<ADCst<C>,ADType<A, Nvar, order, Var> > >
540 operator^ ( C a, const ADType<A, Nvar, order, Var> &e )
541 {
542  typedef ADBinaryPow<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
543  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
544 }
545 
546 template<typename A, typename C, int Nvar, int order, int Var>
547 inline
548 ADExpr<ADBinaryPow<ADType<A, Nvar, order, Var>,ADCst<C> > >
549 operator^ ( const ADType<A, Nvar, order, Var> &e, C a )
550 {
551  typedef ADBinaryPow<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
552  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
553 }
554 
555 template<class E, class C>
556 inline
557 ADExpr<ADBinaryPow<ADCst<C>,ADExpr<E> > >
558 operator^ ( C t, const ADExpr<E> &e )
559 {
560  typedef ADBinaryPow<ADCst<C>,ADExpr<E> > expr_t;
561  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
562 }
563 
564 template<class E, class C>
565 inline
566 ADExpr<ADBinaryPow<ADExpr<E>,ADCst<C> > >
567 operator^ ( const ADExpr<E> &e, C t )
568 {
569  typedef ADBinaryPow<ADExpr<E>,ADCst<C> > expr_t;
570  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
571 }
572 
573 /****************************************************************************
574  * Greater-than Operators
575  ****************************************************************************/
576 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
577 
578  This file is part of the Feel library
579 
580  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
581  Date: 2008-02-14
582 
583  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
584 
585  This library is free software; you can redistribute it and/or
586  modify it under the terms of the GNU Lesser General Public
587  License as published by the Free Software Foundation; either
588  version 3.0 of the License, or (at your option) any later version.
589 
590  This library is distributed in the hope that it will be useful,
591  but WITHOUT ANY WARRANTY; without even the implied warranty of
592  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
593  Lesser General Public License for more details.
594 
595  You should have received a copy of the GNU Lesser General Public
596  License along with this library; if not, write to the Free Software
597  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
598 */
604 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
605 
606 
607 //------------------------------- AD operators ------------------------------------------
608 
609 template<class E1, class E2>
610 inline
611 ADExpr< ADBinaryGreater< ADExpr<E1>, ADExpr<E2> > >
612 operator> ( const ADExpr<E1> &v, const ADExpr<E2> &w )
613 {
614  typedef ADBinaryGreater<ADExpr<E1>, ADExpr<E2> > expr_t;
615  return ADExpr<expr_t> ( expr_t ( v , w ) );
616 }
617 template<class E, int Nvar, int order, int Var>
618 inline
619 ADExpr<ADBinaryGreater<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
620 operator> ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
621 {
622  typedef typename E::value_type A;
623  typedef ADBinaryGreater<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
624  return ADExpr<expr_t>( expr_t ( e, v ) );
625 }
626 
627 template<typename A, int Nvar, int order, int Var1, int Var2>
628 inline
629 ADExpr<ADBinaryGreater<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
630 operator> ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
631 {
632  typedef ADBinaryGreater<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
633  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
634 }
635 
636 template<class E, int Nvar, int order, int Var>
637 inline
638 ADExpr<ADBinaryGreater<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
639 operator> ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
640 {
641  typedef typename E::value_type A;
642  typedef ADBinaryGreater<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
643  return ADExpr<expr_t> ( expr_t ( v , e ) );
644 }
645 
646 template<typename A, typename C, int Nvar, int order, int Var>
647 inline
648 ADExpr<ADBinaryGreater<ADCst<C>,ADType<A, Nvar, order, Var> > >
649 operator> ( C a, const ADType<A, Nvar, order, Var> &e )
650 {
651  typedef ADBinaryGreater<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
652  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
653 }
654 
655 template<typename A, typename C, int Nvar, int order, int Var>
656 inline
657 ADExpr<ADBinaryGreater<ADType<A, Nvar, order, Var>,ADCst<C> > >
658 operator> ( const ADType<A, Nvar, order, Var> &e, C a )
659 {
660  typedef ADBinaryGreater<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
661  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
662 }
663 
664 template<class E, class C>
665 inline
666 ADExpr<ADBinaryGreater<ADCst<C>,ADExpr<E> > >
667 operator> ( C t, const ADExpr<E> &e )
668 {
669  typedef ADBinaryGreater<ADCst<C>,ADExpr<E> > expr_t;
670  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
671 }
672 
673 template<class E, class C>
674 inline
675 ADExpr<ADBinaryGreater<ADExpr<E>,ADCst<C> > >
676 operator> ( const ADExpr<E> &e, C t )
677 {
678  typedef ADBinaryGreater<ADExpr<E>,ADCst<C> > expr_t;
679  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
680 }
681 
682 /****************************************************************************
683  * Less-than Operators
684  ****************************************************************************/
685 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
686 
687  This file is part of the Feel library
688 
689  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
690  Date: 2008-02-14
691 
692  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
693 
694  This library is free software; you can redistribute it and/or
695  modify it under the terms of the GNU Lesser General Public
696  License as published by the Free Software Foundation; either
697  version 3.0 of the License, or (at your option) any later version.
698 
699  This library is distributed in the hope that it will be useful,
700  but WITHOUT ANY WARRANTY; without even the implied warranty of
701  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
702  Lesser General Public License for more details.
703 
704  You should have received a copy of the GNU Lesser General Public
705  License along with this library; if not, write to the Free Software
706  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
707 */
713 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
714 
715 
716 //------------------------------- AD operators ------------------------------------------
717 
718 template<class E1, class E2>
719 inline
720 ADExpr< ADBinaryLess< ADExpr<E1>, ADExpr<E2> > >
721 operator< ( const ADExpr<E1> &v, const ADExpr<E2> &w )
722 {
723  typedef ADBinaryLess<ADExpr<E1>, ADExpr<E2> > expr_t;
724  return ADExpr<expr_t> ( expr_t ( v , w ) );
725 }
726 template<class E, int Nvar, int order, int Var>
727 inline
728 ADExpr<ADBinaryLess<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
729 operator< ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
730 {
731  typedef typename E::value_type A;
732  typedef ADBinaryLess<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
733  return ADExpr<expr_t>( expr_t ( e, v ) );
734 }
735 
736 template<typename A, int Nvar, int order, int Var1, int Var2>
737 inline
738 ADExpr<ADBinaryLess<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
739 operator< ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
740 {
741  typedef ADBinaryLess<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
742  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
743 }
744 
745 template<class E, int Nvar, int order, int Var>
746 inline
747 ADExpr<ADBinaryLess<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
748 operator< ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
749 {
750  typedef typename E::value_type A;
751  typedef ADBinaryLess<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
752  return ADExpr<expr_t> ( expr_t ( v , e ) );
753 }
754 
755 template<typename A, typename C, int Nvar, int order, int Var>
756 inline
757 ADExpr<ADBinaryLess<ADCst<C>,ADType<A, Nvar, order, Var> > >
758 operator< ( C a, const ADType<A, Nvar, order, Var> &e )
759 {
760  typedef ADBinaryLess<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
761  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
762 }
763 
764 template<typename A, typename C, int Nvar, int order, int Var>
765 inline
766 ADExpr<ADBinaryLess<ADType<A, Nvar, order, Var>,ADCst<C> > >
767 operator< ( const ADType<A, Nvar, order, Var> &e, C a )
768 {
769  typedef ADBinaryLess<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
770  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
771 }
772 
773 template<class E, class C>
774 inline
775 ADExpr<ADBinaryLess<ADCst<C>,ADExpr<E> > >
776 operator< ( C t, const ADExpr<E> &e )
777 {
778  typedef ADBinaryLess<ADCst<C>,ADExpr<E> > expr_t;
779  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
780 }
781 
782 template<class E, class C>
783 inline
784 ADExpr<ADBinaryLess<ADExpr<E>,ADCst<C> > >
785 operator< ( const ADExpr<E> &e, C t )
786 {
787  typedef ADBinaryLess<ADExpr<E>,ADCst<C> > expr_t;
788  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
789 }
790 
791 /****************************************************************************
792  * Greater or equal (>=) operators
793  ****************************************************************************/
794 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
795 
796  This file is part of the Feel library
797 
798  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
799  Date: 2008-02-14
800 
801  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
802 
803  This library is free software; you can redistribute it and/or
804  modify it under the terms of the GNU Lesser General Public
805  License as published by the Free Software Foundation; either
806  version 3.0 of the License, or (at your option) any later version.
807 
808  This library is distributed in the hope that it will be useful,
809  but WITHOUT ANY WARRANTY; without even the implied warranty of
810  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
811  Lesser General Public License for more details.
812 
813  You should have received a copy of the GNU Lesser General Public
814  License along with this library; if not, write to the Free Software
815  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
816 */
822 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
823 
824 
825 //------------------------------- AD operators ------------------------------------------
826 
827 template<class E1, class E2>
828 inline
829 ADExpr< ADBinaryGreaterOrEqual< ADExpr<E1>, ADExpr<E2> > >
830 operator>= ( const ADExpr<E1> &v, const ADExpr<E2> &w )
831 {
832  typedef ADBinaryGreaterOrEqual<ADExpr<E1>, ADExpr<E2> > expr_t;
833  return ADExpr<expr_t> ( expr_t ( v , w ) );
834 }
835 template<class E, int Nvar, int order, int Var>
836 inline
837 ADExpr<ADBinaryGreaterOrEqual<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
838 operator>= ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
839 {
840  typedef typename E::value_type A;
841  typedef ADBinaryGreaterOrEqual<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
842  return ADExpr<expr_t>( expr_t ( e, v ) );
843 }
844 
845 template<typename A, int Nvar, int order, int Var1, int Var2>
846 inline
847 ADExpr<ADBinaryGreaterOrEqual<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
848 operator>= ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
849 {
850  typedef ADBinaryGreaterOrEqual<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
851  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
852 }
853 
854 template<class E, int Nvar, int order, int Var>
855 inline
856 ADExpr<ADBinaryGreaterOrEqual<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
857 operator>= ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
858 {
859  typedef typename E::value_type A;
860  typedef ADBinaryGreaterOrEqual<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
861  return ADExpr<expr_t> ( expr_t ( v , e ) );
862 }
863 
864 template<typename A, typename C, int Nvar, int order, int Var>
865 inline
866 ADExpr<ADBinaryGreaterOrEqual<ADCst<C>,ADType<A, Nvar, order, Var> > >
867 operator>= ( C a, const ADType<A, Nvar, order, Var> &e )
868 {
869  typedef ADBinaryGreaterOrEqual<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
870  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
871 }
872 
873 template<typename A, typename C, int Nvar, int order, int Var>
874 inline
875 ADExpr<ADBinaryGreaterOrEqual<ADType<A, Nvar, order, Var>,ADCst<C> > >
876 operator>= ( const ADType<A, Nvar, order, Var> &e, C a )
877 {
878  typedef ADBinaryGreaterOrEqual<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
879  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
880 }
881 
882 template<class E, class C>
883 inline
884 ADExpr<ADBinaryGreaterOrEqual<ADCst<C>,ADExpr<E> > >
885 operator>= ( C t, const ADExpr<E> &e )
886 {
887  typedef ADBinaryGreaterOrEqual<ADCst<C>,ADExpr<E> > expr_t;
888  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
889 }
890 
891 template<class E, class C>
892 inline
893 ADExpr<ADBinaryGreaterOrEqual<ADExpr<E>,ADCst<C> > >
894 operator>= ( const ADExpr<E> &e, C t )
895 {
896  typedef ADBinaryGreaterOrEqual<ADExpr<E>,ADCst<C> > expr_t;
897  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
898 }
899 
900 /****************************************************************************
901  * Less or equal (<=) operators
902  ****************************************************************************/
903 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
904 
905  This file is part of the Feel library
906 
907  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
908  Date: 2008-02-14
909 
910  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
911 
912  This library is free software; you can redistribute it and/or
913  modify it under the terms of the GNU Lesser General Public
914  License as published by the Free Software Foundation; either
915  version 3.0 of the License, or (at your option) any later version.
916 
917  This library is distributed in the hope that it will be useful,
918  but WITHOUT ANY WARRANTY; without even the implied warranty of
919  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
920  Lesser General Public License for more details.
921 
922  You should have received a copy of the GNU Lesser General Public
923  License along with this library; if not, write to the Free Software
924  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
925 */
931 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
932 
933 
934 //------------------------------- AD operators ------------------------------------------
935 
936 template<class E1, class E2>
937 inline
938 ADExpr< ADBinaryLessOrEqual< ADExpr<E1>, ADExpr<E2> > >
939 operator<= ( const ADExpr<E1> &v, const ADExpr<E2> &w )
940 {
941  typedef ADBinaryLessOrEqual<ADExpr<E1>, ADExpr<E2> > expr_t;
942  return ADExpr<expr_t> ( expr_t ( v , w ) );
943 }
944 template<class E, int Nvar, int order, int Var>
945 inline
946 ADExpr<ADBinaryLessOrEqual<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
947 operator<= ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
948 {
949  typedef typename E::value_type A;
950  typedef ADBinaryLessOrEqual<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
951  return ADExpr<expr_t>( expr_t ( e, v ) );
952 }
953 
954 template<typename A, int Nvar, int order, int Var1, int Var2>
955 inline
956 ADExpr<ADBinaryLessOrEqual<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
957 operator<= ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
958 {
959  typedef ADBinaryLessOrEqual<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
960  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
961 }
962 
963 template<class E, int Nvar, int order, int Var>
964 inline
965 ADExpr<ADBinaryLessOrEqual<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
966 operator<= ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
967 {
968  typedef typename E::value_type A;
969  typedef ADBinaryLessOrEqual<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
970  return ADExpr<expr_t> ( expr_t ( v , e ) );
971 }
972 
973 template<typename A, typename C, int Nvar, int order, int Var>
974 inline
975 ADExpr<ADBinaryLessOrEqual<ADCst<C>,ADType<A, Nvar, order, Var> > >
976 operator<= ( C a, const ADType<A, Nvar, order, Var> &e )
977 {
978  typedef ADBinaryLessOrEqual<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
979  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
980 }
981 
982 template<typename A, typename C, int Nvar, int order, int Var>
983 inline
984 ADExpr<ADBinaryLessOrEqual<ADType<A, Nvar, order, Var>,ADCst<C> > >
985 operator<= ( const ADType<A, Nvar, order, Var> &e, C a )
986 {
987  typedef ADBinaryLessOrEqual<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
988  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
989 }
990 
991 template<class E, class C>
992 inline
993 ADExpr<ADBinaryLessOrEqual<ADCst<C>,ADExpr<E> > >
994 operator<= ( C t, const ADExpr<E> &e )
995 {
996  typedef ADBinaryLessOrEqual<ADCst<C>,ADExpr<E> > expr_t;
997  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
998 }
999 
1000 template<class E, class C>
1001 inline
1002 ADExpr<ADBinaryLessOrEqual<ADExpr<E>,ADCst<C> > >
1003 operator<= ( const ADExpr<E> &e, C t )
1004 {
1005  typedef ADBinaryLessOrEqual<ADExpr<E>,ADCst<C> > expr_t;
1006  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
1007 }
1008 
1009 /****************************************************************************
1010  * Equality operators
1011  ****************************************************************************/
1012 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
1013 
1014  This file is part of the Feel library
1015 
1016  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
1017  Date: 2008-02-14
1018 
1019  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
1020 
1021  This library is free software; you can redistribute it and/or
1022  modify it under the terms of the GNU Lesser General Public
1023  License as published by the Free Software Foundation; either
1024  version 3.0 of the License, or (at your option) any later version.
1025 
1026  This library is distributed in the hope that it will be useful,
1027  but WITHOUT ANY WARRANTY; without even the implied warranty of
1028  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1029  Lesser General Public License for more details.
1030 
1031  You should have received a copy of the GNU Lesser General Public
1032  License along with this library; if not, write to the Free Software
1033  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1034 */
1040 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
1041 
1042 
1043 //------------------------------- AD operators ------------------------------------------
1044 
1045 template<class E1, class E2>
1046 inline
1047 ADExpr< ADBinaryEqual< ADExpr<E1>, ADExpr<E2> > >
1048 operator== ( const ADExpr<E1> &v, const ADExpr<E2> &w )
1049 {
1050  typedef ADBinaryEqual<ADExpr<E1>, ADExpr<E2> > expr_t;
1051  return ADExpr<expr_t> ( expr_t ( v , w ) );
1052 }
1053 template<class E, int Nvar, int order, int Var>
1054 inline
1055 ADExpr<ADBinaryEqual<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
1056 operator== ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
1057 {
1058  typedef typename E::value_type A;
1059  typedef ADBinaryEqual<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
1060  return ADExpr<expr_t>( expr_t ( e, v ) );
1061 }
1062 
1063 template<typename A, int Nvar, int order, int Var1, int Var2>
1064 inline
1065 ADExpr<ADBinaryEqual<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
1066 operator== ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
1067 {
1068  typedef ADBinaryEqual<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
1069  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
1070 }
1071 
1072 template<class E, int Nvar, int order, int Var>
1073 inline
1074 ADExpr<ADBinaryEqual<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
1075 operator== ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
1076 {
1077  typedef typename E::value_type A;
1078  typedef ADBinaryEqual<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
1079  return ADExpr<expr_t> ( expr_t ( v , e ) );
1080 }
1081 
1082 template<typename A, typename C, int Nvar, int order, int Var>
1083 inline
1084 ADExpr<ADBinaryEqual<ADCst<C>,ADType<A, Nvar, order, Var> > >
1085 operator== ( C a, const ADType<A, Nvar, order, Var> &e )
1086 {
1087  typedef ADBinaryEqual<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
1088  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
1089 }
1090 
1091 template<typename A, typename C, int Nvar, int order, int Var>
1092 inline
1093 ADExpr<ADBinaryEqual<ADType<A, Nvar, order, Var>,ADCst<C> > >
1094 operator== ( const ADType<A, Nvar, order, Var> &e, C a )
1095 {
1096  typedef ADBinaryEqual<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
1097  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
1098 }
1099 
1100 template<class E, class C>
1101 inline
1102 ADExpr<ADBinaryEqual<ADCst<C>,ADExpr<E> > >
1103 operator== ( C t, const ADExpr<E> &e )
1104 {
1105  typedef ADBinaryEqual<ADCst<C>,ADExpr<E> > expr_t;
1106  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
1107 }
1108 
1109 template<class E, class C>
1110 inline
1111 ADExpr<ADBinaryEqual<ADExpr<E>,ADCst<C> > >
1112 operator== ( const ADExpr<E> &e, C t )
1113 {
1114  typedef ADBinaryEqual<ADExpr<E>,ADCst<C> > expr_t;
1115  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
1116 }
1117 
1118 /****************************************************************************
1119  * Not-equal operators
1120  ****************************************************************************/
1121 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
1122 
1123  This file is part of the Feel library
1124 
1125  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
1126  Date: 2008-02-14
1127 
1128  Copyright (C) 2008 Université Joseph Fourier (Grenoble I)
1129 
1130  This library is free software; you can redistribute it and/or
1131  modify it under the terms of the GNU Lesser General Public
1132  License as published by the Free Software Foundation; either
1133  version 3.0 of the License, or (at your option) any later version.
1134 
1135  This library is distributed in the hope that it will be useful,
1136  but WITHOUT ANY WARRANTY; without even the implied warranty of
1137  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1138  Lesser General Public License for more details.
1139 
1140  You should have received a copy of the GNU Lesser General Public
1141  License along with this library; if not, write to the Free Software
1142  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1143 */
1149 // -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
1150 
1151 
1152 //------------------------------- AD operators ------------------------------------------
1153 
1154 template<class E1, class E2>
1155 inline
1156 ADExpr< ADBinaryNotEqual< ADExpr<E1>, ADExpr<E2> > >
1157 operator!= ( const ADExpr<E1> &v, const ADExpr<E2> &w )
1158 {
1159  typedef ADBinaryNotEqual<ADExpr<E1>, ADExpr<E2> > expr_t;
1160  return ADExpr<expr_t> ( expr_t ( v , w ) );
1161 }
1162 template<class E, int Nvar, int order, int Var>
1163 inline
1164 ADExpr<ADBinaryNotEqual<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > >
1165 operator!= ( const ADExpr<E> &e,const ADType<typename E::value_type, Nvar, order, Var>& v )
1166 {
1167  typedef typename E::value_type A;
1168  typedef ADBinaryNotEqual<ADExpr<E>,ADType<typename E::value_type, Nvar, order, Var> > expr_t;
1169  return ADExpr<expr_t>( expr_t ( e, v ) );
1170 }
1171 
1172 template<typename A, int Nvar, int order, int Var1, int Var2>
1173 inline
1174 ADExpr<ADBinaryNotEqual<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > >
1175 operator!= ( const ADType<A, Nvar, order, Var1> &e1,const ADType<A, Nvar, order, Var2>& e2 )
1176 {
1177  typedef ADBinaryNotEqual<ADType<A, Nvar, order, Var1>,ADType<A, Nvar, order, Var2> > expr_t;
1178  return ADExpr<expr_t>( expr_t ( e1 , e2 ) );
1179 }
1180 
1181 template<class E, int Nvar, int order, int Var>
1182 inline
1183 ADExpr<ADBinaryNotEqual<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > >
1184 operator!= ( const ADType<typename E::value_type, Nvar, order, Var> &v, const ADExpr<E> &e )
1185 {
1186  typedef typename E::value_type A;
1187  typedef ADBinaryNotEqual<ADType<typename E::value_type, Nvar, order, Var>,ADExpr<E> > expr_t;
1188  return ADExpr<expr_t> ( expr_t ( v , e ) );
1189 }
1190 
1191 template<typename A, typename C, int Nvar, int order, int Var>
1192 inline
1193 ADExpr<ADBinaryNotEqual<ADCst<C>,ADType<A, Nvar, order, Var> > >
1194 operator!= ( C a, const ADType<A, Nvar, order, Var> &e )
1195 {
1196  typedef ADBinaryNotEqual<ADCst<C>,ADType<A, Nvar, order, Var> > expr_t;
1197  return ADExpr<expr_t> ( expr_t ( ADCst<C>( a ), e ) );
1198 }
1199 
1200 template<typename A, typename C, int Nvar, int order, int Var>
1201 inline
1202 ADExpr<ADBinaryNotEqual<ADType<A, Nvar, order, Var>,ADCst<C> > >
1203 operator!= ( const ADType<A, Nvar, order, Var> &e, C a )
1204 {
1205  typedef ADBinaryNotEqual<ADType<A, Nvar, order, Var>,ADCst<C> > expr_t;
1206  return ADExpr<expr_t>( expr_t ( e ,ADCst<C>( a ) ) );
1207 }
1208 
1209 template<class E, class C>
1210 inline
1211 ADExpr<ADBinaryNotEqual<ADCst<C>,ADExpr<E> > >
1212 operator!= ( C t, const ADExpr<E> &e )
1213 {
1214  typedef ADBinaryNotEqual<ADCst<C>,ADExpr<E> > expr_t;
1215  return ADExpr<expr_t> ( expr_t ( ADCst<C> ( t ),e ) );
1216 }
1217 
1218 template<class E, class C>
1219 inline
1220 ADExpr<ADBinaryNotEqual<ADExpr<E>,ADCst<C> > >
1221 operator!= ( const ADExpr<E> &e, C t )
1222 {
1223  typedef ADBinaryNotEqual<ADExpr<E>,ADCst<C> > expr_t;
1224  return ADExpr<expr_t>( expr_t ( e, ADCst<C> ( t ) ) );
1225 }
1226 
1227 
1228 #endif
bool operator>=(const BareEdge &e1, const BareEdge &e2)
Definition: bareitems.hpp:380
bool operator==(const BareEdge &p1, const BareEdge &p2)
Definition: bareitems.hpp:360
bool operator!=(const BareEdge &p1, const BareEdge &p2)
Definition: bareitems.hpp:350
bool operator>(const BareEdge &e1, const BareEdge &e2)
Definition: bareitems.hpp:370

Generated on Sun Dec 22 2013 13:10:54 for Feel++ by doxygen 1.8.5