roboptim::BadGradient Class Reference

Exception thrown when a gradient check fail. More...

#include <roboptim/core/finite-difference-gradient.hh>

Inherits std::runtime_error.

List of all members.

Public Types

typedef DerivableFunction::vector_t vector_t
 Import vector.
typedef
DerivableFunction::gradient_t 
gradient_t
 Import gradient.
typedef
DerivableFunction::value_type 
value_type
 Import value_type.
typedef
DerivableFunction::size_type 
size_type
 Import size_type.

Public Member Functions

 BadGradient (const vector_t &x, const gradient_t &analyticalGradient, const gradient_t &finiteDifferenceGradient, const value_type &threshold)
 Default constructor.
virtual ~BadGradient () throw ()
virtual std::ostream & print (std::ostream &o) const throw ()
 Display the exception on the specified output stream.

Public Attributes

vector_t x_
 Gradient has been computed for this point.
gradient_t analyticalGradient_
 Analytical gradient.
gradient_t finiteDifferenceGradient_
 Gradient computed through finite differences.
value_type maxDelta_
 Maximum error.
value_type maxDeltaComponent_
 Component containing the maximum error.
value_type threshold_
 Allowed threshold.

Detailed Description

Exception thrown when a gradient check fail.


Member Typedef Documentation

Import gradient.

Import size_type.

Import value_type.

Import vector.


Constructor & Destructor Documentation

roboptim::BadGradient::BadGradient ( const vector_t x,
const gradient_t analyticalGradient,
const gradient_t finiteDifferenceGradient,
const value_type threshold 
)

Default constructor.

References maxDelta_, and maxDeltaComponent_.

roboptim::BadGradient::~BadGradient (  )  throw () [virtual]

Member Function Documentation

std::ostream & roboptim::BadGradient::print ( std::ostream &  o  )  const throw () [virtual]

Display the exception on the specified output stream.

Parameters:
o output stream used for display
Returns:
output stream

References roboptim::decindent(), roboptim::iendl(), and roboptim::incindent().

Referenced by roboptim::operator<<().


Member Data Documentation

Analytical gradient.

Gradient computed through finite differences.

Maximum error.

Referenced by BadGradient().

Component containing the maximum error.

Referenced by BadGradient().

Allowed threshold.

Gradient has been computed for this point.