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

#include <MiniTensor_TestFunctions.h>

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

Public Types

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

Public Member Functions

 Failure ()
 
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 {"Failure"}
 
- Static Public Attributes inherited from minitensor::Function_Base< FunctionDerived, S, M >
static constexpr Index DIMENSION {M}
 

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 = 1>
class minitensor::Failure< S, M >

Function that always reports failure: value() sets the failed flag and returns zero. One-dimensional; exercises the solvers' failure detection mechanism.

Definition at line 1083 of file MiniTensor_TestFunctions.h.

Member Typedef Documentation

◆ Base

template<typename S , Index M = 1>
using minitensor::Failure< S, M >::Base = Function_Base<Failure<S, M>, S, M>

Base class type.

Definition at line 1102 of file MiniTensor_TestFunctions.h.

Constructor & Destructor Documentation

◆ Failure()

template<typename S , Index M = 1>
minitensor::Failure< S, M >::Failure ( )
inline

Constructor.

Definition at line 1090 of file MiniTensor_TestFunctions.h.

Member Function Documentation

◆ value()

template<typename S , Index M = 1>
template<typename T , Index N>
T minitensor::Failure< S, M >::value ( Vector< T, N > const &  X)
inline

Objective value; flags an unrecoverable failure and returns zero.

Definition at line 1111 of file MiniTensor_TestFunctions.h.

◆ gradient()

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

Gradient of the objective.

Definition at line 1128 of file MiniTensor_TestFunctions.h.

◆ hessian()

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

Hessian of the objective.

Definition at line 1139 of file MiniTensor_TestFunctions.h.

Member Data Documentation

◆ NAME

template<typename S , Index M = 1>
constexpr char const* const minitensor::Failure< S, M >::NAME {"Failure"}
staticconstexpr

Function name.

Definition at line 1097 of file MiniTensor_TestFunctions.h.


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