10 #ifndef SACADO_TAY_CACHETAYLOROPS_HPP
11 #define SACADO_TAY_CACHETAYLOROPS_HPP
26 template <
typename ExprT>
43 const ExprT& expr)
const {
44 return expr.fastAccessCoeff(i);
51 template <
typename ExprT>
64 return -expr.coeff(i);
68 const ExprT& expr)
const {
69 return -expr.fastAccessCoeff(i);
76 template <
typename ExprT>
93 if (static_cast<int>(i) >
dc) {
98 for (
int k=
dc+1; k<=
i; k++) {
99 for (
int j=1; j<=k; j++)
109 const ExprT& expr)
const
111 if (static_cast<int>(i) >
dc) {
113 c[0] =
std::exp(expr.fastAccessCoeff(0));
116 for (
int k=
dc+1; k<=
i; k++) {
117 for (
int j=1; j<=k; j++)
128 mutable std::valarray<value_type>
c;
135 template <
typename ExprT>
153 if (static_cast<int>(i) >
dc) {
155 c[0] =
std::log(expr.fastAccessCoeff(0));
158 for (
int k=
dc+1; k<=
i; k++) {
160 for (
int j=1; j<=k-1; j++)
170 const ExprT& expr)
const
172 if (static_cast<int>(i) >
dc) {
174 c[0] =
std::log(expr.fastAccessCoeff(0));
177 for (
int k=
dc+1; k<=
i; k++) {
179 for (
int j=1; j<=k-1; j++)
190 mutable std::valarray<value_type>
c;
197 template <
typename ExprT>
214 if (static_cast<int>(i) >
dc) {
220 for (
int k=
dc+1; k<=
i; k++) {
221 c[k] = expr.coeff(k);
222 for (
int j=1; j<=k-1; j++)
232 const ExprT& expr)
const
234 if (static_cast<int>(i) >
dc) {
240 for (
int k=
dc+1; k<=
i; k++) {
241 c[k] = expr.fastAccessCoeff(k);
242 for (
int j=1; j<=k-1; j++)
253 mutable std::valarray<value_type>
c;
260 template <
typename ExprT>
279 if (static_cast<int>(i) >
dc) {
281 c[0] =
std::cos(expr.fastAccessCoeff(0));
282 s[0] =
std::sin(expr.fastAccessCoeff(0));
285 for (
int k=
dc+1; k<=
i; k++) {
286 for (
int j=1; j<=k; j++) {
299 const ExprT& expr)
const
301 if (static_cast<int>(i) >
dc) {
303 c[0] =
std::cos(expr.fastAccessCoeff(0));
304 s[0] =
std::sin(expr.fastAccessCoeff(0));
307 for (
int k=
dc+1; k<=
i; k++) {
308 for (
int j=1; j<=k; j++) {
322 mutable std::valarray<value_type>
c;
323 mutable std::valarray<value_type>
s;
330 template <
typename ExprT>
349 if (static_cast<int>(i) >
dc) {
351 c[0] =
std::cos(expr.fastAccessCoeff(0));
352 s[0] =
std::sin(expr.fastAccessCoeff(0));
355 for (
int k=
dc+1; k<=
i; k++) {
356 for (
int j=1; j<=k; j++) {
369 const ExprT& expr)
const
371 if (static_cast<int>(i) >
dc) {
373 c[0] =
std::cos(expr.fastAccessCoeff(0));
374 s[0] =
std::sin(expr.fastAccessCoeff(0));
377 for (
int k=
dc+1; k<=
i; k++) {
378 for (
int j=1; j<=k; j++) {
392 mutable std::valarray<value_type>
c;
393 mutable std::valarray<value_type>
s;
400 template <
typename ExprT>
419 if (static_cast<int>(i) >
dc) {
425 for (
int k=
dc+1; k<=
i; k++) {
426 for (
int j=1; j<=k; j++) {
439 const ExprT& expr)
const
441 if (static_cast<int>(i) >
dc) {
447 for (
int k=
dc+1; k<=
i; k++) {
448 for (
int j=1; j<=k; j++) {
462 mutable std::valarray<value_type>
c;
463 mutable std::valarray<value_type>
s;
470 template <
typename ExprT>
489 if (static_cast<int>(i) >
dc) {
495 for (
int k=
dc+1; k<=
i; k++) {
496 for (
int j=1; j<=k; j++) {
509 const ExprT& expr)
const
511 if (static_cast<int>(i) >
dc) {
517 for (
int k=
dc+1; k<=
i; k++) {
518 for (
int j=1; j<=k; j++) {
532 mutable std::valarray<value_type>
c;
533 mutable std::valarray<value_type>
s;
540 template <
typename ExprT>
553 if (expr.fastAccessCoeff(0) > 0)
554 return expr.coeff(i);
556 return -expr.coeff(i);
560 const ExprT& expr)
const
562 if (expr.fastAccessCoeff(0) > 0)
563 return expr.fastAccessCoeff(i);
565 return -expr.fastAccessCoeff(i);
574 #define TAYLOR_UNARYOP_MACRO(OPNAME,OP) \
577 template <typename T> \
578 inline Expr< UnaryExpr< Expr<T>, OP > > \
579 OPNAME (const Expr<T>& expr) \
581 typedef UnaryExpr< Expr<T>, OP > expr_t; \
583 return Expr<expr_t>(expr_t(expr)); \
589 using Sacado::Tay::OPNAME; \
604 #undef TAYLOR_UNARYOP_MACRO
612 template <
typename ExprT1,
typename ExprT2>
637 const ExprT2& expr2)
const {
638 return expr1.coeff(i) + expr2.coeff(i);
643 const ExprT2& expr2)
const {
644 return expr1.fastAccessCoeff(i) + expr2.fastAccessCoeff(i);
649 template <
typename ExprT1>
664 const ExprT2& expr2)
const {
666 return expr1.coeff(i) + expr2.
coeff(i);
668 return expr1.coeff(i);
673 const ExprT2& expr2)
const {
677 return expr1.fastAccessCoeff(i);
682 template <
typename ExprT2>
697 const ExprT2& expr2)
const {
699 return expr1.
coeff(i) + expr2.coeff(i);
701 return expr2.coeff(i);
706 const ExprT2& expr2)
const {
710 return expr2.fastAccessCoeff(i);
717 template <
typename ExprT1,
typename ExprT2>
742 const ExprT2& expr2)
const {
743 return expr1.coeff(i) - expr2.coeff(i);
748 const ExprT2& expr2)
const {
749 return expr1.fastAccessCoeff(i) - expr2.fastAccessCoeff(i);
754 template <
typename ExprT1>
769 const ExprT2& expr2)
const {
771 return expr1.coeff(i) - expr2.
coeff(i);
773 return expr1.coeff(i);
778 const ExprT2& expr2)
const {
782 return expr1.fastAccessCoeff(i);
787 template <
typename ExprT2>
802 const ExprT2& expr2)
const {
804 return expr1.
coeff(i) - expr2.coeff(i);
806 return -expr2.coeff(i);
811 const ExprT2& expr2)
const {
815 return -expr2.fastAccessCoeff(i);
822 template <
typename ExprT1,
typename ExprT2>
851 const ExprT2& expr2)
const {
852 if (static_cast<int>(i) >
dc) {
853 for (
int k=
dc+1; k<=
i; k++) {
854 for (
int j=0; j<=k; j++)
855 c[k] += expr1.coeff(j)*expr2.coeff(k-j);
864 const ExprT2& expr2)
const {
865 if (static_cast<int>(i) >
dc) {
866 for (
int k=
dc+1; k<=
i; k++) {
867 for (
int j=0; j<=k; j++)
868 c[k] += expr1.fastAccessCoeff(j)*expr2.fastAccessCoeff(k-j);
877 mutable std::valarray<value_type>
c;
882 template <
typename ExprT1>
897 const ExprT2& expr2)
const {
898 return expr1.coeff(i)*expr2.
value();
903 const ExprT2& expr2)
const {
904 return expr1.fastAccessCoeff(i)*expr2.
value();
909 template <
typename ExprT2>
924 const ExprT2& expr2)
const {
925 return expr1.
value()*expr2.coeff(i);
930 const ExprT2& expr2)
const {
931 return expr1.
value()*expr2.fastAccessCoeff(i);
938 template <
typename ExprT1,
typename ExprT2>
967 const ExprT2& expr2)
const {
968 if (static_cast<int>(i) >
dc) {
969 for (
int k=
dc+1; k<=
i; k++) {
970 c[k] = expr1.coeff(k);
971 for (
int j=1; j<=k; j++)
972 c[k] -= expr2.coeff(j)*
c[k-j];
973 c[k] /= expr2.fastAccessCoeff(0);
982 const ExprT2& expr2)
const {
983 if (static_cast<int>(i) >
dc) {
984 for (
int k=
dc+1; k<=
i; k++) {
985 c[k] = expr1.coeff(k);
986 for (
int j=1; j<=k; j++)
987 c[k] -= expr2.fastAccessCoeff(j)*
c[k-j];
988 c[k] /= expr2.fastAccessCoeff(0);
997 mutable std::valarray<value_type>
c;
1002 template <
typename ExprT1>
1017 const ExprT2& expr2)
const {
1018 return expr1.coeff(i)/expr2.
value();
1023 const ExprT2& expr2)
const {
1024 return expr1.fastAccessCoeff(i)/expr2.
value();
1029 template <
typename ExprT2>
1048 const ExprT2& expr2)
const {
1049 if (static_cast<int>(i) >
dc) {
1054 for (
int k=
dc+1; k<=
i; k++) {
1055 for (
int j=1; j<=k; j++)
1056 c[k] -= expr2.coeff(j)*
c[k-j];
1057 c[k] /= expr2.fastAccessCoeff(0);
1066 const ExprT2& expr2)
const {
1067 if (static_cast<int>(i) >
dc) {
1072 for (
int k=
dc+1; k<=
i; k++) {
1074 for (
int j=1; j<=k; j++)
1075 c[k] -= expr2.fastAccessCoeff(j)*
c[k-j];
1076 c[k] /= expr2.fastAccessCoeff(0);
1085 mutable std::valarray<value_type>
c;
1092 template <
typename ExprT1,
typename ExprT2>
1111 MaxOp(
const ExprT1& expr1,
const ExprT2 expr2) {}
1117 const ExprT2& expr2)
const {
1119 return std::max(expr1.coeff(0), expr2.coeff(0));
1121 return expr1.coeff(0) >= expr2.coeff(0) ? expr1.coeff(i) :
1127 const ExprT2& expr2)
const {
1129 return std::max(expr1.fastAccessCoeff(0), expr2.fastAccessCoeff(0));
1131 return expr1.fastAccessCoeff(0) >= expr2.fastAccessCoeff(0) ?
1132 expr1.fastAccessoeff(i) : expr2.fastAccessCoeff(i);
1137 template <
typename ExprT1>
1152 const ExprT2& expr2)
const {
1156 return expr1.coeff(0) >= expr2.
value() ? expr1.coeff(i) :
1162 const ExprT2& expr2)
const {
1166 return expr1.fastAccessCoeff(0) >= expr2.
value() ?
1172 template <
typename ExprT2>
1187 const ExprT2& expr2)
const {
1197 const ExprT2& expr2)
const {
1202 expr2.fastAccessCoeff(i);
1209 template <
typename ExprT1,
typename ExprT2>
1227 MinOp(
const ExprT1& expr1,
const ExprT2 expr2) {}
1233 const ExprT2& expr2)
const {
1235 return min(expr1.coeff(0), expr2.coeff(0));
1237 return expr1.coeff(0) <= expr2.coeff(0) ? expr1.coeff(i) :
1243 const ExprT2& expr2)
const {
1245 return min(expr1.fastAccessCoeff(0), expr2.fastAccessCoeff(0));
1247 return expr1.fastAccessCoeff(0) <= expr2.fastAccessCoeff(0) ?
1248 expr1.fastAccessCoeff(i) : expr2.fastAccessCoeff(i);
1253 template <
typename ExprT1>
1268 const ExprT2& expr2)
const {
1272 return expr1.coeff(0) <= expr2.
value() ? expr1.coeff(i) :
1278 const ExprT2& expr2)
const {
1282 return expr1.fastAccessCoeff(0) <= expr2.
value() ?
1288 template <
typename ExprT2>
1303 const ExprT2& expr2)
const {
1313 const ExprT2& expr2)
const {
1318 expr2.fastAccessCoeff(i);
1325 template <
typename ExprT1,
typename ExprT2>
1354 const ExprT2& expr2)
const {
1355 if (static_cast<int>(i) >
dc) {
1360 for (
int k=
dc+1; k<=
i; k++) {
1361 for (
int j=1; j<=k; j++)
1362 c[k] +=
value_type(j)*expr2.coeff(k-j)*expr1.coeff(j);
1371 const ExprT1& expr1,
1372 const ExprT2& expr2)
const
1374 if (static_cast<int>(i) >
dc) {
1379 for (
int k=
dc+1; k<=
i; k++) {
1380 for (
int j=1; j<=k; j++)
1382 expr1.fastAccessCoeff(j);
1392 mutable std::valarray<value_type>
c;
1397 template <
typename ExprT1,
typename ExprT2>
1426 const ExprT2& expr2)
const {
1427 if (static_cast<int>(i) >
dc) {
1432 for (
int k=
dc+1; k<=
i; k++) {
1433 for (
int j=1; j<=k; j++)
1434 c[k] +=
value_type(j)*expr2.coeff(k-j)*expr1.coeff(j);
1443 const ExprT1& expr1,
1444 const ExprT2& expr2)
const
1446 if (static_cast<int>(i) >
dc) {
1451 for (
int k=
dc+1; k<=
i; k++) {
1452 for (
int j=1; j<=k; j++)
1454 expr1.fastAccessCoeff(j);
1464 mutable std::valarray<value_type>
c;
1469 template <
typename ExprT1,
typename ExprT2>
1498 const ExprT2& expr2)
const {
1499 if (static_cast<int>(i) >
dc) {
1504 for (
int k=
dc+1; k<=
i; k++) {
1505 for (
int j=1; j<=k; j++)
1506 c[k] +=
value_type(j)*expr2.coeff(k-j)*expr1.coeff(j);
1515 const ExprT1& expr1,
1516 const ExprT2& expr2)
const
1518 if (static_cast<int>(i) >
dc) {
1523 for (
int k=
dc+1; k<=
i; k++) {
1524 for (
int j=1; j<=k; j++)
1526 expr1.fastAccessCoeff(j);
1536 mutable std::valarray<value_type>
c;
1545 #define TAYLOR_BINARYOP_MACRO(OPNAME,OP) \
1546 namespace Sacado { \
1548 template <typename T1, typename T2> \
1549 inline Expr< BinaryExpr< Expr<T1>, Expr<T2>, OP > > \
1550 OPNAME (const Expr<T1>& expr1, const Expr<T2>& expr2) \
1552 typedef BinaryExpr< Expr<T1>, Expr<T2>, OP > expr_t; \
1554 return Expr<expr_t>(expr_t(expr1, expr2)); \
1557 template <typename T> \
1558 inline Expr< BinaryExpr< ConstExpr<typename Expr<T>::value_type>, \
1560 OPNAME (const typename Expr<T>::value_type& c, \
1561 const Expr<T>& expr) \
1563 typedef ConstExpr<typename Expr<T>::value_type> ConstT; \
1564 typedef BinaryExpr< ConstT, Expr<T>, OP > expr_t; \
1566 return Expr<expr_t>(expr_t(ConstT(c), expr)); \
1569 template <typename T> \
1570 inline Expr< BinaryExpr< Expr<T>, \
1571 ConstExpr<typename Expr<T>::value_type>, \
1573 OPNAME (const Expr<T>& expr, \
1574 const typename Expr<T>::value_type& c) \
1576 typedef ConstExpr<typename Expr<T>::value_type> ConstT; \
1577 typedef BinaryExpr< Expr<T>, ConstT, OP > expr_t; \
1579 return Expr<expr_t>(expr_t(expr, ConstT(c))); \
1589 #undef TAYLOR_BINARYOP_MACRO
1597 #define TAYLOR_SFINAE_BINARYOP_MACRO(OPNAME,OP) \
1598 namespace Sacado { \
1600 template <typename T1, typename T2> \
1603 mpl::disable_if< std::is_same<T1,T2>, \
1604 Expr<BinaryExpr<Expr<T1>, Expr<T2>, OP> > >::type \
1605 OPNAME (const Expr<T1>& expr1, const Expr<T2>& expr2) \
1607 typedef BinaryExpr< Expr<T1>, Expr<T2>, OP > expr_t; \
1609 return Expr<expr_t>(expr_t(expr1, expr2)); \
1612 template <typename T> \
1613 inline Expr< BinaryExpr< ConstExpr<typename Expr<T>::value_type>, \
1615 OPNAME (const typename Expr<T>::value_type& c, \
1616 const Expr<T>& expr) \
1618 typedef ConstExpr<typename Expr<T>::value_type> ConstT; \
1619 typedef BinaryExpr< ConstT, Expr<T>, OP > expr_t; \
1621 return Expr<expr_t>(expr_t(ConstT(c), expr)); \
1624 template <typename T> \
1625 inline Expr< BinaryExpr< Expr<T>, \
1626 ConstExpr<typename Expr<T>::value_type>, \
1628 OPNAME (const Expr<T>& expr, \
1629 const typename Expr<T>::value_type& c) \
1631 typedef ConstExpr<typename Expr<T>::value_type> ConstT; \
1632 typedef BinaryExpr< Expr<T>, ConstT, OP > expr_t; \
1634 return Expr<expr_t>(expr_t(expr, ConstT(c))); \
1642 #undef TAYLOR_SFINAE_BINARYOP_MACRO
1653 template <
typename T1,
typename T2>
1654 inline Expr< BinaryExpr< Expr<T1>, Expr<T2>, ASinQuadOp > >
1662 template <
typename T1,
typename T2>
1663 inline Expr< BinaryExpr< Expr<T1>, Expr<T2>, ACosQuadOp > >
1671 template <
typename T1,
typename T2>
1672 inline Expr< BinaryExpr< Expr<T1>, Expr<T2>, ATanQuadOp > >
1680 template <
typename ExprT1,
typename ExprT2>
1689 template <
typename ExprT2>
1691 typedef typename ExprT2::value_type
T1;
1698 template <
typename ExprT1>
1700 typedef typename ExprT1::value_type
T2;
1708 template <
typename T1,
typename T2>
1713 return exp(expr2*
log(expr1));
1716 template <
typename T>
1717 inline typename PowExprType< typename Expr<T>::value_type, Expr<T> >::expr_type
1724 template <
typename T>
1725 inline typename PowExprType< Expr<T>,
typename Expr<T>::value_type >::expr_type
1732 template <
typename T>
1740 template <
typename T>
1748 template <
typename T>
1756 template <
typename T>
1761 return sin(expr)/
cos(expr);
1764 template <
typename T>
1775 template <
typename T>
1782 return asin_quad(expr, value_type(1)/
sqrt(value_type(1)-expr*expr));
1785 template <
typename T>
1796 template <
typename T>
1803 return acos_quad(expr, value_type(-1)/
sqrt(value_type(1)-expr*expr));
1806 template <
typename T>
1816 template <
typename T>
1823 return atan_quad(expr, value_type(1)/(value_type(1)+expr*expr));
1826 template <
typename T>
1834 template <
typename T>
1858 #define TAYLOR_RELOP_MACRO(OP) \
1859 namespace Sacado { \
1861 template <typename ExprT1, typename ExprT2> \
1863 operator OP (const Expr<ExprT1>& expr1, \
1864 const Expr<ExprT2>& expr2) \
1866 return expr1.fastAccessCoeff(0) OP expr2.fastAccessCoeff(0); \
1869 template <typename ExprT2> \
1871 operator OP (const typename Expr<ExprT2>::value_type& a, \
1872 const Expr<ExprT2>& expr2) \
1874 return a OP expr2.fastAccessCoeff(0); \
1877 template <typename ExprT1> \
1879 operator OP (const Expr<ExprT1>& expr1, \
1880 const typename Expr<ExprT1>::value_type& b) \
1882 return expr1.fastAccessCoeff(0) OP b; \
1898 #undef TAYLOR_RELOP_MACRO
1904 template <
typename ExprT>
1919 template <
typename ExprT>
1921 bool is_zero =
true;
1923 is_zero = is_zero && (x.
coeff(
i) == 0.0);
1931 #define TAY_BOOL_MACRO(OP) \
1932 namespace Sacado { \
1934 template <typename ExprT1, typename ExprT2> \
1936 operator OP (const Expr<ExprT1>& expr1, \
1937 const Expr<ExprT2>& expr2) \
1939 return toBool2(expr1) OP toBool2(expr2); \
1942 template <typename ExprT2> \
1944 operator OP (const typename Expr<ExprT2>::value_type& a, \
1945 const Expr<ExprT2>& expr2) \
1947 return a OP toBool2(expr2); \
1950 template <typename ExprT1> \
1952 operator OP (const Expr<ExprT1>& expr1, \
1953 const typename Expr<ExprT1>::value_type& b) \
1955 return toBool2(expr1) OP b; \
1963 #undef TAY_BOOL_MACRO
1971 template <
typename ExprT>
1972 std::ostream& operator << (std::ostream& os, const Expr<ExprT>&
x) {
1973 os.setf(std::ios::fixed, std::ios::floatfield);
1977 for (
int i=0;
i<=
x.degree();
i++) {
1987 template <
typename T>
1989 const int d = x.
degree();
1998 for (
int i=1;
i<=
n; ++
i)
2000 for (
int i=
n;
i<=d; ++
i) {
2002 c = (c / (
i-
n+1)) * (
i+1);
2012 #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
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)
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
expr1 expr1 expr2 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 MultiplicationOp
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
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
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 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
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