chwirut2_functor Struct Reference
+ Inheritance diagram for chwirut2_functor:

Public Member Functions

 chwirut2_functor (void)
 
int operator() (const VectorXd &b, VectorXd &fvec)
 
int df (const VectorXd &b, MatrixXd &fjac)
 
 chwirut2_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 m_x [54]
 
static const double m_y [54]
 

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

◆ chwirut2_functor() [1/2]

chwirut2_functor::chwirut2_functor ( void  )
inline

◆ chwirut2_functor() [2/2]

chwirut2_functor::chwirut2_functor ( void  )
inline

Member Function Documentation

◆ df() [1/2]

int chwirut2_functor::df ( const VectorXd &  b,
MatrixXd &  fjac 
)
inline
244  {
245  assert(b.size() == 3);
246  assert(fjac.rows() == 54);
247  assert(fjac.cols() == 3);
248  for (int i = 0; i < 54; i++) {
249  double x = m_x[i];
250  double factor = 1. / (b[1] + b[2] * x);
251  double e = exp(-b[0] * x);
252  fjac(i, 0) = -x * e * factor;
253  fjac(i, 1) = -e * factor * factor;
254  fjac(i, 2) = -x * e * factor * factor;
255  }
256  return 0;
257  }
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
list x
Definition: plotDoE.py:28
static const double m_x[54]
Definition: levenberg_marquardt.cpp:231

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

◆ df() [2/2]

int chwirut2_functor::df ( const VectorXd &  b,
MatrixXd &  fjac 
)
inline
589  {
590  assert(b.size() == 3);
591  assert(fjac.rows() == 54);
592  assert(fjac.cols() == 3);
593  for (int i = 0; i < 54; i++) {
594  double x = m_x[i];
595  double factor = 1. / (b[1] + b[2] * x);
596  double e = exp(-b[0] * x);
597  fjac(i, 0) = -x * e * factor;
598  fjac(i, 1) = -e * factor * factor;
599  fjac(i, 2) = -x * e * factor * factor;
600  }
601  return 0;
602  }

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

◆ operator()() [1/2]

int chwirut2_functor::operator() ( const VectorXd &  b,
VectorXd &  fvec 
)
inline
233  {
234  int i;
235 
236  assert(b.size() == 3);
237  assert(fvec.size() == 54);
238  for (i = 0; i < 54; i++) {
239  double x = m_x[i];
240  fvec[i] = exp(-b[0] * x) / (b[1] + b[2] * x) - m_y[i];
241  }
242  return 0;
243  }
static const double m_y[54]
Definition: levenberg_marquardt.cpp:232

References assert, b, Eigen::bfloat16_impl::exp(), i, m_x, m_y, and plotDoE::x.

◆ operator()() [2/2]

int chwirut2_functor::operator() ( const VectorXd &  b,
VectorXd &  fvec 
)
inline
578  {
579  int i;
580 
581  assert(b.size() == 3);
582  assert(fvec.size() == 54);
583  for (i = 0; i < 54; i++) {
584  double x = m_x[i];
585  fvec[i] = exp(-b[0] * x) / (b[1] + b[2] * x) - m_y[i];
586  }
587  return 0;
588  }

References assert, b, Eigen::bfloat16_impl::exp(), i, m_x, m_y, and plotDoE::x.

Member Data Documentation

◆ m_x

const double chwirut2_functor::m_x
static
Initial value:
= {
0.500E0, 1.000E0, 1.750E0, 3.750E0, 5.750E0, 0.875E0, 2.250E0, 3.250E0, 5.250E0, 0.750E0, 1.750E0,
2.750E0, 4.750E0, 0.625E0, 1.250E0, 2.250E0, 4.250E0, .500E0, 3.000E0, .750E0, 3.000E0, 1.500E0,
6.000E0, 3.000E0, 6.000E0, 1.500E0, 3.000E0, .500E0, 2.000E0, 4.000E0, .750E0, 2.000E0, 5.000E0,
.750E0, 2.250E0, 3.750E0, 5.750E0, 3.000E0, .750E0, 2.500E0, 4.000E0, .750E0, 2.500E0, 4.000E0,
.750E0, 2.500E0, 4.000E0, .500E0, 6.000E0, 3.000E0, .500E0, 2.750E0, .500E0, 1.750E0}

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

◆ m_y

const double chwirut2_functor::m_y
static
Initial value:
= {
92.9000E0, 57.1000E0, 31.0500E0, 11.5875E0, 8.0250E0, 63.6000E0, 21.4000E0, 14.2500E0, 8.4750E0,
63.8000E0, 26.8000E0, 16.4625E0, 7.1250E0, 67.3000E0, 41.0000E0, 21.1500E0, 8.1750E0, 81.5000E0,
13.1200E0, 59.9000E0, 14.6200E0, 32.9000E0, 5.4400E0, 12.5600E0, 5.4400E0, 32.0000E0, 13.9500E0,
75.8000E0, 20.0000E0, 10.4200E0, 59.5000E0, 21.6700E0, 8.5500E0, 62.0000E0, 20.2000E0, 7.7600E0,
3.7500E0, 11.8100E0, 54.7000E0, 23.7000E0, 11.5500E0, 61.3000E0, 17.7000E0, 8.7400E0, 59.2000E0,
16.3000E0, 8.6200E0, 81.0000E0, 4.8700E0, 14.6200E0, 81.7000E0, 17.1700E0, 81.3000E0, 28.9000E0}

Referenced by operator()().


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