hybrj_functor Struct Reference
+ Inheritance diagram for hybrj_functor:

Public Member Functions

 hybrj_functor (void)
 
int operator() (const VectorXd &x, VectorXd &fvec)
 
int df (const VectorXd &x, MatrixXd &fjac)
 
- 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

◆ hybrj_functor()

hybrj_functor::hybrj_functor ( void  )
inline

Member Function Documentation

◆ df()

int hybrj_functor::df ( const VectorXd &  x,
MatrixXd &  fjac 
)
inline
237  {
238  const VectorXd::Index n = x.size();
239  assert(fjac.rows() == n);
240  assert(fjac.cols() == n);
241  for (VectorXd::Index k = 0; k < n; k++) {
242  for (VectorXd::Index j = 0; j < n; j++) fjac(k, j) = 0.;
243  fjac(k, k) = 3. - 4. * x[k];
244  if (k) fjac(k, k - 1) = -1.;
245  if (k != n - 1) fjac(k, k + 1) = -2.;
246  }
247  return 0;
248  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define assert(e,...)
Definition: Logger.h:744
char char char int int * k
Definition: level2_impl.h:374
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
list x
Definition: plotDoE.py:28
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References assert, j, k, n, and plotDoE::x.

◆ operator()()

int hybrj_functor::operator() ( const VectorXd &  x,
VectorXd &  fvec 
)
inline
223  {
224  double temp, temp1, temp2;
225  const VectorXd::Index n = x.size();
226  assert(fvec.size() == n);
227  for (VectorXd::Index k = 0; k < n; k++) {
228  temp = (3. - 2. * x[k]) * x[k];
229  temp1 = 0.;
230  if (k) temp1 = x[k - 1];
231  temp2 = 0.;
232  if (k != n - 1) temp2 = x[k + 1];
233  fvec[k] = temp - temp1 - 2. * temp2 + 1.;
234  }
235  return 0;
236  }

References assert, k, n, and plotDoE::x.


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