/* $Id: ntr.h 1.17 02/09/16 23:00:56-05:00 benson@rockies.mcs.anl.gov $ */

/*
    Context for a Newton trust region method (unconstrained minimization)
 */

#ifndef __TAO_NTR_H
#define __TAO_NTR_H
#include "tao_solver.h"

typedef struct {
  TaoVec *S, *Xtrial;
  TaoVec *G;

  double delta;		/* trust region parameter */
  double eta1;		/* step is unsuccessful if actred < eta1 * prered,
			   where prered is the predicted reduction and 
			   actred is the actual reduction */
  double eta2;		/* used to compute trust region parameter */
  double eta3;		/* used to compute trust region parameter */
  double eta4;		/* used to compute trust region parameter */
  double factor1;	/* used to initialize trust region parameter */
  double actred;	/* actual reduction */
  double prered;	/* predicted reduction */
  double xnorm;
  int    success;	/* indicator for successful step */
  int    sflag;		/* flag for convergence testing */
} TAO_NTR;

EXTERN_C_BEGIN
extern int TaoGetTrustRegionRadius_NTR(TAO_SOLVER, double*);
extern int TaoSetTrustRegionRadius_NTR(TAO_SOLVER, double);
EXTERN_C_END

#endif
