30 #ifndef SACADO_TAY_CACHETAYLOROPS_HPP
31 #define SACADO_TAY_CACHETAYLOROPS_HPP
46 template <
typename ExprT>
63 const ExprT& expr)
const {
64 return expr.fastAccessCoeff(i);
71 template <
typename ExprT>
84 return -expr.coeff(i);
88 const ExprT& expr)
const {
89 return -expr.fastAccessCoeff(i);
96 template <
typename ExprT>
113 if (static_cast<int>(i) >
dc) {
115 c[0] =
std::exp(expr.fastAccessCoeff(0));
118 for (
int k=
dc+1; k<=i; k++) {
119 for (
int j=1; j<=k; j++)
129 const ExprT& expr)
const
131 if (static_cast<int>(i) >
dc) {
133 c[0] =
std::exp(expr.fastAccessCoeff(0));
136 for (
int k=
dc+1; k<=i; k++) {
137 for (
int j=1; j<=k; j++)
148 mutable std::valarray<value_type>
c;
155 template <
typename ExprT>
173 if (static_cast<int>(i) >
dc) {
175 c[0] =
std::log(expr.fastAccessCoeff(0));
178 for (
int k=
dc+1; k<=i; k++) {
180 for (
int j=1; j<=k-1; j++)
190 const ExprT& expr)
const
192 if (static_cast<int>(i) >
dc) {
194 c[0] =
std::log(expr.fastAccessCoeff(0));
197 for (
int k=
dc+1; k<=i; k++) {
199 for (
int j=1; j<=k-1; j++)
210 mutable std::valarray<value_type>
c;
217 template <
typename ExprT>
234 if (static_cast<int>(i) >
dc) {
240 for (
int k=
dc+1; k<=i; k++) {
241 c[k] = expr.coeff(k);
242 for (
int j=1; j<=k-1; j++)
252 const ExprT& expr)
const
254 if (static_cast<int>(i) >
dc) {
260 for (
int k=
dc+1; k<=i; k++) {
261 c[k] = expr.fastAccessCoeff(k);
262 for (
int j=1; j<=k-1; j++)
273 mutable std::valarray<value_type>
c;
280 template <
typename ExprT>
299 if (static_cast<int>(i) >
dc) {
301 c[0] =
std::cos(expr.fastAccessCoeff(0));
302 s[0] =
std::sin(expr.fastAccessCoeff(0));
305 for (
int k=
dc+1; k<=i; k++) {
306 for (
int j=1; j<=k; j++) {
319 const ExprT& expr)
const
321 if (static_cast<int>(i) >
dc) {
323 c[0] =
std::cos(expr.fastAccessCoeff(0));
324 s[0] =
std::sin(expr.fastAccessCoeff(0));
327 for (
int k=
dc+1; k<=i; k++) {
328 for (
int j=1; j<=k; j++) {
342 mutable std::valarray<value_type>
c;
343 mutable std::valarray<value_type>
s;
350 template <
typename ExprT>
369 if (static_cast<int>(i) >
dc) {
371 c[0] =
std::cos(expr.fastAccessCoeff(0));
372 s[0] =
std::sin(expr.fastAccessCoeff(0));
375 for (
int k=
dc+1; k<=i; k++) {
376 for (
int j=1; j<=k; j++) {
389 const ExprT& expr)
const
391 if (static_cast<int>(i) >
dc) {
393 c[0] =
std::cos(expr.fastAccessCoeff(0));
394 s[0] =
std::sin(expr.fastAccessCoeff(0));
397 for (
int k=
dc+1; k<=i; k++) {
398 for (
int j=1; j<=k; j++) {
412 mutable std::valarray<value_type>
c;
413 mutable std::valarray<value_type>
s;
420 template <
typename ExprT>
439 if (static_cast<int>(i) >
dc) {
445 for (
int k=
dc+1; k<=i; k++) {
446 for (
int j=1; j<=k; j++) {
459 const ExprT& expr)
const
461 if (static_cast<int>(i) >
dc) {
467 for (
int k=
dc+1; k<=i; k++) {
468 for (
int j=1; j<=k; j++) {
482 mutable std::valarray<value_type>
c;
483 mutable std::valarray<value_type>
s;
490 template <
typename ExprT>
509 if (static_cast<int>(i) >
dc) {
515 for (
int k=
dc+1; k<=i; k++) {
516 for (
int j=1; j<=k; j++) {
529 const ExprT& expr)
const
531 if (static_cast<int>(i) >
dc) {
537 for (
int k=
dc+1; k<=i; k++) {
538 for (
int j=1; j<=k; j++) {
552 mutable std::valarray<value_type>
c;
553 mutable std::valarray<value_type>
s;
560 template <
typename ExprT>
573 if (expr.fastAccessCoeff(0) > 0)
574 return expr.coeff(i);
576 return -expr.coeff(i);
580 const ExprT& expr)
const
582 if (expr.fastAccessCoeff(0) > 0)
583 return expr.fastAccessCoeff(i);
585 return -expr.fastAccessCoeff(i);
594 #define TAYLOR_UNARYOP_MACRO(OPNAME,OP) \
597 template <typename T> \
598 inline Expr< UnaryExpr< Expr<T>, OP > > \
599 OPNAME (const Expr<T>& expr) \
601 typedef UnaryExpr< Expr<T>, OP > expr_t; \
603 return Expr<expr_t>(expr_t(expr)); \
609 using Sacado::Tay::OPNAME; \
624 #undef TAYLOR_UNARYOP_MACRO
632 template <
typename ExprT1,
typename ExprT2>
657 const ExprT2& expr2)
const {
658 return expr1.coeff(i) + expr2.coeff(i);
663 const ExprT2& expr2)
const {
664 return expr1.fastAccessCoeff(i) + expr2.fastAccessCoeff(i);
669 template <
typename ExprT1>
684 const ExprT2& expr2)
const {
686 return expr1.coeff(i) + expr2.
coeff(i);
688 return expr1.coeff(i);
693 const ExprT2& expr2)
const {
697 return expr1.fastAccessCoeff(i);
702 template <
typename ExprT2>
717 const ExprT2& expr2)
const {
719 return expr1.
coeff(i) + expr2.coeff(i);
721 return expr2.coeff(i);
726 const ExprT2& expr2)
const {
730 return expr2.fastAccessCoeff(i);
737 template <
typename ExprT1,
typename ExprT2>
762 const ExprT2& expr2)
const {
763 return expr1.coeff(i) - expr2.coeff(i);
768 const ExprT2& expr2)
const {
769 return expr1.fastAccessCoeff(i) - expr2.fastAccessCoeff(i);
774 template <
typename ExprT1>
789 const ExprT2& expr2)
const {
791 return expr1.coeff(i) - expr2.
coeff(i);
793 return expr1.coeff(i);
798 const ExprT2& expr2)
const {
802 return expr1.fastAccessCoeff(i);
807 template <
typename ExprT2>
822 const ExprT2& expr2)
const {
824 return expr1.
coeff(i) - expr2.coeff(i);
826 return -expr2.coeff(i);
831 const ExprT2& expr2)
const {
835 return -expr2.fastAccessCoeff(i);
842 template <
typename ExprT1,
typename ExprT2>
871 const ExprT2& expr2)
const {
872 if (static_cast<int>(i) >
dc) {
873 for (
int k=
dc+1; k<=i; k++) {
874 for (
int j=0; j<=k; j++)
875 c[k] += expr1.coeff(j)*expr2.coeff(k-j);
884 const ExprT2& expr2)
const {
885 if (static_cast<int>(i) >
dc) {
886 for (
int k=
dc+1; k<=i; k++) {
887 for (
int j=0; j<=k; j++)
888 c[k] += expr1.fastAccessCoeff(j)*expr2.fastAccessCoeff(k-j);
897 mutable std::valarray<value_type>
c;
902 template <
typename ExprT1>
917 const ExprT2& expr2)
const {
918 return expr1.coeff(i)*expr2.
value();
923 const ExprT2& expr2)
const {
924 return expr1.fastAccessCoeff(i)*expr2.
value();
929 template <
typename ExprT2>
944 const ExprT2& expr2)
const {
945 return expr1.
value()*expr2.coeff(i);
950 const ExprT2& expr2)
const {
951 return expr1.
value()*expr2.fastAccessCoeff(i);
958 template <
typename ExprT1,
typename ExprT2>
987 const ExprT2& expr2)
const {
988 if (static_cast<int>(i) >
dc) {
989 for (
int k=
dc+1; k<=i; k++) {
990 c[k] = expr1.coeff(k);
991 for (
int j=1; j<=k; j++)
992 c[k] -= expr2.coeff(j)*
c[k-j];
993 c[k] /= expr2.fastAccessCoeff(0);
1002 const ExprT2& expr2)
const {
1003 if (static_cast<int>(i) >
dc) {
1004 for (
int k=
dc+1; k<=i; k++) {
1005 c[k] = expr1.coeff(k);
1006 for (
int j=1; j<=k; j++)
1007 c[k] -= expr2.fastAccessCoeff(j)*
c[k-j];
1008 c[k] /= expr2.fastAccessCoeff(0);
1017 mutable std::valarray<value_type>
c;
1022 template <
typename ExprT1>
1037 const ExprT2& expr2)
const {
1038 return expr1.coeff(i)/expr2.
value();
1043 const ExprT2& expr2)
const {
1044 return expr1.fastAccessCoeff(i)/expr2.
value();
1049 template <
typename ExprT2>
1068 const ExprT2& expr2)
const {
1069 if (static_cast<int>(i) >
dc) {
1074 for (
int k=
dc+1; k<=i; k++) {
1075 for (
int j=1; j<=k; j++)
1076 c[k] -= expr2.coeff(j)*
c[k-j];
1077 c[k] /= expr2.fastAccessCoeff(0);
1086 const ExprT2& expr2)
const {
1087 if (static_cast<int>(i) >
dc) {
1092 for (
int k=
dc+1; k<=i; k++) {
1094 for (
int j=1; j<=k; j++)
1095 c[k] -= expr2.fastAccessCoeff(j)*
c[k-j];
1096 c[k] /= expr2.fastAccessCoeff(0);
1105 mutable std::valarray<value_type>
c;
1112 template <
typename ExprT1,
typename ExprT2>
1131 MaxOp(
const ExprT1& expr1,
const ExprT2 expr2) {}
1137 const ExprT2& expr2)
const {
1139 return std::max(expr1.coeff(0), expr2.coeff(0));
1141 return expr1.coeff(0) >= expr2.coeff(0) ? expr1.coeff(i) :
1147 const ExprT2& expr2)
const {
1149 return std::max(expr1.fastAccessCoeff(0), expr2.fastAccessCoeff(0));
1151 return expr1.fastAccessCoeff(0) >= expr2.fastAccessCoeff(0) ?
1152 expr1.fastAccessoeff(i) : expr2.fastAccessCoeff(i);
1157 template <
typename ExprT1>
1172 const ExprT2& expr2)
const {
1176 return expr1.coeff(0) >= expr2.
value() ? expr1.coeff(i) :
1182 const ExprT2& expr2)
const {
1186 return expr1.fastAccessCoeff(0) >= expr2.
value() ?
1192 template <
typename ExprT2>
1207 const ExprT2& expr2)
const {
1217 const ExprT2& expr2)
const {
1222 expr2.fastAccessCoeff(i);
1229 template <
typename ExprT1,
typename ExprT2>
1247 MinOp(
const ExprT1& expr1,
const ExprT2 expr2) {}
1253 const ExprT2& expr2)
const {
1255 return min(expr1.coeff(0), expr2.coeff(0));
1257 return expr1.coeff(0) <= expr2.coeff(0) ? expr1.coeff(i) :
1263 const ExprT2& expr2)
const {
1265 return min(expr1.fastAccessCoeff(0), expr2.fastAccessCoeff(0));
1267 return expr1.fastAccessCoeff(0) <= expr2.fastAccessCoeff(0) ?
1268 expr1.fastAccessCoeff(i) : expr2.fastAccessCoeff(i);
1273 template <
typename ExprT1>
1288 const ExprT2& expr2)
const {
1292 return expr1.coeff(0) <= expr2.
value() ? expr1.coeff(i) :
1298 const ExprT2& expr2)
const {
1302 return expr1.fastAccessCoeff(0) <= expr2.
value() ?
1308 template <
typename ExprT2>
1323 const ExprT2& expr2)
const {
1333 const ExprT2& expr2)
const {
1338 expr2.fastAccessCoeff(i);
1345 template <
typename ExprT1,
typename ExprT2>
1374 const ExprT2& expr2)
const {
1375 if (static_cast<int>(i) >
dc) {
1380 for (
int k=
dc+1; k<=i; k++) {
1381 for (
int j=1; j<=k; j++)
1382 c[k] +=
value_type(j)*expr2.coeff(k-j)*expr1.coeff(j);
1391 const ExprT1& expr1,
1392 const ExprT2& expr2)
const
1394 if (static_cast<int>(i) >
dc) {
1399 for (
int k=
dc+1; k<=i; k++) {
1400 for (
int j=1; j<=k; j++)
1402 expr1.fastAccessCoeff(j);
1412 mutable std::valarray<value_type>
c;
1417 template <
typename ExprT1,
typename ExprT2>
1446 const ExprT2& expr2)
const {
1447 if (static_cast<int>(i) >
dc) {
1452 for (
int k=
dc+1; k<=i; k++) {
1453 for (
int j=1; j<=k; j++)
1454 c[k] +=
value_type(j)*expr2.coeff(k-j)*expr1.coeff(j);
1463 const ExprT1& expr1,
1464 const ExprT2& expr2)
const
1466 if (static_cast<int>(i) >
dc) {
1471 for (
int k=
dc+1; k<=i; k++) {
1472 for (
int j=1; j<=k; j++)
1474 expr1.fastAccessCoeff(j);
1484 mutable std::valarray<value_type>
c;
1489 template <
typename ExprT1,
typename ExprT2>
1518 const ExprT2& expr2)
const {
1519 if (static_cast<int>(i) >
dc) {
1524 for (
int k=
dc+1; k<=i; k++) {
1525 for (
int j=1; j<=k; j++)
1526 c[k] +=
value_type(j)*expr2.coeff(k-j)*expr1.coeff(j);
1535 const ExprT1& expr1,
1536 const ExprT2& expr2)
const
1538 if (static_cast<int>(i) >
dc) {
1543 for (
int k=
dc+1; k<=i; k++) {
1544 for (
int j=1; j<=k; j++)
1546 expr1.fastAccessCoeff(j);
1556 mutable std::valarray<value_type>
c;
1565 #define TAYLOR_BINARYOP_MACRO(OPNAME,OP) \
1566 namespace Sacado { \
1568 template <typename T1, typename T2> \
1569 inline Expr< BinaryExpr< Expr<T1>, Expr<T2>, OP > > \
1570 OPNAME (const Expr<T1>& expr1, const Expr<T2>& expr2) \
1572 typedef BinaryExpr< Expr<T1>, Expr<T2>, OP > expr_t; \
1574 return Expr<expr_t>(expr_t(expr1, expr2)); \
1577 template <typename T> \
1578 inline Expr< BinaryExpr< ConstExpr<typename Expr<T>::value_type>, \
1580 OPNAME (const typename Expr<T>::value_type& c, \
1581 const Expr<T>& expr) \
1583 typedef ConstExpr<typename Expr<T>::value_type> ConstT; \
1584 typedef BinaryExpr< ConstT, Expr<T>, OP > expr_t; \
1586 return Expr<expr_t>(expr_t(ConstT(c), expr)); \
1589 template <typename T> \
1590 inline Expr< BinaryExpr< Expr<T>, \
1591 ConstExpr<typename Expr<T>::value_type>, \
1593 OPNAME (const Expr<T>& expr, \
1594 const typename Expr<T>::value_type& c) \
1596 typedef ConstExpr<typename Expr<T>::value_type> ConstT; \
1597 typedef BinaryExpr< Expr<T>, ConstT, OP > expr_t; \
1599 return Expr<expr_t>(expr_t(expr, ConstT(c))); \
1609 #undef TAYLOR_BINARYOP_MACRO
1618 #define TAYLOR_SFINAE_BINARYOP_MACRO(OPNAME,OP) \
1619 namespace Sacado { \
1621 template <typename T1, typename T2> \
1624 mpl::disable_if< mpl::is_same<T1,T2>, \
1625 Expr<BinaryExpr<Expr<T1>, Expr<T2>, OP> > >::type \
1626 OPNAME (const Expr<T1>& expr1, const Expr<T2>& expr2) \
1628 typedef BinaryExpr< Expr<T1>, Expr<T2>, OP > expr_t; \
1630 return Expr<expr_t>(expr_t(expr1, expr2)); \
1633 template <typename T> \
1634 inline Expr< BinaryExpr< ConstExpr<typename Expr<T>::value_type>, \
1636 OPNAME (const typename Expr<T>::value_type& c, \
1637 const Expr<T>& expr) \
1639 typedef ConstExpr<typename Expr<T>::value_type> ConstT; \
1640 typedef BinaryExpr< ConstT, Expr<T>, OP > expr_t; \
1642 return Expr<expr_t>(expr_t(ConstT(c), expr)); \
1645 template <typename T> \
1646 inline Expr< BinaryExpr< Expr<T>, \
1647 ConstExpr<typename Expr<T>::value_type>, \
1649 OPNAME (const Expr<T>& expr, \
1650 const typename Expr<T>::value_type& c) \
1652 typedef ConstExpr<typename Expr<T>::value_type> ConstT; \
1653 typedef BinaryExpr< Expr<T>, ConstT, OP > expr_t; \
1655 return Expr<expr_t>(expr_t(expr, ConstT(c))); \
1663 #undef TAYLOR_SFINAE_BINARYOP_MACRO
1674 template <
typename T1,
typename T2>
1675 inline Expr< BinaryExpr< Expr<T1>, Expr<T2>, ASinQuadOp > >
1683 template <
typename T1,
typename T2>
1684 inline Expr< BinaryExpr< Expr<T1>, Expr<T2>, ACosQuadOp > >
1692 template <
typename T1,
typename T2>
1693 inline Expr< BinaryExpr< Expr<T1>, Expr<T2>, ATanQuadOp > >
1701 template <
typename ExprT1,
typename ExprT2>
1710 template <
typename ExprT2>
1712 typedef typename ExprT2::value_type
T1;
1719 template <
typename ExprT1>
1721 typedef typename ExprT1::value_type
T2;
1729 template <
typename T1,
typename T2>
1734 return exp(expr2*
log(expr1));
1737 template <
typename T>
1738 inline typename PowExprType< typename Expr<T>::value_type, Expr<T> >::expr_type
1745 template <
typename T>
1746 inline typename PowExprType< Expr<T>,
typename Expr<T>::value_type >::expr_type
1753 template <
typename T>
1761 template <
typename T>
1769 template <
typename T>
1777 template <
typename T>
1782 return sin(expr)/
cos(expr);
1785 template <
typename T>
1796 template <
typename T>
1803 return asin_quad(expr, value_type(1)/
sqrt(value_type(1)-expr*expr));
1806 template <
typename T>
1817 template <
typename T>
1824 return acos_quad(expr, value_type(-1)/
sqrt(value_type(1)-expr*expr));
1827 template <
typename T>
1837 template <
typename T>
1844 return atan_quad(expr, value_type(1)/(value_type(1)+expr*expr));
1847 template <
typename T>
1855 template <
typename T>
1879 #define TAYLOR_RELOP_MACRO(OP) \
1880 namespace Sacado { \
1882 template <typename ExprT1, typename ExprT2> \
1884 operator OP (const Expr<ExprT1>& expr1, \
1885 const Expr<ExprT2>& expr2) \
1887 return expr1.fastAccessCoeff(0) OP expr2.fastAccessCoeff(0); \
1890 template <typename ExprT2> \
1892 operator OP (const typename Expr<ExprT2>::value_type& a, \
1893 const Expr<ExprT2>& expr2) \
1895 return a OP expr2.fastAccessCoeff(0); \
1898 template <typename ExprT1> \
1900 operator OP (const Expr<ExprT1>& expr1, \
1901 const typename Expr<ExprT1>::value_type& b) \
1903 return expr1.fastAccessCoeff(0) OP b; \
1919 #undef TAYLOR_RELOP_MACRO
1925 template <
typename ExprT>
1940 template <
typename ExprT>
1942 bool is_zero =
true;
1943 for (
int i=0; i<=x.
degree(); i++)
1944 is_zero = is_zero && (x.
coeff(i) == 0.0);
1952 #define TAY_BOOL_MACRO(OP) \
1953 namespace Sacado { \
1955 template <typename ExprT1, typename ExprT2> \
1957 operator OP (const Expr<ExprT1>& expr1, \
1958 const Expr<ExprT2>& expr2) \
1960 return toBool2(expr1) OP toBool2(expr2); \
1963 template <typename ExprT2> \
1965 operator OP (const typename Expr<ExprT2>::value_type& a, \
1966 const Expr<ExprT2>& expr2) \
1968 return a OP toBool2(expr2); \
1971 template <typename ExprT1> \
1973 operator OP (const Expr<ExprT1>& expr1, \
1974 const typename Expr<ExprT1>::value_type& b) \
1976 return toBool2(expr1) OP b; \
1984 #undef TAY_BOOL_MACRO
1992 template <
typename ExprT>
1993 std::ostream& operator << (std::ostream& os, const Expr<ExprT>& x) {
1994 os.setf(std::ios::fixed, std::ios::floatfield);
1998 for (
int i=0; i<=x.degree(); i++) {
2008 template <
typename T>
2010 const int d = x.
degree();
2019 for (
int i=1; i<=
n; ++i)
2021 for (
int i=
n; i<=d; ++i) {
2023 c = (c / (i-
n+1)) * (i+1);
2033 #endif // SACADO_TAY_CACHETAYLOROPS_HPP
MaxOp(const ExprT1 &expr1, const ExprT2 expr2)
UnaryExpr< Expr< T2 >, SqrtOp > T3
ConstExpr< typename ExprT1::value_type > ExprT2
void allocateCache(int d) const
void allocateCache(int d) const
UnaryExpr< Expr< T >, CosOp > T2
void allocateCache(int d) const
BinaryExpr< ConstT, Expr< T3 >, DivisionOp > T4
ExprT::base_expr_type base_expr_type
Sacado::Promote< base_expr_type_1, base_expr_type_2 >::type base_expr_type
Expr< BinaryExpr< Expr< T1 >, Expr< T2 >, ATanQuadOp > > atan_quad(const Expr< T1 > &expr1, const Expr< T2 > &expr2)
AdditionOp(const ExprT1 &expr1, const ExprT2 expr2)
ConstExpr< typename ExprT2::value_type > ExprT1
ExprT::scalar_type scalar_type
MaxOp(const ExprT1 &expr1, const ExprT2 expr2)
#define TAYLOR_UNARYOP_MACRO(OPNAME, OP)
ExprT::value_type value_type
ConstExpr< typename Expr< T >::value_type > ConstT
expr2 expr1 expr2 expr2 c *expr2 c *expr1 c *expr2 c *expr1 MaxOp
ExprT2::value_type value_type_2
SubtractionOp(const ExprT1 &expr1, const ExprT2 expr2)
ASinExprType< T >::expr_type asin(const Expr< T > &expr)
BinaryExpr< Expr< T1 >, ConstT, DivisionOp > T2
ExprT2::base_expr_type base_expr_type
ExprT2::base_expr_type base_expr_type
expr expr expr1 expr1 expr2 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 MultiplicationOp
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
std::valarray< value_type > c
SubtractionOp(const ExprT1 &expr1, const ExprT2 expr2)
ExprT1::scalar_type scalar_type
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT1::base_expr_type base_expr_type
bool operator!(const Expr< ExprT > &expr)
Constant expression template.
MultiplicationOp(const ExprT1 &expr1, const ExprT2 expr2)
Sacado::Promote< base_expr_type_1, base_expr_type_2 >::type base_expr_type
ExprT1::base_expr_type base_expr_type_1
Taylor< T > log(const Base< Taylor< T > > &a)
ExprT1::base_expr_type base_expr_type_1
SinhOp(const ExprT &expr)
ExprT1::scalar_type scalar_type_1
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
void allocateCache(int d) const
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
BinaryExpr< Expr< T >, Expr< T4 >, ACosQuadOp > T5
void allocateCache(int d) const
ExprT2::value_type value_type
DivisionOp(const ExprT1 &expr1, const ExprT2 expr2)
ExprT2::base_expr_type base_expr_type_2
Sacado::Promote< value_type_1, value_type_2 >::type value_type
Forward-mode AD class using dynamic memory allocation.
unsigned int degree() const
Return degree of polynomial.
value_type computeCoeff(int i, const ExprT &expr) const
ExprT2::value_type value_type_2
BinaryExpr< ConstT, Expr< T3 >, DivisionOp > T4
ExprT2::value_type value_type_2
void allocateCache(int d) const
ATanQuadOp(const ExprT1 &expr1, const ExprT2 &expr2)
expr2 expr1 expr2 expr2 c *expr2 c *expr1 c *expr2 c *expr1 MinOp
ExprT1::base_expr_type base_expr_type_1
ExprT::scalar_type scalar_type
Expr< BinaryExpr< Expr< T1 >, Expr< T2 >, ACosQuadOp > > acos_quad(const Expr< T1 > &expr1, const Expr< T2 > &expr2)
value_type computeCoeff(int i, const ExprT &expr) const
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ConstExpr< typename ExprT1::value_type > ExprT2
void allocateCache(int d) const
Sacado::Promote< scalar_type_1, scalar_type_2 >::type scalar_type
int degree() const
Returns degree of polynomial.
ExprT::value_type value_type
Typename of values.
void allocateCache(int d) const
Sacado::Promote< scalar_type_1, scalar_type_2 >::type scalar_type
std::valarray< value_type > s
TanhExprType< T >::expr_type tanh(const Expr< T > &expr)
void allocateCache(int d) const
ExprT1::base_expr_type base_expr_type_1
PowExprType< Expr< T1 >, Expr< T2 > >::expr_type pow(const Expr< T1 > &expr1, const Expr< T2 > &expr2)
TanExprType< T >::expr_type tan(const Expr< T > &expr)
Binary expression template.
UnaryExpr< Expr< T4 >, ExpOp > T5
ACosQuadOp(const ExprT1 &expr1, const ExprT2 &expr2)
ExprT1::scalar_type scalar_type_1
bool toBool2(const Expr< ExprT > &x)
ExprT1::value_type value_type
ExprT1::base_expr_type base_expr_type_1
ConstExpr< typename Expr< T >::value_type > ConstT
void allocateCache(int d) const
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
BinaryExpr< ExprT2, Expr< T3 >, MultiplicationOp > T4
ExprT::base_expr_type base_expr_type
value_type fastAccessCoeff(unsigned int i) const
Return degree i term of expression.
Unary expression template.
ConstExpr< typename Expr< T >::value_type > ConstT
ExprT2::base_expr_type base_expr_type
DivisionOp(const ExprT1 &expr1, const ExprT2 expr2)
ExprT1::value_type value_type_1
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
void allocateCache(int d) const
std::valarray< value_type > c
std::valarray< value_type > c
MultiplicationOp(const ExprT1 &expr1, const ExprT2 expr2)
MultiplicationOp(const ExprT1 &expr1, const ExprT2 expr2)
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
ExprT::scalar_type scalar_type
CoshOp(const ExprT &expr)
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
void allocateCache(int d) const
void allocateCache(int d) const
ExprT2::value_type value_type_2
BinaryExpr< ConstT, Expr< T2 >, DivisionOp > T3
std::valarray< value_type > c
ExprT2::scalar_type scalar_type
ExprT2::value_type value_type_2
ExprT::scalar_type scalar_type
ConstExpr< typename ExprT2::value_type > ExprT1
Sacado::Promote< scalar_type_1, scalar_type_2 >::type scalar_type
ExprT1::scalar_type scalar_type_1
ExprT::scalar_type scalar_type
Sacado::Promote< scalar_type_1, scalar_type_2 >::type scalar_type
ExprT1::scalar_type scalar_type
ConstExpr< typename Expr< T >::value_type > ConstT
std::valarray< value_type > s
ConstExpr< typename ExprT2::value_type > ExprT1
ExprT2::value_type value_type
value_type computeCoeff(int i, const ExprT &expr) const
ConstExpr< typename ExprT1::value_type > ExprT2
ExprT1::base_expr_type base_expr_type_1
std::valarray< value_type > c
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
UnaryExpr< Expr< T4 >, ExpOp > T5
Sacado::Promote< scalar_type_1, scalar_type_2 >::type scalar_type
ExprT2::base_expr_type base_expr_type_2
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
void allocateCache(int d) const
Sacado::Promote< value_type_1, value_type_2 >::type value_type
value_type coeff(unsigned int i) const
Return degree i term of expression.
Sacado::Promote< value_type_1, value_type_2 >::type value_type
UnaryExpr< Expr< T2 >, SqrtOp > T3
T & fastAccessCoeff(int i)
Returns degree i term without bounds checking.
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ACosExprType< T >::expr_type acos(const Expr< T > &expr)
#define TAYLOR_RELOP_MACRO(OP)
std::valarray< value_type > c
void allocateCache(int d) const
ExprT1::scalar_type scalar_type_1
MinOp(const ExprT1 &expr1, const ExprT2 expr2)
ExprT2::value_type value_type
expr expr expr1 expr1 expr2 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 expr1 expr1 c *expr2 expr1 c *expr2 expr1 c *expr2 expr1 DivisionOp
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
Taylor< T > sin(const Base< Taylor< T > > &a)
ExprT1::value_type value_type_1
ExprT2::value_type value_type_2
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT::base_expr_type base_expr_type
ExprT1::value_type value_type
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
BinaryExpr< Expr< T1 >, Expr< T2 >, DivisionOp > T3
Sacado::Promote< value_type_1, value_type_2 >::type value_type
ExprT2::base_expr_type base_expr_type_2
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
ExprT2::scalar_type scalar_type_2
ExprT2::base_expr_type base_expr_type
ExprT2::scalar_type scalar_type_2
SqrtOp(const ExprT &expr)
ExprT2::scalar_type scalar_type_2
ExprT2::base_expr_type base_expr_type_2
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT::value_type value_type
std::valarray< value_type > c
ConstExpr< typename ExprT2::value_type > ExprT1
ConstExpr< typename ExprT2::value_type > ExprT1
void allocateCache(int d) const
ExprT2::scalar_type scalar_type
BinaryExpr< Expr< T >, Expr< T3 >, ATanQuadOp > T4
Sacado::Promote< value_type_1, value_type_2 >::type value_type
value_type computeCoeff(int i, const ExprT &expr) const
CacheTaylor< T > diff(const CacheTaylor< T > &x, int n=1)
Compute Taylor series of n-th derivative of x.
MinOp(const ExprT1 &expr1, const ExprT2 expr2)
ExprT::base_expr_type base_expr_type
expr expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c *expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 c
UnaryExpr< Expr< T >, LogOp > T1
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
Taylor< T > cos(const Base< Taylor< T > > &a)
ExprT2::scalar_type scalar_type
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
ExprT2::value_type value_type_2
value_type computeCoeff(int i, const ExprT &expr) const
ExprT::base_expr_type base_expr_type
void allocateCache(int d) const
UnaryExpr< Expr< T >, CoshOp > T2
Sacado::Promote< base_expr_type_1, base_expr_type_2 >::type base_expr_type
ExprT1::value_type value_type_1
std::valarray< value_type > s
ExprT1::base_expr_type base_expr_type_1
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
BinaryExpr< Expr< T1 >, Expr< T2 >, DivisionOp > T3
SimpleFad< ValueT > min(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
Sacado::Promote< scalar_type_1, scalar_type_2 >::type scalar_type
ExprT1::value_type value_type_1
void allocateCache(int d) const
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT::base_expr_type base_expr_type
ExprT::value_type value_type
UnaryExpr< Expr< T >, SinOp > T1
#define TAYLOR_BINARYOP_MACRO(OPNAME, OP)
void allocateCache(int d) const
ExprT::value_type value_type
ExprT2::base_expr_type base_expr_type
Taylor< T > sinh(const Base< Taylor< T > > &a)
std::valarray< value_type > c
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
Taylor< T > sqrt(const Base< Taylor< T > > &a)
void allocateCache(int d) const
void allocateCache(int d) const
void allocateCache(int d) const
ExprT1::scalar_type scalar_type_1
AdditionOp(const ExprT1 &expr1, const ExprT2 expr2)
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
value_type computeCoeff(int i, const ExprT &expr) const
ExprT::scalar_type scalar_type
Log10ExprType< T >::expr_type log10(const Expr< T > &expr)
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
Taylor< T > max(const Base< Taylor< T > > &a, const Base< Taylor< T > > &b)
ExprT1::value_type value_type
Sacado::Promote< base_expr_type_1, base_expr_type_2 >::type base_expr_type
ExprT1::value_type value_type
BinaryExpr< Expr< T >, Expr< T4 >, ASinQuadOp > T5
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT::scalar_type scalar_type
ExprT1::scalar_type scalar_type_1
std::valarray< value_type > c
ConstExpr< typename ExprT1::value_type > ExprT2
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT1::base_expr_type base_expr_type
value_type coeff(unsigned int i) const
Return degree i term of expression.
ExprT2::base_expr_type base_expr_type_2
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
Sacado::Promote< base_expr_type_1, base_expr_type_2 >::type base_expr_type
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT1::value_type value_type_1
std::valarray< value_type > c
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT::value_type value_type
BinaryExpr< ConstT, Expr< T1 >, SubtractionOp > T2
BinaryExpr< Expr< T >, Expr< T >, MultiplicationOp > T1
ExprT1::base_expr_type base_expr_type_1
FAbsOp(const ExprT &expr)
UnaryPlusOp(const ExprT &expr)
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
value_type fastAccessCoeff(unsigned int i) const
Return degree i term of expression.
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
Sacado::Promote< base_expr_type_1, base_expr_type_2 >::type base_expr_type
ExprT::base_expr_type base_expr_type
void allocateCache(int d) const
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
BinaryExpr< ConstT, Expr< T1 >, SubtractionOp > T2
ATanExprType< T >::expr_type atan(const Expr< T > &expr)
value_type computeCoeff(int i, const ExprT &expr) const
Sacado::Promote< value_type_1, value_type_2 >::type value_type
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
UnaryExpr< ExprT1, LogOp > T3
ExprT2::value_type value_type_2
ConstExpr< typename ExprT1::value_type > ExprT2
ExprT2::scalar_type scalar_type_2
UnaryMinusOp(const ExprT &expr)
UnaryExpr< Expr< T >, SinhOp > T1
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT1::base_expr_type base_expr_type
#define TAY_BOOL_MACRO(OP)
ExprT::value_type value_type
ExprT1::base_expr_type base_expr_type
Sacado::Promote< value_type_1, value_type_2 >::type value_type
ExprT2::scalar_type scalar_type_2
Sacado::Promote< base_expr_type_1, base_expr_type_2 >::type base_expr_type
ExprT1::value_type value_type_1
Sacado::Promote< base_expr_type_1, base_expr_type_2 >::type base_expr_type
ExprT2::scalar_type scalar_type
Taylor< T > exp(const Base< Taylor< T > > &a)
BinaryExpr< Expr< T >, Expr< T >, MultiplicationOp > T1
ExprT1::scalar_type scalar_type
void allocateCache(int d) const
ExprT2::base_expr_type base_expr_type_2
ExprT1::scalar_type scalar_type
std::valarray< value_type > c
SubtractionOp(const ExprT1 &expr1, const ExprT2 expr2)
value_type computeCoeff(int i, const ExprT &expr) const
std::valarray< value_type > c
AdditionOp(const ExprT1 &expr1, const ExprT2 expr2)
ExprT2::scalar_type scalar_type_2
void allocateCache(int d) const
ExprT::value_type value_type
ConstExpr< typename ExprT2::value_type > ExprT1
#define TAYLOR_SFINAE_BINARYOP_MACRO(OPNAME, OP)
ExprT1::base_expr_type base_expr_type
ASinQuadOp(const ExprT1 &expr1, const ExprT2 &expr2)
value_type computeCoeff(int i, const ExprT &expr) const
Sacado::Promote< value_type_1, value_type_2 >::type value_type
ExprT2::value_type value_type
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
ExprT1::value_type value_type
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT::value_type value_type
ExprT::scalar_type scalar_type
ExprT2::scalar_type scalar_type
ExprT2::scalar_type scalar_type
MinOp(const ExprT1 &expr1, const ExprT2 expr2)
Taylor< T > cosh(const Base< Taylor< T > > &a)
std::valarray< value_type > c
BinaryExpr< Expr< T >, Expr< T >, MultiplicationOp > T1
ExprT::base_expr_type base_expr_type
ExprT1::scalar_type scalar_type_1
ExprT2::scalar_type scalar_type_2
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
SimpleFad< ValueT > max(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
ExprT1::value_type value_type
ExprT::base_expr_type base_expr_type
ExprT2::scalar_type scalar_type_2
ExprT1::scalar_type scalar_type_1
Sacado::Promote< value_type_1, value_type_2 >::type value_type
UnaryExpr< Expr< T4 >, ExpOp > T5
ConstExpr< typename ExprT1::value_type > ExprT2
ExprT2::base_expr_type base_expr_type_2
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
void allocateCache(int d) const
std::valarray< value_type > s
ExprT2::base_expr_type base_expr_type_2
void allocateCache(int d) const
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT::scalar_type scalar_type
Taylor< T > min(const Base< Taylor< T > > &a, const Base< Taylor< T > > &b)
Wrapper for a generic expression template.
ExprT2::value_type value_type
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT::value_type value_type
expr expr expr1 expr1 expr2 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 SubtractionOp
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT::base_expr_type base_expr_type
ExprT2::base_expr_type base_expr_type_2
void allocateCache(int d) const
ExprT2::value_type value_type
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
ExprT1::base_expr_type base_expr_type_1
void allocateCache(int d) const
Sacado::Promote< scalar_type_1, scalar_type_2 >::type scalar_type
value_type computeFastAccessCoeff(int i, const ExprT &expr) const
ExprT1::scalar_type scalar_type
value_type computeCoeff(int i, const ExprT &expr) const
ExprT::value_type value_type
Expr< BinaryExpr< Expr< T1 >, Expr< T2 >, ASinQuadOp > > asin_quad(const Expr< T1 > &expr1, const Expr< T2 > &expr2)
ExprT::scalar_type scalar_type
ExprT2::base_expr_type base_expr_type
Sacado::Promote< base_expr_type_1, base_expr_type_2 >::type base_expr_type
Sacado::Promote< scalar_type_1, scalar_type_2 >::type scalar_type
DivisionOp(const ExprT1 &expr1, const ExprT2 expr2)
Sacado::Promote< scalar_type_1, scalar_type_2 >::type scalar_type
ExprT2::scalar_type scalar_type_2
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
BinaryExpr< ExprT2, ConstExpr< T1 >, MultiplicationOp > T4
void allocateCache(int d) const
ExprT2::value_type value_type_2
ExprT1::scalar_type scalar_type_1
value_type computeCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const
void allocateCache(int d) const
MaxOp(const ExprT1 &expr1, const ExprT2 expr2)
ExprT1::scalar_type scalar_type
ExprT1::value_type value_type_1
ExprT1::value_type value_type_1
UnaryExpr< ExprT1, LogOp > T3
BinaryExpr< ConstExpr< T2 >, Expr< T3 >, MultiplicationOp > T4
ExprT1::base_expr_type base_expr_type
BinaryExpr< ConstT, Expr< T1 >, AdditionOp > T2
ExprT1::value_type value_type_1
value_type computeFastAccessCoeff(int i, const ExprT1 &expr1, const ExprT2 &expr2) const