NEML2 2.0.0
Loading...
Searching...
No Matches
TrustRegionSubProblem Class Reference

Detailed Description

The trust region subproblem introduced in

‍Yuan, Ya-xiang. Trust region algorithms for nonlinear equations. Hong Kong Baptist University, Department of Mathematics, 1994.

#include <TrustRegionSubProblem.h>

Inheritance diagram for TrustRegionSubProblem:

Public Member Functions

 TrustRegionSubProblem (const OptionSet &options)
 
void reinit (const Res< true > &r, const Jac< true > &J, const Scalar &delta)
 Record the current state of the underlying problem.
 
Tensor preconditioned_direction (const Scalar &s) const
 
- Public Member Functions inherited from NonlinearSystem
 NonlinearSystem (const NonlinearSystem &)=default
 
 NonlinearSystem (NonlinearSystem &&) noexcept=default
 
NonlinearSystemoperator= (const NonlinearSystem &)=delete
 
NonlinearSystemoperator= (NonlinearSystem &&)=delete
 
virtual ~NonlinearSystem ()=default
 
 NonlinearSystem (const OptionSet &options)
 
virtual void init_scaling (const Sol< false > &x, const bool verbose=false)
 Compute algebraic Jacobian-based automatic scaling following https://cs.stanford.edu/people/paulliu/files/cs517-project.pdf.
 
Res< truescale (const Res< false > &r) const
 Apply scaling to the residual.
 
Res< falseunscale (const Res< true > &r) const
 Remove scaling to the residual.
 
Jac< truescale (const Jac< false > &J) const
 Apply scaling to the Jacobian.
 
Jac< falseunscale (const Jac< true > &J) const
 Remove scaling to the Jacobian.
 
Sol< truescale (const Sol< false > &u) const
 Apply scaling to the solution.
 
Sol< falseunscale (const Sol< true > &u) const
 Remove scaling to the solution.
 
virtual void set_guess (const Sol< true > &x) final
 Set the current guess.
 
template<bool scaled>
Res< scaledresidual ()
 Assemble and return the residual.
 
template<bool scaled>
Res< scaledresidual (const Sol< scaled > &x)
 Convenient shortcut to set the current guess, assemble and return the residual.
 
template<bool scaled>
Jac< scaledJacobian ()
 Assemble and return the Jacobian.
 
template<bool scaled>
Jac< scaledJacobian (const Sol< scaled > &x)
 Convenient shortcut to set the current guess, assemble and return the Jacobian.
 
template<bool scaled>
std::tuple< Res< scaled >, Jac< scaled > > residual_and_Jacobian ()
 Assemble and return the residual and Jacobian.
 
template<bool scaled>
std::tuple< Res< scaled >, Jac< scaled > > residual_and_Jacobian (const Sol< scaled > &x)
 Convenient shortcut to set the current guess, assemble and return the residual and Jacobian.
 

Protected Member Functions

void set_guess (const Sol< false > &x) override
 Set the unscaled current guess.
 
void assemble (Res< false > *residual, Jac< false > *Jacobian) override
 Compute the unscaled residual and Jacobian.
 
Tensor preconditioned_solve (const Scalar &s, const Tensor &v) const
 

Additional Inherited Members

- Static Public Member Functions inherited from NonlinearSystem
static OptionSet expected_options ()
 
static void disable_automatic_scaling (OptionSet &options)
 
static void enable_automatic_scaling (OptionSet &options)
 
- Protected Attributes inherited from NonlinearSystem
const bool _autoscale
 If true, do automatic scaling.
 
const Real _autoscale_tol
 Tolerance for convergence check of the iterative automatic scaling algorithm.
 
const unsigned int _autoscale_miter
 Maximum number of iterations allowed for the iterative automatic scaling algorithm.
 
bool _scaling_matrices_initialized
 Flag to indicate whether scaling matrices have been computed.
 
Tensor _row_scaling
 Row scaling "matrix" – since it's a batched diagonal matrix, we are only storing its diagonals.
 
Tensor _col_scaling
 Column scaling "matrix" – since it's a batched diagonal matrix, we are only storing its diagonals.
 

Constructor & Destructor Documentation

◆ TrustRegionSubProblem()

Member Function Documentation

◆ assemble()

void assemble ( Res< false > * r,
Jac< false > * J )
overrideprotectedvirtual

Compute the unscaled residual and Jacobian.

Parameters
rPointer to the residual vector – nullptr if not requested
JPointer to the Jacobian matrix – nullptr if not requested

Implements NonlinearSystem.

◆ preconditioned_direction()

Tensor preconditioned_direction ( const Scalar & s) const

◆ preconditioned_solve()

Tensor preconditioned_solve ( const Scalar & s,
const Tensor & v ) const
protected

◆ reinit()

void reinit ( const Res< true > & r,
const Jac< true > & J,
const Scalar & delta )

Record the current state of the underlying problem.

◆ set_guess()

void set_guess ( const Sol< false > & x)
overrideprotectedvirtual

Set the unscaled current guess.

Implements NonlinearSystem.