Helios++
Helios software for LiDAR simulations
fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT > Class Template Reference

Implementation of univariate Newton-Raphson minimizer. More...

#include <UnivariateNewtonRaphsonMinimizer.h>

Inheritance diagram for fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >:
Collaboration diagram for fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >:

Public Member Functions

 UnivariateNewtonRaphsonMinimizer (function< OT(IT)> f, vector< function< OT(IT)>> df)
 Default constructor for univariate Newton-Raphson minimizer. More...
 
 UnivariateNewtonRaphsonMinimizer (function< OT(IT)> f, function< OT(IT)> df, function< OT(IT)> d2f)
 Alternative constructor for univariate Newton-Raphson minimizer. More...
 
IT argmin (IT x) override
 Implementation of the univariate Newton-Raphson minimization. More...
 
IterativeMethodHandler< IT, OT > & getIterativeMethodHandler ()
 Obtain the iterative method handler. More...
 
void setIterativeMethodHandler (IterativeMethodHandler< IT, OT > const &imh)
 Set the iterative method handler. More...
 
- Public Member Functions inherited from fluxionum::DiffMinimizer< IT, OT >
 DiffMinimizer (function< OT(IT)> f, vector< function< OT(IT)>> df)
 Differential minimizer default constructor. More...
 
virtual vector< function< OT(IT)> > getDerivatives () const
 Obtain the derivatives of the function to be minimized. More...
 
virtual void setDerivatives (vector< function< OT(IT)>> df)
 Set the derivatives of the function to be minimized. More...
 
virtual size_t numDerivatives () const
 Obtain the number of available derivatives for the function to be minimized. More...
 
virtual function< OT(IT)> getDerivative (size_t const i)
 Obtain the i-th derivative for the function being minimized. More...
 
virtual void setDerivative (size_t const i, function< OT(IT)> df)
 Set the i-th derivative for the function being minimized. More...
 
virtual void removeDerivative (size_t const i)
 Remove the i-th derivative for the function being minimized. More...
 
virtual void addDerivative (function< OT(IT)> df)
 Append given derivative. More...
 
- Public Member Functions inherited from fluxionum::Minimizer< IT, OT >
 Minimizer (function< OT(IT)> f)
 Minimizer default constructor. More...
 
virtual function< OT(IT)> getF () const
 Obtain the function to be minimized. More...
 
virtual void setF (function< OT(IT)> f)
 Set the function to be minimized. More...
 

Protected Attributes

IterativeMethodHandler< IT, OT > imh
 Iterative method handler for the univariate Newton-Raphson minimization. More...
 
- Protected Attributes inherited from fluxionum::DiffMinimizer< IT, OT >
vector< function< OT(IT)> > df
 The derivatives of the function to be minimized such that df[i] corresponds with \(\frac{d^if}{dx^i}\).
 
- Protected Attributes inherited from fluxionum::Minimizer< IT, OT >
function< OT(IT)> f
 The function to be minimized.
 

Private Member Functions

template<typename Archive >
void serialize (Archive &ar, unsigned int const version)
 Serialize the univariate Newton-Raphson minimizer to a stream of bytes. More...
 

Friends

class boost::serialization::access
 

Detailed Description

template<typename IT, typename OT>
class fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >

Implementation of univariate Newton-Raphson minimizer.

Author
Alberto M. Esmoris Pena
Version
1.0
Template Parameters
ITType of input for the function to be minimized and its first and second derivative
OTType of output for the function to be minimized and its first and second derivative

Constructor & Destructor Documentation

◆ UnivariateNewtonRaphsonMinimizer() [1/2]

template<typename IT , typename OT >
fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >::UnivariateNewtonRaphsonMinimizer ( function< OT(IT)>  f,
vector< function< OT(IT)>>  df 
)
inline

Default constructor for univariate Newton-Raphson minimizer.

Parameters
fUnivariate function to be minimized
dfFirst and second derivatives of the function to be minimized
See also
fluxionum::DiffMinimizer::DiffMinimizer

◆ UnivariateNewtonRaphsonMinimizer() [2/2]

template<typename IT , typename OT >
fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >::UnivariateNewtonRaphsonMinimizer ( function< OT(IT)>  f,
function< OT(IT)>  df,
function< OT(IT)>  d2f 
)
inline

Alternative constructor for univariate Newton-Raphson minimizer.

Parameters
fUnivariate function to be minimized
dfFirst derivative of the function to be minimized
d2fSecond derivative of the function to be minimized
See also
fluxionum::DiffMinimizer::DiffMinimizer

Member Function Documentation

◆ argmin()

template<typename IT , typename OT >
IT fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >::argmin ( IT  x)
overridevirtual

Implementation of the univariate Newton-Raphson minimization.

\[ x_{k+1} = x_k - \frac{f'(x_k)}{f''(x_k)} = x_k - \frac{df}{dx}(x_k) \left[ \frac{d^2f}{dx^2}(x_k) \right]^{-1} \]

See also
fluxionum::Minimizer::argmin

Implements fluxionum::Minimizer< IT, OT >.

◆ getIterativeMethodHandler()

template<typename IT , typename OT >
IterativeMethodHandler<IT, OT>& fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >::getIterativeMethodHandler ( )
inline

Obtain the iterative method handler.

Returns
Iterative method handler
See also
fluxionum::UnivariateNewtonRaphsonMinimizer::imh

◆ serialize()

template<typename IT , typename OT >
template<typename Archive >
void fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >::serialize ( Archive &  ar,
unsigned int const  version 
)
inlineprivate

Serialize the univariate Newton-Raphson minimizer to a stream of bytes.

Template Parameters
ArchiveType of rendering
Parameters
arSpecific rendering for the stream of bytes
versionVersion number for the univariate Newton-Raphson minimizer

◆ setIterativeMethodHandler()

template<typename IT , typename OT >
void fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >::setIterativeMethodHandler ( IterativeMethodHandler< IT, OT > const &  imh)
inline

Set the iterative method handler.

Parameters
imhNew iterative method handler
See also
fluxionum::UnivariateNewtonRaphsonMinimizer::imh

Member Data Documentation

◆ imh

template<typename IT , typename OT >
IterativeMethodHandler<IT, OT> fluxionum::UnivariateNewtonRaphsonMinimizer< IT, OT >::imh
protected

Iterative method handler for the univariate Newton-Raphson minimization.

See also
fluxionum::IterativeMethodHandler

The documentation for this class was generated from the following file: