ROL
|
An example combining ROL and Sacado to mimize the Zakharov function. The gradient and the action of the Hessian on a given vector are computed by Sacado using automatic differentiation. More...
#include <iostream>
#include "ROL_Sacado_Objective.hpp"
#include "ROL_Algorithm.hpp"
#include "ROL_LineSearchStep.hpp"
#include "ROL_StatusTest.hpp"
#include "ROL_ParameterList.hpp"
#include "ROL_Stream.hpp"
#include "Teuchos_GlobalMPISession.hpp"
#include "example_01a.hpp"
Go to the source code of this file.
Typedefs | |
typedef double | RealT |
Functions | |
int | main (int argc, char **argv) |
An example combining ROL and Sacado to mimize the Zakharov function. The gradient and the action of the Hessian on a given vector are computed by Sacado using automatic differentiation.
This implementation is far from optimal as vectors of AD type are being created repeatedly. A more efficient implementation would encapsulate the functions Zakharov, objgrad, and hessVec in an object so that the AD vectors can be instantiated once.
Definition in file example_01a.cpp.
typedef double RealT |
Definition at line 73 of file example_01a.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 75 of file example_01a.cpp.
References ROL::StdVector< Real, Element >::axpy(), dim, ROL::StdVector< Real, Element >::norm(), and ROL::Algorithm< Real >::run().