00001 #ifndef PLAYA_LINESEARCHBASE_H
00002 #define PLAYA_LINESEARCHBASE_H
00003
00004
00005 #include "PlayaObjectiveBase.hpp"
00006 #include "Teuchos_ParameterList.hpp"
00007
00008 namespace Playa
00009 {
00010
00011 using Teuchos::RCP;
00012 using Teuchos::ParameterList;
00013
00014
00015 enum LineSearchStatus {LS_Success, LS_ExceededMaxiters, LS_StepTooSmall,
00016 LS_Crashed};
00017
00018
00019
00020
00021
00022
00023 class LineSearchBase : public ObjectWithVerbosity,
00024 public Describable,
00025 public Printable
00026
00027 {
00028 public:
00029
00030 LineSearchBase(const ParameterList& params);
00031
00032
00033
00034 virtual LineSearchStatus search(const RCP<ObjectiveBase>& obj,
00035 const Vector<double>& x0,
00036 const double& f0,
00037 const Vector<double>& direction,
00038 const double& alphaMax,
00039 Vector<double>& xn,
00040 Vector<double>& gradF,
00041 double& fVal) const = 0 ;
00042
00043
00044 virtual double minStepSize() const {return minStepSize_;}
00045
00046
00047 virtual int maxSteps() const {return maxSteps_;}
00048
00049
00050 const ParameterList& params() const {return params_;}
00051
00052 private:
00053 ParameterList params_;
00054
00055 int maxSteps_;
00056
00057 double minStepSize_;
00058 };
00059 }
00060
00061 #endif