Actual source code: ntl.h

  1: /*$Id: ntl.h,v 1.2 2008-08-18 19:50:51 sarich Exp $*/

  3: // Context for a Newton trust-region, line-search method for unconstrained 
  4: // minimization

  6: #ifndef __TAO_NTL_H
  8: #include "tao_solver.h"
  9: #include "src/matrix/lmvmmat.h"

 11: typedef struct {
 12:   TaoLMVMMat *M;

 14:   TaoVec *G;
 15:   TaoVec *D;
 16:   TaoVec *W;

 18:   TaoVec *Xold;
 19:   TaoVec *Gold;
 20:   TaoVec *Diag;

 22:   // Parameters when updating the trust-region radius based on steplength
 23:   double nu1;                // used to compute trust-region radius
 24:   double nu2;                // used to compute trust-region radius
 25:   double nu3;                // used to compute trust-region radius
 26:   double nu4;                // used to compute trust-region radius

 28:   double omega1;        // factor used for trust-region update
 29:   double omega2;        // factor used for trust-region update
 30:   double omega3;        // factor used for trust-region update
 31:   double omega4;        // factor used for trust-region update
 32:   double omega5;        // factor used for trust-region update

 34:   // if   step < nu1                  (very bad step)
 35:   //   radius = omega1 * min(norm(d), radius)
 36:   // elif step < nu2                (bad step)
 37:   //   radius = omega2 * min(norm(d), radius)
 38:   // elif step < nu3                (okay step)
 39:   //   radius = omega3 * radius;
 40:   // elif step < nu4                (good step)
 41:   //   radius = max(omega4 * norm(d), radius)
 42:   // else                         (very good step)
 43:   //   radius = max(omega5 * norm(d), radius)
 44:   // fi
 45:  
 46:   // Parameters when updating the trust-region radius based on reduction
 47:   double eta1;                // used to compute trust-region radius
 48:   double eta2;                // used to compute trust-region radius
 49:   double eta3;                // used to compute trust-region radius
 50:   double eta4;                // used to compute trust-region radius

 52:   double alpha1;        // factor used for trust-region update
 53:   double alpha2;        // factor used for trust-region update
 54:   double alpha3;        // factor used for trust-region update
 55:   double alpha4;        // factor used for trust-region update
 56:   double alpha5;        // factor used for trust-region update

 58:   // kappa = ared / pred
 59:   // if   kappa < eta1                 (very bad step)
 60:   //   radius = alpha1 * min(norm(d), radius)
 61:   // elif kappa < eta2                (bad step)
 62:   //   radius = alpha2 * min(norm(d), radius)
 63:   // elif kappa < eta3                (okay step)
 64:   //   radius = alpha3 * radius;
 65:   // elif kappa < eta4                (good step)
 66:   //   radius = max(alpha4 * norm(d), radius)
 67:   // else                         (very good step)
 68:   //   radius = max(alpha5 * norm(d), radius)
 69:   // fi
 70:  
 71:   // Parameters when updating the trust-region radius based on interpolation
 72:   double mu1;                // used for model agreement in interpolation
 73:   double mu2;                // used for model agreement in interpolation

 75:   double gamma1;        // factor used for interpolation
 76:   double gamma2;        // factor used for interpolation
 77:   double gamma3;        // factor used for interpolation
 78:   double gamma4;        // factor used for interpolation

 80:   double theta;                // factor used for interpolation

 82:   // kappa = ared / pred
 83:   // if   kappa >= 1.0 - mu1        (very good step)
 84:   //   choose tau in [gamma3, gamma4]
 85:   //   radius = max(tau * norm(d), radius)
 86:   // elif kappa >= 1.0 - mu2    (good step)
 87:   //   choose tau in [gamma2, gamma3]
 88:   //   if (tau >= 1.0)
 89:   //     radius = max(tau * norm(d), radius)
 90:   //   else
 91:   //     radius = tau * min(norm(d), radius)
 92:   //   fi
 93:   // else                         (bad step)
 94:   //   choose tau in [gamma1, 1.0]
 95:   //   radius = tau * min(norm(d), radius)
 96:   // fi
 97:  
 98:   // Parameters when initializing trust-region radius based on interpolation
 99:   double mu1_i;                // used for model agreement in interpolation
100:   double mu2_i;                // used for model agreement in interpolation

102:   double gamma1_i;        // factor used for interpolation
103:   double gamma2_i;        // factor used for interpolation
104:   double gamma3_i;        // factor used for interpolation
105:   double gamma4_i;        // factor used for interpolation

107:   double theta_i;        // factor used for interpolation

109:   // Other parameters
110:   double min_radius;    // lower bound on initial radius value
111:   double max_radius;    // upper bound on trust region radius
112:   double epsilon;       // tolerance used when computing ared/pred

114:   TaoInt trust;                // Trust-region steps accepted
115:   TaoInt newt;                // Newton directions attempted
116:   TaoInt bfgs;                // BFGS directions attempted
117:   TaoInt sgrad;                // Scaled gradient directions attempted
118:   TaoInt grad;                // Gradient directions attempted

120:   TaoInt ksp_type;                // KSP method for the code
121:   TaoInt pc_type;                // Preconditioner for the code
122:   TaoInt bfgs_scale_type;        // Scaling matrix to used for the bfgs preconditioner
123:   TaoInt init_type;        // Trust-region initialization method
124:   TaoInt update_type;      // Trust-region update method
125: } TAO_NTL;

127: #endif