6 #ifndef CT_MULTINEWTON_H
7 #define CT_MULTINEWTON_H
44 double boundStep(
const double* x0,
const double* step0,
45 const OneDim& r,
int loglevel);
54 int dampStep(
const double* x0,
const double* step0,
double* x1,
double* step1,
55 double& s1,
OneDim& r,
MultiJac& jac,
int loglevel,
bool writetitle);
73 void resize(
size_t points);
77 vector<double>
m_x, m_stp, m_stp1;
84 double m_elapsed = 0.0;
Class MultiJac evaluates the Jacobian of a system of equations defined by a residual function supplie...
Newton iterator for multi-domain, one-dimensional problems.
void resize(size_t points)
Change the problem size.
vector< double > m_x
Work arrays of size m_n used in solve().
void step(double *x, double *step, OneDim &r, MultiJac &jac, int loglevel)
Compute the undamped Newton step.
double norm2(const double *x, const double *step, OneDim &r) const
Compute the weighted 2-norm of step.
int dampStep(const double *x0, const double *step0, double *x1, double *step1, double &s1, OneDim &r, MultiJac &jac, int loglevel, bool writetitle)
On entry, step0 must contain an undamped Newton step for the solution x0.
int solve(double *x0, double *x1, OneDim &r, MultiJac &jac, int loglevel)
Find the solution to F(X) = 0 by damped Newton iteration.
void setOptions(int maxJacAge=5)
Set options.
double boundStep(const double *x0, const double *step0, const OneDim &r, int loglevel)
Return the factor by which the undamped Newton step 'step0' must be multiplied in order to keep all s...
size_t m_n
number of variables
Container class for multiple-domain 1D problems.
Namespace for the Cantera kernel.