26 template <
typename ScalarT>
27 ScalarT
func(
const ScalarT&
a,
const ScalarT& b,
const ScalarT&
c) {
35 int main(
int argc,
char **argv)
54 double r =
func(a, b, c);
57 rfad =
func(afad, bfad, cfad);
59 std::cout << rfad << std::endl;
62 double r_ad = rfad.val();
63 bool drda_ad = rfad.dx(0);
64 bool drdb_ad = rfad.dx(1);
65 bool drdc_ad = rfad.dx(2);
68 if (
std::fabs(r - r_ad) < tol && drda_ad && drdb_ad && !drdc_ad) {
69 std::cout <<
"\nExample passed!" << std::endl;
73 std::cout <<
"\nSomething is wrong, example failed!" << std::endl;
Sacado::Fad::DFad< double > FadType
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
const T func(int n, T *x)