Actual source code: rosenbrock1f.h

petsc-3.12.1 2019-10-22
Report Typos and Errors
  1: #include "petsc/finclude/petsctao.h"
  2:       use petsctao
  3:       implicit none

  5: !  Common blocks:
  6: !  In this example we use common blocks to store data needed by the
  7: !  application-provided call-back routines, FormMinimizationFunction(),
  8: !  FormFunctionGradient(), and FormHessian().  Note that we can store
  9: !  (pointers to) TAO objects within these common blocks.
 10: !
 11: !  common /params/ - contains parameters that help to define the application
 12: !
 13: !     alpha, n - define the extended Rosenbrock function:
 14: !       sum_{i=0}^{n/2-1} ( alpha*(x_{2i+1}-x_{2i}^2)^2 + (1-x_{2i})^2 )

 16:       PetscReal        alpha
 17:       PetscInt         n

 19:       common /params/ alpha, n

 21: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -