Actual source code: owlqn.h
1: /*
2: Context for limited memory variable metric method for unconstrained
3: optimization.
4: */
6: #pragma once
7: #include <petsc/private/taoimpl.h>
9: typedef struct {
10: Mat M;
12: Vec X;
13: Vec G;
14: Vec D;
15: Vec W;
16: Vec GV; /* the pseudo gradient */
18: Vec Xold;
19: Vec Gold;
21: PetscInt bfgs;
22: PetscInt sgrad;
23: PetscInt grad;
25: PetscReal lambda;
26: } TAO_OWLQN;
28: static PetscErrorCode ProjDirect_OWLQN(Vec d, Vec g);
30: static PetscErrorCode ComputePseudoGrad_OWLQN(Vec x, Vec gv, PetscReal lambda);