Date: 2022-03-31T04:48:59+00:00

Actual source code: rosenbrock1f.h

      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: ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -