Documentation 6b54b78464
Loading...
Searching...
No Matches
CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI > Class Template Reference

A quasi-Newton fixed-point (FP) accelerator based on IQN-ILS. More...

#include <CQuasiNewtonInvLeastSquares.hpp>

Public Types

using Scalar = Scalar_t
 
using Index = typename su2matrix< Scalar >::Index
 

Public Member Functions

 CQuasiNewtonInvLeastSquares ()=default
 Default construction without allocation.
 
 CQuasiNewtonInvLeastSquares (Index nsample, Index npt, Index nvar, Index nptdomain=0)
 Construction with allocation, see "resize".
 
void resize (Index nsample, Index npt, Index nvar, Index nptdomain=0)
 Resize the object.
 
Index size () const
 Size of the object, the number of samples.
 
void reset ()
 Discard all history, keeping the current solution.
 
su2matrix< Scalar > & FPresult ()
 Access the current fixed-point result.
 
const su2matrix< Scalar > & FPresult () const
 
Scalar & FPresult (Index iPt, Index iVar)
 
const Scalar & FPresult (Index iPt, Index iVar) const
 
su2matrix< Scalar > & solution ()
 Access the current solution approximation.
 
const su2matrix< Scalar > & solution () const
 
Scalar & operator() (Index iPt, Index iVar)
 
const Scalar & operator() (Index iPt, Index iVar) const
 
const su2matrix< Scalar > & compute ()
 Compute and return a new approximation.
 

Detailed Description

template<class Scalar_t, bool WithMPI = true>
class CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >

A quasi-Newton fixed-point (FP) accelerator based on IQN-ILS.

Note
The implementation prioritizes storage, the LS problem is solved via the normal equations as that is easy to make parallel over MPI, it may however be unstable with large sample sizes (compared to QR decomp). Usage: Allocate, store the initial solution (operator (i,j), default is 0), run the FP, store its result ("FPresult"), compute new solution, use it as the new input of the FP, run the FP, etc.

Member Typedef Documentation

◆ Index

template<class Scalar_t , bool WithMPI = true>
using CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::Index = typename su2matrix<Scalar>::Index

◆ Scalar

template<class Scalar_t , bool WithMPI = true>
using CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::Scalar = Scalar_t

Constructor & Destructor Documentation

◆ CQuasiNewtonInvLeastSquares() [1/2]

template<class Scalar_t , bool WithMPI = true>
CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::CQuasiNewtonInvLeastSquares ( )
default

Default construction without allocation.

◆ CQuasiNewtonInvLeastSquares() [2/2]

template<class Scalar_t , bool WithMPI = true>
CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::CQuasiNewtonInvLeastSquares ( Index  nsample,
Index  npt,
Index  nvar,
Index  nptdomain = 0 
)
inline

Construction with allocation, see "resize".

Member Function Documentation

◆ compute()

template<class Scalar_t , bool WithMPI = true>
const su2matrix< Scalar > & CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::compute ( )
inline

Compute and return a new approximation.

Note
To be used after storing the FP result.

◆ FPresult() [1/4]

template<class Scalar_t , bool WithMPI = true>
su2matrix< Scalar > & CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::FPresult ( )
inline

Access the current fixed-point result.

Note
Use these to STORE the result of running the FP.

◆ FPresult() [2/4]

template<class Scalar_t , bool WithMPI = true>
const su2matrix< Scalar > & CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::FPresult ( ) const
inline

◆ FPresult() [3/4]

template<class Scalar_t , bool WithMPI = true>
Scalar & CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::FPresult ( Index  iPt,
Index  iVar 
)
inline

◆ FPresult() [4/4]

template<class Scalar_t , bool WithMPI = true>
const Scalar & CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::FPresult ( Index  iPt,
Index  iVar 
) const
inline

◆ operator()() [1/2]

template<class Scalar_t , bool WithMPI = true>
Scalar & CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::operator() ( Index  iPt,
Index  iVar 
)
inline

◆ operator()() [2/2]

template<class Scalar_t , bool WithMPI = true>
const Scalar & CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::operator() ( Index  iPt,
Index  iVar 
) const
inline

◆ reset()

template<class Scalar_t , bool WithMPI = true>
void CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::reset ( )
inline

Discard all history, keeping the current solution.

◆ resize()

template<class Scalar_t , bool WithMPI = true>
void CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::resize ( Index  nsample,
Index  npt,
Index  nvar,
Index  nptdomain = 0 
)
inline

Resize the object.

Parameters
[in]nsample- Number of samples used to build the FP history.
[in]npt- Size of the solution including any halos.
[in]nvar- Number of solution variables.
[in]nptdomain- Local size (<= npt), if 0 it defaults to npt.

◆ size()

template<class Scalar_t , bool WithMPI = true>
Index CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::size ( ) const
inline

Size of the object, the number of samples.

◆ solution() [1/2]

template<class Scalar_t , bool WithMPI = true>
su2matrix< Scalar > & CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::solution ( )
inline

Access the current solution approximation.

Note
Use these, after calling compute, to GET the new FP solution estimate.

◆ solution() [2/2]

template<class Scalar_t , bool WithMPI = true>
const su2matrix< Scalar > & CQuasiNewtonInvLeastSquares< Scalar_t, WithMPI >::solution ( ) const
inline

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