Prev Next Default.cpp Headings

Default AD Constructor: Example and Test


# include <cppad/cppad.hpp>

bool Default(void)
{    bool ok = true;
     using CppAD::AD;

     // default AD constructor
     AD<double> x, y;

     // check that they are parameters
     ok &= Parameter(x);
     ok &= Parameter(y);

     // assign them values
     x = 3.; 
     y = 4.;

     // just check a simple operation
     ok &= (x + y == 7.);

     return ok;
}


Input File: example/default.cpp