lmstr_functor Struct Reference
+ Inheritance diagram for lmstr_functor:

Public Member Functions

 lmstr_functor (void)
 
int operator() (const VectorXd &x, VectorXd &fvec)
 
int df (const VectorXd &x, VectorXd &jac_row, VectorXd::Index rownb)
 
- 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
 

Additional Inherited Members

- 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 Functor< double >
const int m_inputs
 
int m_inputs
 
const int m_values
 
int m_values
 

Constructor & Destructor Documentation

◆ lmstr_functor()

lmstr_functor::lmstr_functor ( void  )
inline

Member Function Documentation

◆ df()

int lmstr_functor::df ( const VectorXd &  x,
VectorXd &  jac_row,
VectorXd::Index  rownb 
)
inline
402  {
403  assert(x.size() == 3);
404  assert(jac_row.size() == x.size());
405  double tmp1, tmp2, tmp3, tmp4;
406 
407  VectorXd::Index i = rownb - 2;
408  tmp1 = i + 1;
409  tmp2 = 16 - i - 1;
410  tmp3 = (i >= 8) ? tmp2 : tmp1;
411  tmp4 = (x[1] * tmp2 + x[2] * tmp3);
412  tmp4 = tmp4 * tmp4;
413  jac_row[0] = -1;
414  jac_row[1] = tmp1 * tmp2 / tmp4;
415  jac_row[2] = tmp1 * tmp3 / tmp4;
416  return 0;
417  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define assert(e,...)
Definition: Logger.h:744
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
list x
Definition: plotDoE.py:28

References assert, i, and plotDoE::x.

◆ operator()()

int lmstr_functor::operator() ( const VectorXd &  x,
VectorXd &  fvec 
)
inline
385  {
386  /* subroutine fcn for lmstr1 example. */
387  double tmp1, tmp2, tmp3;
388  static const double y[15] = {1.4e-1, 1.8e-1, 2.2e-1, 2.5e-1, 2.9e-1, 3.2e-1, 3.5e-1, 3.9e-1,
389  3.7e-1, 5.8e-1, 7.3e-1, 9.6e-1, 1.34, 2.1, 4.39};
390 
391  assert(15 == fvec.size());
392  assert(3 == x.size());
393 
394  for (int i = 0; i < 15; i++) {
395  tmp1 = i + 1;
396  tmp2 = 16 - i - 1;
397  tmp3 = (i >= 8) ? tmp2 : tmp1;
398  fvec[i] = y[i] - (x[0] + tmp1 / (x[1] * tmp2 + x[2] * tmp3));
399  }
400  return 0;
401  }
Scalar * y
Definition: level1_cplx_impl.h:128

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


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