41 FadBinaryAdd(
const L& left,
const R& right) : left_(left), right_(right) {;}
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);}
48 int lsz = left_.size(), rsz = right_.size();
52 bool hasFastAccess()
const {
return left_.hasFastAccess() && right_.hasFastAccess();}
53 value_type
fastAccessDx(
int i)
const {
return left_.fastAccessDx(i)+right_.fastAccessDx(i);}
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();}
78 value_type
fastAccessDx(
int i)
const {
return left_.fastAccessDx(i);}
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();}
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);}
131 int lsz = left_.size(), rsz = right_.size();
132 return max(lsz, rsz);
135 bool hasFastAccess()
const {
return left_.hasFastAccess() && right_.hasFastAccess();}
136 value_type
fastAccessDx(
int i)
const {
return left_.fastAccessDx(i) - right_.fastAccessDx(i);}
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();}
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(); }
186 value_type
fastAccessDx(
int i)
const {
return - right_.fastAccessDx(i);}
203 FadBinaryMul(
const L& left,
const R& right) : left_(left), right_(right) {;}
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();}
209 int lsz = left_.size(), rsz = right_.size();
210 return max(lsz, rsz);
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();}
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();}
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();}
278 FadBinaryDiv(
const L& left,
const R& right) : left_(left), right_(right) {;}
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()) ;}
285 int lsz = left_.size(), rsz = right_.size();
286 return max(lsz, rsz);
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()) ;}
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();}
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();}
340 value_type
fastAccessDx(
int i)
const {
return (- right_.fastAccessDx(i) * left_.
val() )
341 / (right_.val() * right_.val()) ;}
359 FadBinaryPow(
const L& left,
const R& right) : left_(left), right_(right) {;}
363 const value_type
val()
const {
return pow( left_.val(), right_.val() );}
364 const value_type
dx(
int i)
const 366 return (right_.dx(i)*
log(left_.val())+right_.val()*left_.dx(i)/left_.val())
367 *
pow( left_.val(), right_.val() );
370 int lsz = left_.size(), rsz = right_.size();
371 return max(lsz, rsz);
374 bool hasFastAccess()
const {
return left_.hasFastAccess() && right_.hasFastAccess();}
377 return (right_.fastAccessDx(i)*
log(left_.val())+right_.val()*left_.fastAccessDx(i)/left_.val())
378 *
pow( left_.val(), right_.val() );
399 const value_type
val()
const {
return pow(left_.val(),right_.
val()) ;}
400 const value_type
dx(
int i)
const 402 return (right_.
val()*left_.dx(i)/left_.val())*
pow( left_.val(), right_.
val() );
404 int size()
const {
return left_.size();}
409 return (right_.
val()*left_.fastAccessDx(i)/left_.val())
410 *
pow( left_.val(), right_.
val() );
430 const value_type
val()
const {
return pow(left_.
val(),right_.val());}
431 value_type
dx(
int i)
const 433 return (right_.dx(i)*
log(left_.
val()))*
pow( left_.
val(), right_.val() );
435 int size()
const {
return right_.size();}
440 return (right_.fastAccessDx(i)*
log(left_.
val()))
441 *
pow( left_.
val(), right_.val() );
456 FadBinaryPow(
const L& left,
const R& right) : left_(left), right_(right) {;}
460 const value_type
val()
const {
return pow(left_.val(),right_.
val());}
461 value_type
dx(
int i)
const 463 return right_.
val()*
pow( left_.val(), right_.
val()-1);
470 return right_.
val() *
pow( left_.val(), right_.
val()-1 );
477 #define FAD_BIN_MACRO(OP, TYPE) \ 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)); \ 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)); \ 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))); \ NumericalTraits< value_type_L, value_type_R >::promote value_type
value_type dx(int i) const
bool hasFastAccess() const
const value_type val() const
const value_type val() const
FadBinaryPow(const FadCst< L > &left, const R &right)
bool hasFastAccess() const
value_type fastAccessDx(int i) const
const value_type & val() const
R::value_type value_type_R
L::value_type value_type_L
bool hasFastAccess() const
L::value_type value_type_L
const value_type dx(int i) const
const value_type val() const
const value_type dx(int i) const
value_type fastAccessDx(int i) const
bool hasFastAccess() const
bool hasFastAccess() const
NumericalTraits< value_type_L, value_type_R >::promote value_type
FadBinaryPow(const L &left, const R &right)
value_type fastAccessDx(int i) const
const value_type dx(int i) const
bool hasFastAccess() const
const value_type dx(int i) const
L::value_type value_type_L
bool hasFastAccess() const
NumericalTraits< value_type_L, value_type_R >::promote value_type
L::value_type value_type_L
NumericalTraits< value_type_L, value_type_R >::promote value_type
R::value_type value_type_R
FadBinaryDiv(const L &left, const R &right)
FadBinaryMinus(const FadCst< L > &left, const R &right)
value_type fastAccessDx(int i) const
R::value_type value_type_R
NumericalTraits< value_type_L, value_type_R >::promote value_type
NumericalTraits< value_type_L, value_type_R >::promote value_type
bool hasFastAccess() const
value_type fastAccessDx(int i) const
L::value_type value_type_L
value_type fastAccessDx(int i) const
value_type fastAccessDx(int i) const
NumericalTraits< value_type_L, value_type_R >::promote value_type
const value_type dx(int i) const
#define FAD_BIN_MACRO(OP, TYPE)
const value_type val() const
value_type dx(int i) const
const value_type val() const
NumericalTraits< value_type_L, value_type_R >::promote value_type
R::value_type value_type_R
R::value_type value_type_R
NumericalTraits< value_type_L, value_type_R >::promote value_type
bool hasFastAccess() const
L::value_type value_type_L
const value_type val() const
const value_type val() const
FadBinaryAdd(const L &left, const R &right)
FadBinaryMul(const FadCst< L > &left, const R &right)
value_type fastAccessDx(int i) const
value_type fastAccessDx(int i) const
R::value_type value_type_R
NumericalTraits< value_type_L, value_type_R >::promote value_type
L::value_type value_type_L
value_type dx(int i) const
bool hasFastAccess() const
const value_type dx(int i) const
value_type fastAccessDx(int i) const
FadBinaryMinus(const L &left, const FadCst< R > &right)
const value_type val() const
const value_type val() const
bool hasFastAccess() const
R::value_type value_type_R
value_type fastAccessDx(int i) const
FadBinaryDiv(const FadCst< L > &left, const R &right)
const value_type val() const
const value_type dx(int i) const
NumericalTraits< value_type_L, value_type_R >::promote value_type
NumericalTraits< value_type_L, value_type_R >::promote value_type
L::value_type value_type_L
R::value_type value_type_R
FadBinaryMinus(const L &left, const R &right)
const value_type val() const
const value_type val() const
value_type fastAccessDx(int i) const
bool hasFastAccess() const
const value_type dx(int i) const
FadBinaryPow(const L &left, const FadCst< R > &right)
const value_type val() const
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
FadBinaryAdd(const FadCst< L > &left, const R &right)
FadBinaryDiv(const L &left, const FadCst< R > &right)
FadBinaryPow(const L &left, const R &right)
L::value_type value_type_L
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
NumericalTraits< value_type_L, value_type_R >::promote value_type
const value_type dx(int i) const
value_type fastAccessDx(int i) const
const value_type dx(int i) const
value_type fastAccessDx(int i) const
const value_type dx(int i) const
bool hasFastAccess() const
value_type fastAccessDx(int i) const
L::value_type value_type_L
bool hasFastAccess() const
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
FadBinaryMul(const L &left, const R &right)
FadBinaryAdd(const L &left, const FadCst< R > &right)
const value_type val() const
bool hasFastAccess() const
const value_type dx(int i) const
NumericalTraits< value_type_L, value_type_R >::promote value_type
const value_type val() const
value_type fastAccessDx(int i) const
bool hasFastAccess() const
R::value_type value_type_R
FadBinaryMul(const L &left, const FadCst< R > &right)
const value_type val() const
bool hasFastAccess() const
NumericalTraits< value_type_L, value_type_R >::promote value_type
R::value_type value_type_R
const value_type dx(int i) const