concepts::Newton< F > Class Template Referenceabstract
Solves a non-linear system of the form A(X)=Y. More...
#include <newton.hh>
Public Types | |
typedef Cmplxtype< F >::type | c_type |
Real type of data type. More... | |
typedef Realtype< F >::type | r_type |
Real type of data type. More... | |
Public Member Functions | |
virtual void | apply_ () |
Intrinsic application method without argument. More... | |
virtual void | apply_ (const Vector< typename F::d_type > &fncY, Vector< typename F::d_type > &fncX) |
virtual const uint | dimX () const |
Returns the size of the image space of the operator (number of rows of the corresponding matrix) More... | |
virtual const uint | dimY () const |
Returns the size of the source space of the operator (number of columns of the corresponding matrix) More... | |
virtual void | hide_messages () |
Newton (std::function< Vector< typename F::d_type >(Vector< typename F::d_type >)> A, Real dx, uint dimY, uint dimX, Real tol=1e-8, Real iterMax=1000) | |
Constructor. More... | |
Newton (std::function< Vector< typename F::d_type >(Vector< typename F::d_type >)> A, std::function< F(Vector< typename F::d_type >)> JacA, uint dimY, uint dimX, Real tol=1e-8, Real iterMax=50) | |
Constructor. More... | |
void | operator() () |
Application method without second argument. Used for parallel solvers. More... | |
virtual void | operator() (const Function< c_type > &fncY, Function< c_type > &fncX) |
Application operator for complex function fncY . More... | |
virtual void | operator() (const Function< r_type > &fncY, Function< F > &fncX) |
Application operator for real function fncY . More... | |
void | operator() (const Matrix< c_type > &mX, Matrix< c_type > &mY) |
Application method to complex matrices. Calls apply_() More... | |
void | operator() (const Matrix< r_type > &mX, Matrix< F > &mY) |
Application method to real matrices. Calls function apply() More... | |
virtual void | operator() (const Vector< c_type > &fncY, Vector< c_type > &fncX) |
Application operator for complex function fncY . More... | |
virtual void | operator() (const Vector< r_type > &fncY, Vector< F > &fncX) |
Application operator for real vector fncY . More... | |
virtual void | show_messages () |
virtual | ~Newton () |
Public Attributes | |
F::d_type | type |
Protected Member Functions | |
virtual void | apply_ (const Vector< F > &fncY, Vector< F > &fncX)=0 |
Intrinsic application method, i.e. More... | |
virtual std::ostream & | info (std::ostream &os) const |
virtual void | setLinearSolver_ (F *Jacobian) |
Set linear solver. More... | |
Protected Attributes | |
std::function< Vector< typename F::d_type >Vector< typename F::d_type >)> & | A_ |
Function that evaluates the matrix A applied to vector X. More... | |
bool | definedJacA_ |
Flag that states if the Jacobian matrix has been set. More... | |
uint | dimX_ |
Size of the unknown. More... | |
uint | dimY_ |
Size of the data. More... | |
Real | dx_ |
Step for the computation of the pseudo-Jacobian. More... | |
uint | iterMax_ |
Maximum number of iterations. More... | |
std::function< F(Vector< typename F::d_type >)> * | JacA_ |
Function that evaluates the Jacobian of matrix A applied to vector X. More... | |
std::unique_ptr< concepts::Operator< typename F::d_type > > | linearSolver_ |
Internal linear solver. More... | |
Real | tol_ |
Tolerance for the functional. More... | |
bool | verbose_ |
Internal flag for verbosity. More... | |
Detailed Description
template<class F>
class concepts::Newton< F >
Solves a non-linear system of the form A(X)=Y.
Member Typedef Documentation
◆ c_type
|
inherited |
Real type of data type.
Definition at line 120 of file compositions.hh.
◆ r_type
|
inherited |
Real type of data type.
Definition at line 118 of file compositions.hh.
Constructor & Destructor Documentation
◆ Newton() [1/2]
|
inline |
Constructor.
- Parameters
-
A non-linear operator that has to be solved dimY size of the data dimX size of the unknown dx step for the algorithm tol (optional) tolerance that will be used for the algorithm iterMax (optional) maximum number of iterations before the algorithm decides failure
◆ Newton() [2/2]
|
inline |
Constructor.
- Parameters
-
A non-linear operator that has to be solved JacA Jacobian of the non-linear operator A dimY size of the data dimX size of the unknown dx step for the algorithm tol (optional) tolerance that will be used for the algorithm iterMax (optional) maximum number of iterations before the algorithm decides failure
◆ ~Newton()
|
inlinevirtual |
Member Function Documentation
◆ apply_() [1/3]
|
virtual |
Intrinsic application method without argument.
Implements concepts::VecOperator< F::d_type >.
◆ apply_() [2/3]
|
protectedpure virtualinherited |
◆ apply_() [3/3]
|
virtual |
◆ dimX()
|
inlinevirtualinherited |
Returns the size of the image space of the operator (number of rows of the corresponding matrix)
Definition at line 93 of file compositions.hh.
◆ dimY()
|
inlinevirtualinherited |
Returns the size of the source space of the operator (number of columns of the corresponding matrix)
Definition at line 98 of file compositions.hh.
◆ hide_messages()
|
virtual |
◆ info()
|
protectedvirtualinherited |
Reimplemented from concepts::Operator< F >.
◆ operator()() [1/7]
|
virtualinherited |
Application method without second argument. Used for parallel solvers.
Reimplemented from concepts::Operator< F >.
◆ operator()() [2/7]
|
virtualinherited |
Application operator for complex function fncY
.
Computes fncX
= A(fncY
) where A is this operator. fncX
becomes complex.
In derived classes its enough to implement the operator() for complex Operator's. If a real counterpart is not implemented, the function fncY
is splitted into real and imaginary part and the application operator for real functions is called for each. Then the result is combined.
If in a derived class the operator() for complex Operator's is not implemented, a exception is thrown from here.
Reimplemented from concepts::Operator< F >.
◆ operator()() [3/7]
|
virtualinherited |
Application operator for real function fncY
.
Computes fncX
= A(fncY
) where A is this operator.
fncX
becomes the type of the operator, for real data it becomes real, for complex data it becomes complex.
In derived classes its enough to implement the operator() for real Operator's. If a complex counterpart is not implemented, the function fncY
is transformed to a complex function and then the application operator for complex functions is called.
If in a derived class the operator() for real Operator's is not implemented, a exception is thrown from here.
Reimplemented from concepts::Operator< F >.
◆ operator()() [4/7]
|
inherited |
Application method to complex matrices. Calls apply_()
◆ operator()() [5/7]
|
inherited |
Application method to real matrices. Calls function apply()
◆ operator()() [6/7]
|
virtualinherited |
Application operator for complex function fncY
.
Computes fncX
= A(fncY
) where A is this operator. fncX
becomes complex.
In derived classes its enough to implement the operator() for complex Operator's. If a real counterpart is not implemented, the vector fncY
is splitted into real and imaginary part and the application operator for real vectors is called for each. Then the result is combined
If in a derived class the operator() for complex Operator's i not implemented, a exception is thrown from here.
◆ operator()() [7/7]
|
virtualinherited |
Application operator for real vector fncY
.
Computes fncX
= A(fncY
) where A is this operator.
Type of fncX
becomes that of the operator, for real data it becomes real, for complex data it becomes complex.
In derived classes its enough to implement the operator() for real Operator's. If a complex counterpart is not implemented, the vector fncY
is transformed to a complex vector and then the application for complex vectors is called.
If in a derived class the operator() for real Operator's is not implemented, a exception is thrown from here.
◆ setLinearSolver_()
|
protectedvirtual |
Set linear solver.
◆ show_messages()
|
virtual |
Reimplemented from concepts::Operator< F >.
Member Data Documentation
◆ A_
|
protected |
◆ definedJacA_
|
protected |
◆ dimX_
|
protected |
◆ dimY_
|
protected |
◆ dx_
|
protected |
◆ iterMax_
|
protected |
◆ JacA_
|
protected |
◆ linearSolver_
|
protected |
◆ tol_
|
protected |
◆ type
F::d_type concepts::Newton< F >::type |
◆ verbose_
|
protected |
The documentation for this class was generated from the following file:
- operator/newton.hh