NLPInterfacePack::NLPTester Class Reference

Testing class for base NLP interface. More...

#include <NLPInterfacePack_NLPTester.hpp>

List of all members.

Public Member Functions

void print_all (const bool &print_all)
 Members for option print_all() (see Teuchos_StandardMemberCompositionMacros.hpp).
const bool & print_all () const
void throw_exception (const bool &throw_exception)
 Members for option throw_exception() (see Teuchos_StandardMemberCompositionMacros.hpp).
const bool & throw_exception () const
 NLPTester (bool print_all=false, bool throw_exception=true)
 Constructor (default options).
bool test_interface (NLP *nlp, const Vector &xo, bool print_all_warnings, std::ostream *out)
 Test the NLP interface as the given base point xo.

Private Attributes

bool print_all_
bool throw_exception_

Detailed Description

Testing class for base NLP interface.

This class is little more than a unit tester for the NLP base interface. This class will call all of the NLP methods and print out quanities if asked to. This class simply validates the pre and post conditions for all of the methods. In that this class is useful.

Definition at line 47 of file NLPInterfacePack_NLPTester.hpp.

Constructor & Destructor Documentation

NLPInterfacePack::NLPTester::NLPTester bool  print_all = false,
bool  throw_exception = true

Constructor (default options).

Definition at line 46 of file NLPInterfacePack_NLPTester.cpp.

Member Function Documentation

void NLPInterfacePack::NLPTester::print_all const bool &  print_all  )  [inline]

Members for option print_all() (see Teuchos_StandardMemberCompositionMacros.hpp).

Definition at line 51 of file NLPInterfacePack_NLPTester.hpp.

const bool& NLPInterfacePack::NLPTester::print_all  )  const [inline]

Definition at line 51 of file NLPInterfacePack_NLPTester.hpp.

void NLPInterfacePack::NLPTester::throw_exception const bool &  throw_exception  )  [inline]

Members for option throw_exception() (see Teuchos_StandardMemberCompositionMacros.hpp).

Definition at line 56 of file NLPInterfacePack_NLPTester.hpp.

const bool& NLPInterfacePack::NLPTester::throw_exception  )  const [inline]

Definition at line 56 of file NLPInterfacePack_NLPTester.hpp.

bool NLPInterfacePack::NLPTester::test_interface NLP nlp,
const Vector &  xo,
bool  print_all_warnings,
std::ostream *  out

Test the NLP interface as the given base point xo.

nlp [in/out] The NLP object being tested. The pointers returned by nlp->get_f(), nlp->get_c() and nlp->get_h() will be preserved on output and will not be modified by this function.. The NLP must be initialized before input.
xo [in] Base point for the unknown variables to test the calcuation methods at.
print_all_warnings [in] Determines if warnings for all of the comparison tests are printed or not. Warning: may cause as much as O(this->n()) output.
out  [in/out] If out != NULL any and all output will be sent here. If out == NULL then no output will be produced.
Returns true if all of the tests checked out and no unexpected exceptions were thrown.
The behavior of this method depends on the options print_all() and throw_exception() and the input arguments print_all_warnings and out.
  • throw_exception(bool): If throw_exception() == true, then if any of the objects within this function throw exceptions, these exceptions will be be thrown clean out of this function for the caller to handle. If throw_exception() == false, then if any object throws an exception, the exception is caught and this this function will return false. In any case an error message will be printed to *out (if out != NULL</tt) before leaving the function (by return or throw).
  • print_all(bool): If print_all() == true then all of the computed quantities will but dumped to out. Note that this is a useful option for initial debugging of small NLPs but not a good idea for larger NLPs as it will result in an excessive amount of output.

Definition at line 53 of file NLPInterfacePack_NLPTester.cpp.

Member Data Documentation

bool NLPInterfacePack::NLPTester::print_all_ [private]

Definition at line 51 of file NLPInterfacePack_NLPTester.hpp.

bool NLPInterfacePack::NLPTester::throw_exception_ [private]

Definition at line 56 of file NLPInterfacePack_NLPTester.hpp.

The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:36:24 2008 for MOOCHO (Single Doxygen Collection) by doxygen