Actual source code: ipm.h

      1: #pragma once
      2: #include <petsc/private/taoimpl.h>

      4: /*
      5:  Context for Interior-Point Method
      6: */

      8: typedef struct {
      9:   PetscInt      mi, me, n, nxb, nib, nb, nslack;
     10:   PetscInt      nuser_inequalities;
     11:   PetscInt      nxlb, nxub, niub, nilb;
     12:   PetscScalar   sig, mu, taumin, dec;
     13:   PetscScalar   muaff;
     14:   TaoLineSearch lag_ls;
     15:   Vec           work, rhs_x, save_x;
     16:   Vec           lambdai, dlambdai, rhs_lambdai, save_lambdai;
     17:   Vec           lambdae, dlambdae, rhs_lambdae, save_lambdae;
     18:   Vec           s, ds, rhs_s, save_s;
     19:   Vec           ci;
     20:   Vec           Zero_nb, One_nb, Inf_nb;
     21:   PetscScalar   kkt_f;           /* d'*x + (1/2)*x'*H*x; */
     22:   Vec           rd;              /* H*x + d + Ae'*lambdae - Ai'*lambdai */
     23:   Vec           rpe;             /* residual  Ae*x - be */
     24:   Vec           rpi;             /*           Ai*x - yi - bi */
     25:   Vec           complementarity; /* yi.*lambdai */
     26:   PetscScalar   phi;
     27:   Mat           L;  /* diag(lambdai) */
     28:   Mat           Y;  /* diag(yi) */
     29:   Mat           Ai; /* JacI (lb)
     30:               -JacI (ub)
     31:               I (xlb)
     32:               -I (xub) */
     33:   Mat           K;  /* [ H , 0,   Ae',-Ai'];
     34:             [Ae , 0,   0  , 0];
     35:             [Ai ,-Imi, 0 ,  0];
     36:             [ 0 , L ,  0 ,  Y ];  */

     38:   Vec         bigrhs;  /* rhs [x; lambdae; yi; lambdai] */
     39:   Vec         bigstep; /* [dx; dyi; dlambdae; dlambdai] */
     40:   PetscBool   monitorkkt;
     41:   PetscScalar alpha1, alpha2;
     42:   PetscScalar pushs, pushnu;
     43:   IS          isxl, isxu, isil, isiu;
     44:   VecScatter  ci_scat, xl_scat, xu_scat;
     45:   VecScatter  step1, step2, step3, step4;
     46:   VecScatter  rhs1, rhs2, rhs3, rhs4;
     47: } TAO_IPM;