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