All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
roboptim::BadGradient< T > Class Template Reference

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

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

Inheritance diagram for roboptim::BadGradient< T >:

Public Member Functions

 ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ (GenericDifferentiableFunction< T >)
 
 BadGradient (const_argument_ref x, const_gradient_ref analyticalGradient, const_gradient_ref finiteDifferenceGradient, const value_type &threshold)
 Default constructor. More...
 
virtual ~BadGradient () throw ()
 
virtual std::ostream & print (std::ostream &o) const
 Display the exception on the specified output stream. More...
 
template<>
 BadGradient (const_argument_ref x, const_gradient_ref analyticalGradient, const_gradient_ref finiteDifferenceGradient, const value_type &threshold)
 

Public Attributes

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

Detailed Description

template<typename T>
class roboptim::BadGradient< T >

Exception thrown when a gradient check fails.

Constructor & Destructor Documentation

template<typename T >
roboptim::BadGradient< T >::BadGradient ( const_argument_ref  x,
const_gradient_ref  analyticalGradient,
const_gradient_ref  finiteDifferenceGradient,
const value_type &  threshold 
)
template<typename T >
roboptim::BadGradient< T >::~BadGradient ( ) throw ()
virtual
template<>
roboptim::BadGradient< EigenMatrixSparse >::BadGradient ( const_argument_ref  x,
const_gradient_ref  analyticalGradient,
const_gradient_ref  finiteDifferenceGradient,
const value_type &  threshold 
)
inline

Member Function Documentation

template<typename T >
std::ostream & roboptim::BadGradient< T >::print ( std::ostream &  o) const
virtual

Display the exception on the specified output stream.

Parameters
ooutput stream used for display
Returns
output stream

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

template<typename T>
roboptim::BadGradient< T >::ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ ( GenericDifferentiableFunction< T >  )

Member Data Documentation

template<typename T>
gradient_t roboptim::BadGradient< T >::analyticalGradient_

Analytical gradient.

template<typename T>
gradient_t roboptim::BadGradient< T >::finiteDifferenceGradient_

Gradient computed through finite differences.

template<typename T>
value_type roboptim::BadGradient< T >::maxDelta_

Maximum error.

Referenced by roboptim::BadGradient< T >::BadGradient().

template<typename T>
size_type roboptim::BadGradient< T >::maxDeltaComponent_

Component containing the maximum error.

Referenced by roboptim::BadGradient< T >::BadGradient().

template<typename T>
value_type roboptim::BadGradient< T >::threshold_

Allowed threshold.

template<typename T>
argument_t roboptim::BadGradient< T >::x_

Gradient has been computed for this point.