rat42_functor Struct Reference
+ Inheritance diagram for rat42_functor:

Public Member Functions

 rat42_functor (void)
 
int operator() (const VectorXd &b, VectorXd &fvec)
 
int df (const VectorXd &b, MatrixXd &fjac)
 
 rat42_functor (void)
 
int operator() (const VectorXd &b, VectorXd &fvec)
 
int df (const VectorXd &b, MatrixXd &fjac)
 
- Public Member Functions inherited from Eigen::DenseFunctor< double >
 DenseFunctor ()
 
 DenseFunctor (int inputs, int values)
 
int inputs () const
 
int values () const
 
- Public Member Functions inherited from Functor< double >
 Functor ()
 
 Functor (int inputs, int values)
 
 Functor ()
 
 Functor (int inputs_, int values_)
 
int inputs () const
 
int inputs () const
 
int values () const
 
int values () const
 

Static Public Attributes

static const double x [9]
 
static const double y [9]
 

Additional Inherited Members

- Public Types inherited from Eigen::DenseFunctor< double >
enum  
 
typedef double Scalar
 
typedef Matrix< Scalar, InputsAtCompileTime, 1 > InputType
 
typedef Matrix< Scalar, ValuesAtCompileTime, 1 > ValueType
 
typedef Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTimeJacobianType
 
typedef ColPivHouseholderQR< JacobianTypeQRSolver
 
- Public Types inherited from Functor< double >
enum  
 
enum  
 
typedef double Scalar
 
typedef double Scalar
 
typedef Matrix< Scalar, InputsAtCompileTime, 1 > InputType
 
typedef Matrix< Scalar, InputsAtCompileTime, 1 > InputType
 
typedef Matrix< Scalar, ValuesAtCompileTime, 1 > ValueType
 
typedef Matrix< Scalar, ValuesAtCompileTime, 1 > ValueType
 
typedef Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTimeJacobianType
 
typedef Matrix< Scalar, ValuesAtCompileTime, InputsAtCompileTimeJacobianType
 
- Public Attributes inherited from Eigen::DenseFunctor< double >
const int m_inputs
 
const int m_values
 
- Public Attributes inherited from Functor< double >
const int m_inputs
 
int m_inputs
 
const int m_values
 
int m_values
 

Constructor & Destructor Documentation

◆ rat42_functor() [1/2]

rat42_functor::rat42_functor ( void  )
inline

◆ rat42_functor() [2/2]

rat42_functor::rat42_functor ( void  )
inline

Member Function Documentation

◆ df() [1/2]

int rat42_functor::df ( const VectorXd &  b,
MatrixXd &  fjac 
)
inline
718  {
719  assert(b.size() == 3);
720  assert(fjac.rows() == 9);
721  assert(fjac.cols() == 3);
722  for (int i = 0; i < 9; i++) {
723  double e = exp(b[1] - b[2] * x[i]);
724  fjac(i, 0) = 1. / (1. + e);
725  fjac(i, 1) = -b[0] * e / (1. + e) / (1. + e);
726  fjac(i, 2) = +b[0] * e * x[i] / (1. + e) / (1. + e);
727  }
728  return 0;
729  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Array< double, 1, 3 > e(1./3., 0.5, 2.)
#define assert(e,...)
Definition: Logger.h:744
Scalar * b
Definition: benchVecAdd.cpp:17
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615
static const double x[9]
Definition: levenberg_marquardt.cpp:707

References assert, b, e(), Eigen::bfloat16_impl::exp(), i, and x.

◆ df() [2/2]

int rat42_functor::df ( const VectorXd &  b,
MatrixXd &  fjac 
)
inline
1055  {
1056  assert(b.size() == 3);
1057  assert(fjac.rows() == 9);
1058  assert(fjac.cols() == 3);
1059  for (int i = 0; i < 9; i++) {
1060  double e = exp(b[1] - b[2] * x[i]);
1061  fjac(i, 0) = 1. / (1. + e);
1062  fjac(i, 1) = -b[0] * e / (1. + e) / (1. + e);
1063  fjac(i, 2) = +b[0] * e * x[i] / (1. + e) / (1. + e);
1064  }
1065  return 0;
1066  }

References assert, b, e(), Eigen::bfloat16_impl::exp(), i, and x.

◆ operator()() [1/2]

int rat42_functor::operator() ( const VectorXd &  b,
VectorXd &  fvec 
)
inline
709  {
710  assert(b.size() == 3);
711  assert(fvec.size() == 9);
712  for (int i = 0; i < 9; i++) {
713  fvec[i] = b[0] / (1. + exp(b[1] - b[2] * x[i])) - y[i];
714  }
715  return 0;
716  }
static const double y[9]
Definition: levenberg_marquardt.cpp:708

References assert, b, Eigen::bfloat16_impl::exp(), i, x, and y.

◆ operator()() [2/2]

int rat42_functor::operator() ( const VectorXd &  b,
VectorXd &  fvec 
)
inline
1046  {
1047  assert(b.size() == 3);
1048  assert(fvec.size() == 9);
1049  for (int i = 0; i < 9; i++) {
1050  fvec[i] = b[0] / (1. + exp(b[1] - b[2] * x[i])) - y[i];
1051  }
1052  return 0;
1053  }

References assert, b, Eigen::bfloat16_impl::exp(), i, x, and y.

Member Data Documentation

◆ x

const double rat42_functor::x
static
Initial value:
= {9.000E0, 14.000E0, 21.000E0, 28.000E0, 42.000E0,
57.000E0, 63.000E0, 70.000E0, 79.000E0}

Referenced by df(), and operator()().

◆ y

const double rat42_functor::y
static
Initial value:
= {8.930E0, 10.800E0, 18.590E0, 22.330E0, 39.350E0,
56.110E0, 61.730E0, 64.620E0, 67.080E0}

Referenced by operator()().


The documentation for this struct was generated from the following files: