48 template <
typename ScalarT>
49 ScalarT
func(
const ScalarT&
a,
const ScalarT& b,
const ScalarT&
c) {
57 int main(
int argc,
char **argv)
76 double r =
func(a, b, c);
79 rfad =
func(afad, bfad, cfad);
81 std::cout << rfad << std::endl;
84 double r_ad = rfad.val();
85 bool drda_ad = rfad.dx(0);
86 bool drdb_ad = rfad.dx(1);
87 bool drdc_ad = rfad.dx(2);
90 if (
std::fabs(r - r_ad) < tol && drda_ad && drdb_ad && !drdc_ad) {
91 std::cout <<
"\nExample passed!" << std::endl;
95 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)