Actual source code: taoappobject.h

  1: #ifndef TAOPROBLEMOBJECT_H
  2: #define TAOPROBLEMOBJECT_H

  4: /** 
  5:     An abstract class representing an optimization application.  The
  6:     methods in this class will be called by the optimization solver. 
  7: **/

  9: #include "tao_basictypes.h"

 11: class TaoVec;
 12: class TaoIndexSet;
 13: class TaoMat;
 14: class TaoLinearSolver;

 16: class TaoApplication {
 17: 
 18:  public:
 19: 
 20:   virtual ~TaoApplication(){};
 21: 
 22:   /* This method is really important and used frequently */
 23:   virtual int EvaluateObjectiveAndGradient(TaoVec *, double *, TaoVec *);

 25:   /* This method not often used, except by direct search methods  */
 26:   virtual int EvaluateObjectiveFunction(TaoVec *, double *);

 28:   /* This method not often used  */
 29:   virtual int EvaluateGradient(TaoVec *, TaoVec *);

 31:   /* This method is used only by some solvers */
 32:   virtual int EvaluateHessian(TaoVec *, TaoMat *);

 34:   /* This method is used only by some solvers */
 35:   virtual int EvaluateVariableBounds(TaoVec *, TaoVec *);

 37:   /* This method is optional, but it can improve performance */
 38:   virtual int InitializeVariables(TaoVec *);

 40:   /* These methods are important, the first one is mandatory */
 41:   virtual int GetVariableVector(TaoVec **);
 42:   virtual int GetHessianMatrix(TaoMat **);

 44:   /* This method may be used in LMVM methods  */
 45:   virtual int HessianSolve(TaoVec *, TaoVec*,TaoTruth *);

 47:   /* This method is also important for some solvers */
 48:   virtual int GetLinearSolver(TaoMat *, int, TaoLinearSolver **);

 50:   /* Used currently for complementarity, and least squares solvers */
 51:   virtual int EvaluateConstraints(TaoVec *, TaoVec *);
 52:   virtual int EvaluateJacobian(TaoVec *, TaoMat *);
 53:   virtual int GetJacobianMatrix(TaoMat **);
 54:   virtual int GetConstraintVector(TaoVec**);

 56:   /* This method is called only by OOQP */
 57:   virtual int GetInequalityConstraints(TaoVec**, TaoMat **, TaoVec **);

 59:   /* This method is called at each iteration of a TAO solver. Optional, but useful */
 60:   virtual int Monitor();
 61:   virtual int Monitor2(TaoVec*,TaoVec*,TaoVec*,TaoTruth*);

 63:   /* Difficult and rarely used. */
 64:   virtual int CreateATDAMatrix(TaoMat*, TaoVec*,TaoVec*, TaoMat**);

 66: };

 68: #endif