Newton iterator for multi-domain, one-dimensional problems. More...
#include <MultiNewton.h>
Newton iterator for multi-domain, one-dimensional problems.
Used by class OneDim.
Definition at line 23 of file MultiNewton.h.
Public Member Functions | |
MultiNewton (int sz) | |
MultiNewton (const MultiNewton &)=delete | |
MultiNewton & | operator= (const MultiNewton &)=delete |
size_t | size () |
void | step (double *x, double *step, OneDim &r, MultiJac &jac, int loglevel) |
Compute the undamped Newton step. | |
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 solution components in all domains between their specified lower and upper bounds. | |
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. | |
double | norm2 (const double *x, const double *step, OneDim &r) const |
Compute the weighted 2-norm of step . | |
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. | |
void | resize (size_t points) |
Change the problem size. | |
Protected Attributes | |
vector< double > | m_x |
Work arrays of size m_n used in solve(). | |
vector< double > | m_stp |
vector< double > | m_stp1 |
int | m_maxAge = 5 |
size_t | m_n |
number of variables | |
double | m_elapsed = 0.0 |
MultiNewton | ( | int | sz | ) |
Definition at line 132 of file MultiNewton.cpp.
|
inlinevirtual |
Definition at line 27 of file MultiNewton.h.
|
inline |
Definition at line 31 of file MultiNewton.h.
Compute the undamped Newton step.
The residual function is evaluated at x
, but the Jacobian is not recomputed.
Definition at line 157 of file MultiNewton.cpp.
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 solution components in all domains between their specified lower and upper bounds.
Definition at line 190 of file MultiNewton.cpp.
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.
This method attempts to find a damping coefficient such that the next undamped step would have a norm smaller than that of step0. If successful, the new solution after taking the damped step is returned in x1, and the undamped step at x1 is returned in step1.
Definition at line 202 of file MultiNewton.cpp.
double norm2 | ( | const double * | x, |
const double * | step, | ||
OneDim & | r | ||
) | const |
Compute the weighted 2-norm of step
.
Definition at line 145 of file MultiNewton.cpp.
Find the solution to F(X) = 0 by damped Newton iteration.
On entry, x0 contains an initial estimate of the solution. On successful return, x1 contains the converged solution.
Definition at line 283 of file MultiNewton.cpp.
|
inline |
Set options.
Definition at line 68 of file MultiNewton.h.
void resize | ( | size_t | points | ) |
Change the problem size.
Definition at line 137 of file MultiNewton.cpp.
|
protected |
Work arrays of size m_n used in solve().
Definition at line 77 of file MultiNewton.h.
|
protected |
Definition at line 77 of file MultiNewton.h.
|
protected |
Definition at line 77 of file MultiNewton.h.
|
protected |
Definition at line 79 of file MultiNewton.h.
|
protected |
number of variables
Definition at line 82 of file MultiNewton.h.
|
protected |
Definition at line 84 of file MultiNewton.h.