#include <NOX_LineSearch_Utils_Counters.H>
Public Member Functions | |
Counters () | |
Default constructor. | |
virtual | ~Counters () |
Destructor. | |
virtual void | reset () |
Reset the counters . | |
virtual bool | setValues (Teuchos::ParameterList &lineSearchParams) |
Increment Methods | |
virtual void | incrementNumLineSearches (int n=1) |
Increment the counter for the total number of line search calls by n. | |
virtual void | incrementNumNonTrivialLineSearches (int n=1) |
Increment the counter for the total number of non-trivial line search calls by n. | |
virtual void | incrementNumFailedLineSearches (int n=1) |
Increment the counter for the total number of failed line search calls by n. | |
virtual void | incrementNumIterations (int n=1) |
Increment the counter for the total number of line search inner iterations by n. | |
Accessor Methods | |
Returns the current counter value | |
virtual int | getNumLineSearches () const |
Return the counter for the total number of line search calls. | |
virtual int | getNumNonTrivialLineSearches () const |
Return the counter for the total number of non-trivial line search calls. | |
virtual int | getNumFailedLineSearches () const |
Return the counter for the total number of failed line search calls. | |
virtual int | getNumIterations () const |
Return the counter for the total number of line search inner iterations. | |
Private Attributes | |
Common Line Search Data Members | |
All line searches in general should report the following information. We save a pointer to the parameter list associated with the line search and set an output sublist with each of the following parameters. | |
int | totalNumLineSearchCalls |
int | totalNumNonTrivialLineSearches |
int | totalNumFailedLineSearches |
int | totalNumIterations |
Counter for the total number of line search inner iterations performed. |
Output list keys
Line searches have a common set of data that should be tracked and saved in the parameter list for the users. This class provides a set of common data objects, accessors, and a routine to print them. A sublist for output parameters will be created called "Output" in the "Line Search" parameter sublist. Valid output keys for the parameter list are:
Definition at line 91 of file NOX_LineSearch_Utils_Counters.H.
NOX::LineSearch::Utils::Counters::Counters | ( | ) |
Default constructor.
Definition at line 46 of file NOX_LineSearch_Utils_Counters.C.
References reset().
NOX::LineSearch::Utils::Counters::~Counters | ( | ) | [virtual] |
void NOX::LineSearch::Utils::Counters::reset | ( | ) | [virtual] |
Reset the counters .
Definition at line 56 of file NOX_LineSearch_Utils_Counters.C.
References totalNumFailedLineSearches, totalNumIterations, totalNumLineSearchCalls, and totalNumNonTrivialLineSearches.
Referenced by Counters(), and NOX::Solver::TensorBased::init().
bool NOX::LineSearch::Utils::Counters::setValues | ( | Teuchos::ParameterList & | lineSearchParams | ) | [virtual] |
Sets the common line search data in an "Output" sublist of the lineSearchParams list that is supplied in the method call.
Definition at line 64 of file NOX_LineSearch_Utils_Counters.C.
References totalNumFailedLineSearches, totalNumIterations, totalNumLineSearchCalls, and totalNumNonTrivialLineSearches.
Referenced by NOX::LineSearch::Polynomial::compute(), NOX::LineSearch::MoreThuente::compute(), and NOX::Solver::TensorBased::performLinesearch().
void NOX::LineSearch::Utils::Counters::incrementNumLineSearches | ( | int | n = 1 |
) | [virtual] |
Increment the counter for the total number of line search calls by n.
Definition at line 74 of file NOX_LineSearch_Utils_Counters.C.
References totalNumLineSearchCalls.
Referenced by NOX::LineSearch::Polynomial::compute(), NOX::LineSearch::MoreThuente::compute(), and NOX::Solver::TensorBased::implementGlobalStrategy().
void NOX::LineSearch::Utils::Counters::incrementNumNonTrivialLineSearches | ( | int | n = 1 |
) | [virtual] |
Increment the counter for the total number of non-trivial line search calls by n.
Definition at line 79 of file NOX_LineSearch_Utils_Counters.C.
References totalNumNonTrivialLineSearches.
Referenced by NOX::LineSearch::Polynomial::compute(), NOX::LineSearch::MoreThuente::compute(), and NOX::Solver::TensorBased::performLinesearch().
void NOX::LineSearch::Utils::Counters::incrementNumFailedLineSearches | ( | int | n = 1 |
) | [virtual] |
Increment the counter for the total number of failed line search calls by n.
Definition at line 84 of file NOX_LineSearch_Utils_Counters.C.
References totalNumFailedLineSearches.
Referenced by NOX::LineSearch::Polynomial::compute(), NOX::LineSearch::MoreThuente::cvsrch(), and NOX::Solver::TensorBased::performLinesearch().
void NOX::LineSearch::Utils::Counters::incrementNumIterations | ( | int | n = 1 |
) | [virtual] |
Increment the counter for the total number of line search inner iterations by n.
Definition at line 89 of file NOX_LineSearch_Utils_Counters.C.
References totalNumIterations.
Referenced by NOX::LineSearch::Polynomial::compute(), NOX::LineSearch::MoreThuente::cvsrch(), and NOX::Solver::TensorBased::performLinesearch().
int NOX::LineSearch::Utils::Counters::getNumLineSearches | ( | ) | const [virtual] |
Return the counter for the total number of line search calls.
Definition at line 94 of file NOX_LineSearch_Utils_Counters.C.
References totalNumLineSearchCalls.
Referenced by NOX::Solver::TensorBased::implementGlobalStrategy().
int NOX::LineSearch::Utils::Counters::getNumNonTrivialLineSearches | ( | ) | const [virtual] |
Return the counter for the total number of non-trivial line search calls.
Definition at line 99 of file NOX_LineSearch_Utils_Counters.C.
References totalNumNonTrivialLineSearches.
int NOX::LineSearch::Utils::Counters::getNumFailedLineSearches | ( | ) | const [virtual] |
Return the counter for the total number of failed line search calls.
Definition at line 104 of file NOX_LineSearch_Utils_Counters.C.
References totalNumFailedLineSearches.
int NOX::LineSearch::Utils::Counters::getNumIterations | ( | ) | const [virtual] |
Return the counter for the total number of line search inner iterations.
Definition at line 109 of file NOX_LineSearch_Utils_Counters.C.
References totalNumIterations.
Counter for the total number of times the compute() method was called for this object.
Definition at line 163 of file NOX_LineSearch_Utils_Counters.H.
Referenced by getNumLineSearches(), incrementNumLineSearches(), reset(), and setValues().
Counter for number of times the line search was actually needed. This is the number of times the compute() method was called for this object where a step length of 1.0 could not be used.
Definition at line 168 of file NOX_LineSearch_Utils_Counters.H.
Referenced by getNumNonTrivialLineSearches(), incrementNumNonTrivialLineSearches(), reset(), and setValues().
Counter for the number of times the compute() method was called where the line search algorithm failed.
Definition at line 172 of file NOX_LineSearch_Utils_Counters.H.
Referenced by getNumFailedLineSearches(), incrementNumFailedLineSearches(), reset(), and setValues().
int NOX::LineSearch::Utils::Counters::totalNumIterations [private] |
Counter for the total number of line search inner iterations performed.
Definition at line 175 of file NOX_LineSearch_Utils_Counters.H.
Referenced by getNumIterations(), incrementNumIterations(), reset(), and setValues().