rat43_functor Struct Reference
+ Inheritance diagram for rat43_functor:

Public Member Functions

 rat43_functor (void)
 
int operator() (const VectorXd &b, VectorXd &fvec)
 
int df (const VectorXd &b, MatrixXd &fjac)
 
 rat43_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 [15] = {1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.}
 
static const double y [15]
 

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

◆ rat43_functor() [1/2]

rat43_functor::rat43_functor ( void  )
inline

◆ rat43_functor() [2/2]

rat43_functor::rat43_functor ( void  )
inline

Member Function Documentation

◆ df() [1/2]

int rat43_functor::df ( const VectorXd &  b,
MatrixXd &  fjac 
)
inline
1370  {
1371  assert(b.size() == 4);
1372  assert(fjac.rows() == 15);
1373  assert(fjac.cols() == 4);
1374  for (int i = 0; i < 15; i++) {
1375  double e = exp(b[1] - b[2] * x[i]);
1376  double power = -1. / b[3];
1377  fjac(i, 0) = pow(1. + e, power);
1378  fjac(i, 1) = power * b[0] * e * pow(1. + e, power - 1.);
1379  fjac(i, 2) = -power * b[0] * e * x[i] * pow(1. + e, power - 1.);
1380  fjac(i, 3) = b[0] * power * power * log(1. + e) * pow(1. + e, power);
1381  }
1382  return 0;
1383  }
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
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 log(const bfloat16 &a)
Definition: BFloat16.h:618
static const double x[15]
Definition: levenberg_marquardt.cpp:1362

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

◆ df() [2/2]

int rat43_functor::df ( const VectorXd &  b,
MatrixXd &  fjac 
)
inline
1671  {
1672  assert(b.size() == 4);
1673  assert(fjac.rows() == 15);
1674  assert(fjac.cols() == 4);
1675  for (int i = 0; i < 15; i++) {
1676  double e = exp(b[1] - b[2] * x[i]);
1677  double power = -1. / b[3];
1678  fjac(i, 0) = pow(1. + e, power);
1679  fjac(i, 1) = power * b[0] * e * pow(1. + e, power - 1.);
1680  fjac(i, 2) = -power * b[0] * e * x[i] * pow(1. + e, power - 1.);
1681  fjac(i, 3) = b[0] * power * power * log(1. + e) * pow(1. + e, power);
1682  }
1683  return 0;
1684  }

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

◆ operator()() [1/2]

int rat43_functor::operator() ( const VectorXd &  b,
VectorXd &  fvec 
)
inline
1364  {
1365  assert(b.size() == 4);
1366  assert(fvec.size() == 15);
1367  for (int i = 0; i < 15; i++) fvec[i] = b[0] * pow(1. + exp(b[1] - b[2] * x[i]), -1. / b[3]) - y[i];
1368  return 0;
1369  }
static const double y[15]
Definition: levenberg_marquardt.cpp:1363

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

◆ operator()() [2/2]

int rat43_functor::operator() ( const VectorXd &  b,
VectorXd &  fvec 
)
inline
1665  {
1666  assert(b.size() == 4);
1667  assert(fvec.size() == 15);
1668  for (int i = 0; i < 15; i++) fvec[i] = b[0] * pow(1. + exp(b[1] - b[2] * x[i]), -1. / b[3]) - y[i];
1669  return 0;
1670  }

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

Member Data Documentation

◆ x

const double rat43_functor::x = {1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15.}
static

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

◆ y

const double rat43_functor::y
static
Initial value:
= {16.08, 33.83, 65.80, 97.20, 191.55, 326.20, 386.87, 520.53,
590.03, 651.92, 724.93, 699.56, 689.96, 637.56, 717.41}

Referenced by operator()().


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