00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef NOX_LINESEARCH_POLYNOMIALNEW_H
00043 #define NOX_LINESEARCH_POLYNOMIALNEW_H
00044
00045 #include "NOX_LineSearch_Generic.H"
00046
00047 #include "NOX_LineSearch_Utils_Printing.H"
00048 #include "NOX_LineSearch_Utils_Counters.H"
00049 #include "NOX_LineSearch_Utils_Slope.H"
00050 #include "Teuchos_RCP.hpp"
00051
00052
00053 namespace NOX {
00054 namespace MeritFunction {
00055 class Generic;
00056 }
00057 }
00058
00059 namespace NOX {
00060 namespace LineSearch {
00061
00321 class Polynomial : public Generic {
00322
00323 public:
00324
00326 Polynomial(const Teuchos::RCP<NOX::GlobalData>& gd,
00327 Teuchos::ParameterList& params);
00328
00330 ~Polynomial();
00331
00332
00333 bool reset(const Teuchos::RCP<NOX::GlobalData>& gd,
00334 Teuchos::ParameterList& params);
00335
00336
00337 bool compute(NOX::Abstract::Group& newgrp, double& step,
00338 const NOX::Abstract::Vector& dir,
00339 const NOX::Solver::Generic& s);
00340
00341 protected:
00342
00344
00421 bool checkConvergence(double newValue, double oldValue, double oldSlope,
00422 double step, double eta, int nIters, int nNonlinearIters) const;
00423
00425
00439 bool updateGrp(NOX::Abstract::Group& newGrp,
00440 const NOX::Abstract::Group& oldGrp,
00441 const NOX::Abstract::Vector& dir,
00442 double step) const;
00443
00444
00446
00458 double computeValue(const NOX::Abstract::Group& grp, double phi);
00459
00461 void printOpeningRemarks() const;
00462
00464 void printBadSlopeWarning(double slope) const;
00465
00466 protected:
00467
00469 enum SufficientDecreaseType {
00471 ArmijoGoldstein,
00473 AredPred,
00475 None
00476 };
00477
00479 enum InterpolationType {
00480
00482 Quadratic,
00483
00485 Cubic,
00486
00488 Quadratic3
00489 };
00490
00492 enum RecoveryStepType {
00494 Constant,
00496 LastComputedStep
00497 };
00498
00500 SufficientDecreaseType suffDecrCond;
00501
00503 InterpolationType interpolationType;
00504
00506 RecoveryStepType recoveryStepType;
00507
00509 double minStep;
00510
00512 double defaultStep;
00513
00515 double recoveryStep;
00516
00518 int maxIters;
00519
00523 double alpha;
00524
00527 double minBoundFactor;
00528
00531 double maxBoundFactor;
00532
00535 bool doForceInterpolation;
00536
00540 int maxIncreaseIter;
00541
00544 bool doAllowIncrease;
00545
00548 double maxRelativeIncrease;
00549
00552 bool useCounter;
00553
00555 Teuchos::RCP<NOX::GlobalData> globalDataPtr;
00556
00558
00561 Teuchos::ParameterList* paramsPtr;
00562
00564 NOX::LineSearch::Utils::Printing print;
00565
00567 NOX::LineSearch::Utils::Counters counter;
00568
00570 NOX::LineSearch::Utils::Slope slopeUtil;
00571
00573 Teuchos::RCP<NOX::MeritFunction::Generic> meritFuncPtr;
00574
00575 };
00576 }
00577 }
00578 #endif