MiniTensor Version of the Day
Loading...
Searching...
No Matches
minitensor::Rosenbrock< S, M > Class Template Reference

#include <MiniTensor_TestFunctions.h>

Inheritance diagram for minitensor::Rosenbrock< S, M >:
minitensor::Function_Base< FunctionDerived, S, M >

Public Types

using Base = Function_Base< Rosenbrock< S, M >, S, M >
 

Public Member Functions

 Rosenbrock (S a=1.0, S b=100.0)
 
template<typename T , Index N>
value (Vector< T, N > const &x)
 
template<typename T , Index N>
Vector< T, N > gradient (Vector< T, N > const &x)
 
template<typename T , Index N>
Tensor< T, N > hessian (Vector< T, N > const &x)
 
- Public Member Functions inherited from minitensor::Function_Base< FunctionDerived, S, M >
 Function_Base ()
 
template<typename T , Index N>
value (FunctionDerived &f, Vector< T, N > const &x)
 
template<typename T , Index N>
Vector< T, N > gradient (FunctionDerived &f, Vector< T, N > const &x)
 
template<typename T , Index N>
Vector< T, N > residual (FunctionDerived &f, Vector< T, N > const &x)
 
template<typename T , Index N>
Tensor< T, N > hessian (FunctionDerived &f, Vector< T, N > const &x)
 
void set_failed (char const *const msg=nullptr)
 
bool get_failed ()
 
void clear_failed ()
 
void set_failure_message (char const *const msg=nullptr)
 
char const * get_failure_message ()
 

Static Public Attributes

static constexpr char const *const NAME {"Rosenbrock's Function 2D"}
 
- Static Public Attributes inherited from minitensor::Function_Base< FunctionDerived, S, M >
static constexpr Index DIMENSION {M}
 

Private Attributes

a_ {1.0}
 
b_ {100.0}
 

Additional Inherited Members

- Protected Attributes inherited from minitensor::Function_Base< FunctionDerived, S, M >
bool failed {false}
 
char const * failure_message {nullptr}
 Keep a message to inform what went wrong above.
 

Detailed Description

template<typename S, Index M = 2>
class minitensor::Rosenbrock< S, M >

Rosenbrock's function \( (a-x_1)^2 + b(x_2-x_1^2)^2 \) with defaults \( a=1, b=100 \). Two-dimensional; its curved banana valley stresses line search and step control. Minimum at \( (a, a^2) \).

Definition at line 732 of file MiniTensor_TestFunctions.h.

Member Typedef Documentation

◆ Base

template<typename S , Index M = 2>
using minitensor::Rosenbrock< S, M >::Base = Function_Base<Rosenbrock<S, M>, S, M>

Base class type.

Definition at line 756 of file MiniTensor_TestFunctions.h.

Constructor & Destructor Documentation

◆ Rosenbrock()

template<typename S , Index M = 2>
minitensor::Rosenbrock< S, M >::Rosenbrock ( a = 1.0,
b = 100.0 
)
inline

Constructor.

Parameters
aLocation parameter; the minimizer is \( (a, a^2) \).
bWeight of the valley (coupling) term.

Definition at line 742 of file MiniTensor_TestFunctions.h.

Member Function Documentation

◆ value()

template<typename S , Index M = 2>
template<typename T , Index N>
T minitensor::Rosenbrock< S, M >::value ( Vector< T, N > const &  x)
inline

Objective value.

Definition at line 764 of file MiniTensor_TestFunctions.h.

◆ gradient()

template<typename S , Index M = 2>
template<typename T , Index N>
Vector< T, N > minitensor::Rosenbrock< S, M >::gradient ( Vector< T, N > const &  x)
inline

Gradient of the objective.

Definition at line 781 of file MiniTensor_TestFunctions.h.

◆ hessian()

template<typename S , Index M = 2>
template<typename T , Index N>
Tensor< T, N > minitensor::Rosenbrock< S, M >::hessian ( Vector< T, N > const &  x)
inline

Hessian of the objective.

Definition at line 792 of file MiniTensor_TestFunctions.h.

Member Data Documentation

◆ NAME

template<typename S , Index M = 2>
constexpr char const* const minitensor::Rosenbrock< S, M >::NAME {"Rosenbrock's Function 2D"}
staticconstexpr

Function name.

Definition at line 751 of file MiniTensor_TestFunctions.h.

◆ a_

template<typename S , Index M = 2>
S minitensor::Rosenbrock< S, M >::a_ {1.0}
private

Location parameter.

Definition at line 802 of file MiniTensor_TestFunctions.h.

◆ b_

template<typename S , Index M = 2>
S minitensor::Rosenbrock< S, M >::b_ {100.0}
private

Weight of the valley (coupling) term.

Definition at line 808 of file MiniTensor_TestFunctions.h.


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