MGH09_functor Struct Reference
+ Inheritance diagram for MGH09_functor:

Public Member Functions

 MGH09_functor (void)
 
int operator() (const VectorXd &b, VectorXd &fvec)
 
int df (const VectorXd &b, MatrixXd &fjac)
 
 MGH09_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 [11]
 
static const double y [11]
 

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

◆ MGH09_functor() [1/2]

MGH09_functor::MGH09_functor ( void  )
inline

◆ MGH09_functor() [2/2]

MGH09_functor::MGH09_functor ( void  )
inline

Member Function Documentation

◆ df() [1/2]

int MGH09_functor::df ( const VectorXd &  b,
MatrixXd &  fjac 
)
inline
1068  {
1069  assert(b.size() == 4);
1070  assert(fjac.rows() == 11);
1071  assert(fjac.cols() == 4);
1072  for (int i = 0; i < 11; i++) {
1073  double x = _x[i], xx = x * x;
1074  double factor = 1. / (xx + x * b[2] + b[3]);
1075  fjac(i, 0) = (xx + x * b[1]) * factor;
1076  fjac(i, 1) = b[0] * x * factor;
1077  fjac(i, 2) = -b[0] * (xx + x * b[1]) * x * factor * factor;
1078  fjac(i, 3) = -b[0] * (xx + x * b[1]) * factor * factor;
1079  }
1080  return 0;
1081  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define assert(e,...)
Definition: Logger.h:744
Scalar * b
Definition: benchVecAdd.cpp:17
list x
Definition: plotDoE.py:28
static const double _x[11]
Definition: levenberg_marquardt.cpp:1057

References _x, assert, b, i, and plotDoE::x.

◆ df() [2/2]

int MGH09_functor::df ( const VectorXd &  b,
MatrixXd &  fjac 
)
inline
1375  {
1376  assert(b.size() == 4);
1377  assert(fjac.rows() == 11);
1378  assert(fjac.cols() == 4);
1379  for (int i = 0; i < 11; i++) {
1380  double x = _x[i], xx = x * x;
1381  double factor = 1. / (xx + x * b[2] + b[3]);
1382  fjac(i, 0) = (xx + x * b[1]) * factor;
1383  fjac(i, 1) = b[0] * x * factor;
1384  fjac(i, 2) = -b[0] * (xx + x * b[1]) * x * factor * factor;
1385  fjac(i, 3) = -b[0] * (xx + x * b[1]) * factor * factor;
1386  }
1387  return 0;
1388  }

References _x, assert, b, i, and plotDoE::x.

◆ operator()() [1/2]

int MGH09_functor::operator() ( const VectorXd &  b,
VectorXd &  fvec 
)
inline
1059  {
1060  assert(b.size() == 4);
1061  assert(fvec.size() == 11);
1062  for (int i = 0; i < 11; i++) {
1063  double x = _x[i], xx = x * x;
1064  fvec[i] = b[0] * (xx + x * b[1]) / (xx + x * b[2] + b[3]) - y[i];
1065  }
1066  return 0;
1067  }
static const double y[11]
Definition: levenberg_marquardt.cpp:1058

References _x, assert, b, i, plotDoE::x, and y.

◆ operator()() [2/2]

int MGH09_functor::operator() ( const VectorXd &  b,
VectorXd &  fvec 
)
inline
1366  {
1367  assert(b.size() == 4);
1368  assert(fvec.size() == 11);
1369  for (int i = 0; i < 11; i++) {
1370  double x = _x[i], xx = x * x;
1371  fvec[i] = b[0] * (xx + x * b[1]) / (xx + x * b[2] + b[3]) - y[i];
1372  }
1373  return 0;
1374  }

References _x, assert, b, i, plotDoE::x, and y.

Member Data Documentation

◆ _x

const double MGH09_functor::_x
static
Initial value:
= {4., 2., 1., 5.E-1, 2.5E-01, 1.670000E-01,
1.250000E-01, 1.E-01, 8.330000E-02, 7.140000E-02, 6.250000E-02}

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

◆ y

const double MGH09_functor::y
static
Initial value:
= {1.957000E-01, 1.947000E-01, 1.735000E-01, 1.600000E-01, 8.440000E-02, 6.270000E-02,
4.560000E-02, 3.420000E-02, 3.230000E-02, 2.350000E-02, 2.460000E-02}

Referenced by operator()().


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