NeoPZ
fadop.h
Go to the documentation of this file.
1 // Emacs will be in -*- Mode: c++ -*-
2 //
3 // ************ DO NOT REMOVE THIS BANNER ****************
4 //
5 // Nicolas Di Cesare <Nicolas.Dicesare@ann.jussieu.fr>
6 // http://www.ann.jussieu.fr/~dicesare
7 //
8 // CEMRACS 98 : C++ courses,
9 // templates : new C++ techniques
10 // for scientific computing
11 //
12 //********************************************************
13 //
14 // A short implementation ( not all operators and
15 // functions are overloaded ) of 1st order Automatic
16 // Differentiation in forward mode (FAD) using
17 // EXPRESSION TEMPLATES.
18 //
19 //********************************************************
20 #ifndef _fadop_h_
21 #define _fadop_h_
22 
23 using namespace std;
24 //------------------------------- Fad binary operators ------------------------------------------
25 
26 
27 //------------------------------- Fad addition operators ------------------------------------------
28 template <typename L, typename R> class FadBinaryAdd {
29 public:
30  typedef typename L::value_type value_type_L;
31  typedef typename R::value_type value_type_R;
32 
34 
35 protected:
37 
38  const L& left_; const R& right_;
39 
40 public:
41  FadBinaryAdd(const L& left, const R& right) : left_(left), right_(right) {;}
43 
44 
45  const value_type val() const {return left_.val() + right_.val();}
46  const value_type dx(int i) const {return left_.dx(i) + right_.dx(i);}
47  int size() const {
48  int lsz = left_.size(), rsz = right_.size();
49  return max(lsz, rsz);
50  }
51 
52  bool hasFastAccess() const { return left_.hasFastAccess() && right_.hasFastAccess();}
53  value_type fastAccessDx(int i) const { return left_.fastAccessDx(i)+right_.fastAccessDx(i);}
54 };
55 
56 
57 template <typename L, typename R> class FadBinaryAdd<L, FadCst<R> > {
58 public:
59  typedef typename L::value_type value_type_L;
60  typedef R value_type_R;
62 
63 protected:
65 
66  const L& left_; const FadCst<R> right_;
67 
68 public:
69  FadBinaryAdd(const L& left, const FadCst<R>& right) : left_(left), right_(right) {;}
71 
72 
73  const value_type val() const {return left_.val() + right_.val();}
74  const value_type dx(int i) const {return left_.dx(i);}
75  int size() const { return left_.size();}
76 
77  bool hasFastAccess() const { return left_.hasFastAccess();}
78  value_type fastAccessDx(int i) const { return left_.fastAccessDx(i);}
79 };
80 
81 
82 template <typename L, typename R> class FadBinaryAdd< FadCst<L>, R> {
83 public:
84  typedef L value_type_L;
85  typedef typename R::value_type value_type_R;
87 
88 protected:
90 
91  const FadCst<L> left_; const R& right_;
92 
93 public:
94  FadBinaryAdd(const FadCst<L>& left, const R& right) : left_(left), right_(right) {;}
96 
97 
98  const value_type val() const {return left_.val() + right_.val();}
99  value_type dx(int i) const {return right_.dx(i);}
100  int size() const {return right_.size();}
101 
102  bool hasFastAccess() const { return right_.hasFastAccess();}
103  value_type fastAccessDx(int i) const { return right_.fastAccessDx(i);}
104 };
105 
106 
107 
108 
109 
110 
111 //------------------------------- Fad substraction operators ------------------------------------------
112 template <typename L, typename R> class FadBinaryMinus {
113 public:
114  typedef typename L::value_type value_type_L;
115  typedef typename R::value_type value_type_R;
117 
118 protected:
120 
121  const L& left_; const R& right_;
122 
123 public:
124  FadBinaryMinus(const L& left, const R& right) : left_(left), right_(right) {;}
126 
127 
128  const value_type val() const {return left_.val() - right_.val();}
129  const value_type dx(int i) const {return left_.dx(i) - right_.dx(i);}
130  int size() const {
131  int lsz = left_.size(), rsz = right_.size();
132  return max(lsz, rsz);
133  }
134 
135  bool hasFastAccess() const { return left_.hasFastAccess() && right_.hasFastAccess();}
136  value_type fastAccessDx(int i) const { return left_.fastAccessDx(i) - right_.fastAccessDx(i);}
137 };
138 
139 
140 template <typename L, typename R> class FadBinaryMinus<L, FadCst<R> > {
141 public:
142  typedef typename L::value_type value_type_L;
143  typedef R value_type_R;
145 
146 protected:
148 
149  const L& left_; const FadCst<R> right_;
150 
151 public:
152  FadBinaryMinus(const L& left, const FadCst<R> & right) : left_(left), right_(right) {;}
154 
155 
156  const value_type val() const {return left_.val() - right_.val();}
157  const value_type dx(int i) const {return left_.dx(i);}
158  int size() const { return left_.size();}
159 
160  bool hasFastAccess() const { return left_.hasFastAccess();}
161  value_type fastAccessDx(int i) const { return left_.fastAccessDx(i);}
162 };
163 
164 
165 template <typename L, typename R> class FadBinaryMinus< FadCst<L>, R> {
166 public:
167  typedef L value_type_L;
168  typedef typename R::value_type value_type_R;
170 
171 protected:
173 
174  const FadCst<L> left_; const R& right_;
175 
176 public:
177  FadBinaryMinus(const FadCst<L>& left, const R& right) : left_(left), right_(right) {;}
179 
180 
181  const value_type val() const {return left_.val() - right_.val();}
182  const value_type dx(int i) const {return - right_.dx(i);}
183  int size() const { return right_.size(); }
184 
185  bool hasFastAccess() const { return right_.hasFastAccess();}
186  value_type fastAccessDx(int i) const { return - right_.fastAccessDx(i);}
187 };
188 
189 
190 //------------------------------- Fad multiplication operators ------------------------------------------
191 template <typename L, typename R> class FadBinaryMul {
192  public:
193  typedef typename L::value_type value_type_L;
194  typedef typename R::value_type value_type_R;
196 
197  protected:
199 
200  const L& left_; const R& right_;
201 
202  public:
203  FadBinaryMul(const L& left, const R& right) : left_(left), right_(right) {;}
205 
206  const value_type val() const {return left_.val() * right_.val() ;}
207  const value_type dx(int i) const {return left_.dx(i) * right_.val() + right_.dx(i) * left_.val();}
208  int size() const {
209  int lsz = left_.size(), rsz = right_.size();
210  return max(lsz, rsz);
211  }
212 
213  bool hasFastAccess() const { return left_.hasFastAccess() && right_.hasFastAccess();}
214  value_type fastAccessDx(int i) const { return left_.fastAccessDx(i) * right_.val() + right_.fastAccessDx(i) * left_.val();}
215 
216 };
217 
218 template <typename L, typename R> class FadBinaryMul<L, FadCst<R> > {
219  public:
220  typedef typename L::value_type value_type_L;
221  typedef R value_type_R;
223 
224  protected:
226 
227  const L& left_; const FadCst<R> right_;
228 
229  public:
230  FadBinaryMul(const L& left, const FadCst<R>& right) : left_(left), right_(right) {;}
232 
233  const value_type val() const {return left_.val() * right_.val() ;}
234  const value_type dx(int i) const {return left_.dx(i) * right_.val();}
235  int size() const { return left_.size();}
236 
237  bool hasFastAccess() const { return left_.hasFastAccess();}
238  value_type fastAccessDx(int i) const { return left_.fastAccessDx(i) * right_.val();}
239 };
240 
241 template <typename L, typename R> class FadBinaryMul< FadCst<L>, R> {
242  public:
243  typedef L value_type_L;
244  typedef typename R::value_type value_type_R;
246 
247  protected:
249 
250  const FadCst<L> left_; const R& right_;
251 
252  public:
253  FadBinaryMul(const FadCst<L>& left, const R& right) : left_(left), right_(right) {;}
255 
256  const value_type val() const {return left_.val() * right_.val() ;}
257  const value_type dx(int i) const {return right_.dx(i) * left_.val();}
258  int size() const { return right_.size();}
259 
260  bool hasFastAccess() const { return right_.hasFastAccess();}
261  value_type fastAccessDx(int i) const { return right_.fastAccessDx(i) * left_.val();}
262 };
263 
264 
265 //------------------------------- Fad division operators ------------------------------------------
266 template <typename L, typename R> class FadBinaryDiv {
267  public:
268  typedef typename L::value_type value_type_L;
269  typedef typename R::value_type value_type_R;
271 
272  protected:
274 
275  const L& left_; const R& right_;
276 
277  public:
278  FadBinaryDiv(const L& left, const R& right) : left_(left), right_(right) {;}
280 
281 
282  const value_type val() const {return left_.val() / right_.val();}
283  const value_type dx(int i) const {return (left_.dx(i) * right_.val() - right_.dx(i) * left_.val() ) / (right_.val() * right_.val()) ;}
284  int size() const {
285  int lsz = left_.size(), rsz = right_.size();
286  return max(lsz, rsz);
287  }
288 
289  bool hasFastAccess() const { return left_.hasFastAccess() && right_.hasFastAccess();}
290  value_type fastAccessDx(int i) const { return (left_.fastAccessDx(i) * right_.val() - right_.fastAccessDx(i) * left_.val() )
291  / (right_.val() * right_.val()) ;}
292 };
293 
294 
295 template <typename L, typename R> class FadBinaryDiv<L, FadCst<R> > {
296  public:
297  typedef typename L::value_type value_type_L;
298  typedef R value_type_R;
300 
301  protected:
303 
304  const L& left_; const FadCst<R> right_;
305 
306  public:
307  FadBinaryDiv(const L& left, const FadCst<R>& right) : left_(left), right_(right) {;}
309 
310 
311  const value_type val() const {return left_.val() / right_.val();}
312  const value_type dx(int i) const {return left_.dx(i) / right_.val();}
313  int size() const { return left_.size();}
314 
315  bool hasFastAccess() const { return left_.hasFastAccess();}
316  value_type fastAccessDx(int i) const { return left_.fastAccessDx(i) / right_.val() ;}
317 };
318 
319 
320 template <typename L, typename R> class FadBinaryDiv< FadCst<L>, R> {
321  public:
322  typedef L value_type_L;
323  typedef typename R::value_type value_type_R;
325 
326  protected:
328 
329  const FadCst<L> left_; const R& right_;
330 
331  public:
332  FadBinaryDiv(const FadCst<L>& left, const R& right) : left_(left), right_(right) {;}
334 
335  const value_type val() const {return left_.val() / right_.val();}
336  const value_type dx(int i) const {return (- right_.dx(i) * left_.val() ) / (right_.val() * right_.val()) ;}
337  int size() const { return right_.size();}
338 
339  bool hasFastAccess() const { return right_.hasFastAccess();}
340  value_type fastAccessDx(int i) const { return (- right_.fastAccessDx(i) * left_.val() )
341  / (right_.val() * right_.val()) ;}
342 };
343 
344 
345 //------------------------------- Fad pow function ------------------------------------------
346 template <typename L, typename R> class FadBinaryPow {
347 public:
348  typedef typename L::value_type value_type_L;
349  typedef typename R::value_type value_type_R;
350 
352 
353 protected:
355 
356  const L& left_; const R& right_;
357 
358 public:
359  FadBinaryPow(const L& left, const R& right) : left_(left), right_(right) {;}
361 
362 
363  const value_type val() const {return pow( left_.val(), right_.val() );}
364  const value_type dx(int i) const
365  {
366  return (right_.dx(i)*log(left_.val())+right_.val()*left_.dx(i)/left_.val())
367  *pow( left_.val(), right_.val() );
368  }
369  int size() const {
370  int lsz = left_.size(), rsz = right_.size();
371  return max(lsz, rsz);
372  }
373 
374  bool hasFastAccess() const { return left_.hasFastAccess() && right_.hasFastAccess();}
375  value_type fastAccessDx(int i) const
376  {
377  return (right_.fastAccessDx(i)*log(left_.val())+right_.val()*left_.fastAccessDx(i)/left_.val())
378  *pow( left_.val(), right_.val() );
379  }
380 };
381 
382 
383 template <typename L, typename R> class FadBinaryPow<L, FadCst<R> > {
384 public:
385  typedef typename L::value_type value_type_L;
386  typedef R value_type_R;
388 
389 protected:
391 
392  const L& left_; const FadCst<R> right_;
393 
394 public:
395  FadBinaryPow(const L& left, const FadCst<R> & right) : left_(left), right_(right) {;}
397 
398 
399  const value_type val() const {return pow(left_.val(),right_.val()) ;}
400  const value_type dx(int i) const
401  {
402  return (right_.val()*left_.dx(i)/left_.val())*pow( left_.val(), right_.val() );
403  }
404  int size() const { return left_.size();}
405 
406  bool hasFastAccess() const { return left_.hasFastAccess();}
407  value_type fastAccessDx(int i) const
408  {
409  return (right_.val()*left_.fastAccessDx(i)/left_.val())
410  *pow( left_.val(), right_.val() );
411  }
412 };
413 
414 
415 template <typename L, typename R> class FadBinaryPow< FadCst<L>, R> {
416 public:
417  typedef L value_type_L;
418  typedef typename R::value_type value_type_R;
420 
421 protected:
423 
424  const FadCst<L> left_; const R& right_;
425 
426 public:
427  FadBinaryPow(const FadCst<L>& left, const R& right) : left_(left), right_(right) {;}
429 
430  const value_type val() const {return pow(left_.val(),right_.val());}
431  value_type dx(int i) const
432  {
433  return (right_.dx(i)*log(left_.val()))*pow( left_.val(), right_.val() );
434  }
435  int size() const {return right_.size();}
436 
437  bool hasFastAccess() const { return right_.hasFastAccess();}
438  value_type fastAccessDx(int i) const
439  {
440  return (right_.fastAccessDx(i)*log(left_.val()))
441  *pow( left_.val(), right_.val() );
442  }
443 };
444 
445 template <typename L> class FadBinaryPow< L , int> {
446 public:
447  typedef typename L::value_type value_type;
448  typedef FadCst<int> R;
449 
450 protected:
452 
453  const L& left_; const R right_;
454 
455 public:
456  FadBinaryPow(const L& left, const R& right) : left_(left), right_(right) {;}
458 
459 
460  const value_type val() const {return pow(left_.val(),right_.val());}
461  value_type dx(int i) const
462  {
463  return right_.val()*pow( left_.val(), right_.val()-1);
464  }
465  int size() const {return right_.size();}
466 
467  bool hasFastAccess() const { return right_.hasFastAccess();}
468  value_type fastAccessDx(int i) const
469  {
470  return right_.val() * pow( left_.val(), right_.val()-1 );
471  }
472 };
473 
474 #include "pzreal.h"
475 #include "fad.h"
476 //------------------------------- Fad operators ------------------------------------------
477 #define FAD_BIN_MACRO(OP, TYPE) \
478  /*A1 (a FadSuper object) vs A2 (another FadSuper object)*/ \
479  template <typename A1, typename A2, \
480  typename enable_if<is_convertible<A1*,FadSuper*>::value \
481  && is_convertible<A2*,FadSuper*>::value, \
482  int>::type * = nullptr> \
483  inline FadExpr<TYPE<A1, A2>> OP(const A1 &v, const A2 &w) { \
484  typedef TYPE<A1, A2> expr_t; \
485  return FadExpr<expr_t>(expr_t(v, w)); \
486  } \
487  /*B1 (an arithmetic value) vs B2 (a FadSuper object) */ \
488  template <typename B1, typename B2, \
489  typename enable_if<(is_arithmetic_pz<B1>::value && \
490  (is_convertible<B2*, FadSuper*>::value)), \
491  int>::type * = nullptr> \
492  inline FadExpr<TYPE<FadCst<B1>, B2>> OP(const B1 a, const B2 &e) { \
493  typedef TYPE<FadCst<B1>, B2> expr_t; \
494  return FadExpr<expr_t>(expr_t(FadCst<B1>(a), e)); \
495  } \
496  /*C1 (a FadSuper object) vs C2 (an arithmetic value) */ \
497  template <typename C1, typename C2, \
498  typename enable_if<((is_convertible<C1*, FadSuper*>::value) && \
499  is_arithmetic_pz<C2>::value), \
500  int>::type * = nullptr> \
501  inline FadExpr<TYPE<C1, FadCst<C2>>> OP(const C1 &e, const C2 a) { \
502  typedef TYPE<C1, FadCst<C2>> expr_t; \
503  return FadExpr<expr_t>(expr_t(e, FadCst<C2>(a))); \
504  }
505 
506 FAD_BIN_MACRO(operator+,FadBinaryAdd)
507 FAD_BIN_MACRO(operator-,FadBinaryMinus)
508 FAD_BIN_MACRO(operator*,FadBinaryMul)
509 FAD_BIN_MACRO(operator/,FadBinaryDiv)
510 
512 
513 #undef FAD_BIN_MACRO
514 
515 #endif
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:144
value_type dx(int i) const
Definition: fadop.h:461
int size() const
Definition: fadop.h:47
const value_type val() const
Definition: fadop.h:363
const value_type val() const
Definition: fadop.h:181
FadBinaryPow(const FadCst< L > &left, const R &right)
Definition: fadop.h:427
bool hasFastAccess() const
Definition: fadop.h:437
FadBinaryMinus()
Definition: fadop.h:119
value_type fastAccessDx(int i) const
Definition: fadop.h:103
const value_type & val() const
Definition: fad.h:589
const R & right_
Definition: fadop.h:38
int size() const
Definition: fadop.h:465
R::value_type value_type_R
Definition: fadop.h:85
L::value_type value_type_L
Definition: fadop.h:30
bool hasFastAccess() const
Definition: fadop.h:374
L::value_type value_type_L
Definition: fadop.h:220
const value_type dx(int i) const
Definition: fadop.h:312
const R & right_
Definition: fadop.h:121
const value_type val() const
Definition: fadop.h:206
const value_type dx(int i) const
Definition: fadop.h:129
value_type fastAccessDx(int i) const
Definition: fadop.h:161
bool hasFastAccess() const
Definition: fadop.h:289
bool hasFastAccess() const
Definition: fad.h:593
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:61
FadBinaryPow(const L &left, const R &right)
Definition: fadop.h:456
value_type fastAccessDx(int i) const
Definition: fadop.h:468
const value_type dx(int i) const
Definition: fadop.h:207
const FadCst< R > right_
Definition: fadop.h:149
bool hasFastAccess() const
Definition: fadop.h:339
~FadBinaryPow()
Definition: fadop.h:360
const value_type dx(int i) const
Definition: fadop.h:400
L::value_type value_type_L
Definition: fadop.h:297
bool hasFastAccess() const
Definition: fadop.h:315
const R & right_
Definition: fadop.h:356
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:33
const FadCst< R > right_
Definition: fadop.h:304
L::value_type value_type_L
Definition: fadop.h:385
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:86
const R & right_
Definition: fadop.h:200
R::value_type value_type_R
Definition: fadop.h:349
FadBinaryDiv(const L &left, const R &right)
Definition: fadop.h:278
FadBinaryMinus(const FadCst< L > &left, const R &right)
Definition: fadop.h:177
value_type fastAccessDx(int i) const
Definition: fadop.h:407
FadBinaryAdd()
Definition: fadop.h:36
R::value_type value_type_R
Definition: fadop.h:269
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:245
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:299
bool hasFastAccess() const
Definition: fadop.h:135
value_type fastAccessDx(int i) const
Definition: fadop.h:261
const FadCst< R > right_
Definition: fadop.h:227
L::value_type value_type_L
Definition: fadop.h:142
value_type fastAccessDx(int i) const
Definition: fadop.h:316
value_type fastAccessDx(int i) const
Definition: fadop.h:214
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:419
const value_type dx(int i) const
Definition: fadop.h:364
#define FAD_BIN_MACRO(OP, TYPE)
Definition: fadop.h:477
const value_type val() const
Definition: fadop.h:460
value_type dx(int i) const
Definition: fadop.h:99
const R & right_
Definition: fadop.h:275
FadBinaryMul()
Definition: fadop.h:198
const value_type val() const
Definition: fadop.h:98
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:270
R::value_type value_type_R
Definition: fadop.h:31
R::value_type value_type_R
Definition: fadop.h:194
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:351
bool hasFastAccess() const
Definition: fadop.h:102
L::value_type value_type_L
Definition: fadop.h:268
const value_type val() const
Definition: fadop.h:335
const value_type val() const
Definition: fadop.h:430
~FadBinaryAdd()
Definition: fadop.h:42
int size() const
Definition: fadop.h:208
FadBinaryAdd(const L &left, const R &right)
Definition: fadop.h:41
FadBinaryMul(const FadCst< L > &left, const R &right)
Definition: fadop.h:253
value_type fastAccessDx(int i) const
Definition: fadop.h:438
value_type fastAccessDx(int i) const
Definition: fadop.h:375
R::value_type value_type_R
Definition: fadop.h:323
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:169
L::value_type value_type_L
Definition: fadop.h:348
value_type dx(int i) const
Definition: fadop.h:431
bool hasFastAccess() const
Definition: fadop.h:213
const value_type dx(int i) const
Definition: fadop.h:182
value_type fastAccessDx(int i) const
Definition: fadop.h:238
FadBinaryMinus(const L &left, const FadCst< R > &right)
Definition: fadop.h:152
const value_type val() const
Definition: fadop.h:256
const value_type val() const
Definition: fadop.h:311
~FadBinaryDiv()
Definition: fadop.h:279
int size() const
Definition: fad.h:591
bool hasFastAccess() const
Definition: fadop.h:467
R::value_type value_type_R
Definition: fadop.h:115
value_type fastAccessDx(int i) const
Definition: fadop.h:53
FadBinaryDiv(const FadCst< L > &left, const R &right)
Definition: fadop.h:332
FadBinaryPow()
Definition: fadop.h:354
const value_type val() const
Definition: fadop.h:233
const value_type dx(int i) const
Definition: fadop.h:283
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:324
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:116
L::value_type value_type_L
Definition: fadop.h:193
R::value_type value_type_R
Definition: fadop.h:418
L::value_type value_type
Definition: fadop.h:447
FadBinaryMinus(const L &left, const R &right)
Definition: fadop.h:124
const value_type val() const
Definition: fadop.h:156
const value_type val() const
Definition: fadop.h:399
value_type fastAccessDx(int i) const
Definition: fadop.h:136
int size() const
Definition: fadop.h:130
bool hasFastAccess() const
Definition: fadop.h:406
const value_type dx(int i) const
Definition: fadop.h:336
FadBinaryPow(const L &left, const FadCst< R > &right)
Definition: fadop.h:395
const value_type val() const
Definition: fadop.h:73
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
Definition: pzreal.h:487
FadBinaryAdd(const FadCst< L > &left, const R &right)
Definition: fadop.h:94
FadBinaryDiv(const L &left, const FadCst< R > &right)
Definition: fadop.h:307
FadBinaryPow(const L &left, const R &right)
Definition: fadop.h:359
L::value_type value_type_L
Definition: fadop.h:114
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ log
Definition: tfadfunc.h:130
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:222
const value_type dx(int i) const
Definition: fadop.h:74
value_type fastAccessDx(int i) const
Definition: fadop.h:290
const value_type dx(int i) const
Definition: fadop.h:257
value_type fastAccessDx(int i) const
Definition: fadop.h:186
int size() const
Definition: fadop.h:369
FadBinaryDiv()
Definition: fadop.h:273
const value_type dx(int i) const
Definition: fadop.h:157
value_type fastAccessDx(int i) const
Definition: fadop.h:340
const FadCst< R > right_
Definition: fadop.h:66
int size() const
Definition: fadop.h:284
L::value_type value_type_L
Definition: fadop.h:59
~FadBinaryMul()
Definition: fadop.h:204
bool hasFastAccess() const
Definition: fadop.h:52
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
FadBinaryMul(const L &left, const R &right)
Definition: fadop.h:203
FadBinaryAdd(const L &left, const FadCst< R > &right)
Definition: fadop.h:69
const value_type val() const
Definition: fadop.h:45
bool hasFastAccess() const
Definition: fadop.h:77
const value_type dx(int i) const
Definition: fadop.h:46
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:387
const value_type val() const
Definition: fadop.h:128
value_type fastAccessDx(int i) const
Definition: fadop.h:78
bool hasFastAccess() const
Definition: fadop.h:237
R::value_type value_type_R
Definition: fadop.h:244
~FadBinaryMinus()
Definition: fadop.h:125
FadCst< int > R
Definition: fadop.h:448
FadBinaryMul(const L &left, const FadCst< R > &right)
Definition: fadop.h:230
const value_type val() const
Definition: fadop.h:282
const FadCst< R > right_
Definition: fadop.h:392
bool hasFastAccess() const
Definition: fadop.h:260
NumericalTraits< value_type_L, value_type_R >::promote value_type
Definition: fadop.h:195
Definition: fad.h:37
R::value_type value_type_R
Definition: fadop.h:168
const value_type dx(int i) const
Definition: fadop.h:234