DP3
Public Member Functions | List of all members
dp3::ddecal::HybridSolver Class Referencefinal

#include <HybridSolver.h>

Inheritance diagram for dp3::ddecal::HybridSolver:
dp3::ddecal::SolverBase

Public Member Functions

 HybridSolver ()
 
void AddSolver (std::unique_ptr< SolverBase > solver)
 
std::vector< SolverBase * > ConstraintSolvers () override
 
void Initialize (size_t n_antennas, const std::vector< size_t > &n_solutions_per_direction, size_t n_channel_blocks) override
 
size_t NSolutionPolarizations () const override
 
SolveResult Solve (const FullSolveData &solve_data, std::vector< std::vector< DComplex >> &solutions, double time) override
 
bool StopOnConvergence () const
 
void SetStopOnConvergence (bool stop_on_convergence)
 
- Public Member Functions inherited from dp3::ddecal::SolverBase
 SolverBase ()
 
virtual ~SolverBase ()=default
 
void AddConstraint (std::unique_ptr< Constraint > constraint)
 
const std::vector< std::unique_ptr< Constraint > > & GetConstraints ()
 
LLSSolverType GetLLSSolverType () const
 
bool GetPhaseOnly () const
 
void GetTimings (std::ostream &os, double duration) const
 
void SetDdConstraintWeights (const std::vector< std::vector< double >> &weights)
 
void SetLLSSolverType (LLSSolverType solver_type)
 
void SetPhaseOnly (bool phase_only)
 
virtual SolveResult Solve (const UniSolveData &data, std::vector< std::vector< DComplex >> &solutions, double time)
 
virtual bool SupportsDdSolutionIntervals () const
 
size_t GetMaxIterations () const
 
void SetMaxIterations (size_t max_iterations)
 
size_t GetMinIterations () const
 
void SetMinIterations (size_t min_iterations)
 
void SetAccuracy (double accuracy)
 
double GetAccuracy () const
 
void SetConstraintAccuracy (double constraint_accuracy)
 
double GetConstraintAccuracy () const
 
void SetStepSize (double step_size)
 
double GetStepSize () const
 
void SetDetectStalling (bool detect_stalling, double step_diff_sigma)
 
bool GetDetectStalling () const
 

Additional Inherited Members

- Public Types inherited from dp3::ddecal::SolverBase
typedef std::complex< float > Complex
 
typedef std::complex< double > DComplex
 
- Protected Member Functions inherited from dp3::ddecal::SolverBase
bool ApplyConstraints (size_t iteration, double time, bool has_previously_converged, SolutionSpan &next_solutions) const
 
bool ApplyConstraints (size_t iteration, double time, bool has_previously_converged, SolutionTensor &next_solutions) const
 
bool AssignSolutions (std::vector< std::vector< DComplex >> &solutions, SolutionSpan &new_solutions, bool use_constraint_accuracy, double &avg_abs_diff, std::vector< double > &step_magnitudes) const
 
bool AssignSolutions (std::vector< std::vector< DComplex >> &solutions, SolutionTensor &new_solutions, bool use_constraint_accuracy, double &avg_abs_diff, std::vector< double > &step_magnitudes) const
 
std::unique_ptr< LLSSolverCreateLLSSolver (size_t m, size_t n, size_t nrhs) const
 
bool DetectStall (size_t iteration, const std::vector< double > &step_magnitudes)
 
std::unique_ptr< aocommon::RecursiveFor > MakeOptionalRecursiveFor () const
 
SolveResult MakeResult (size_t iteration, bool has_converged, bool constraints_satisfied) const
 
size_t NAntennas () const
 
size_t NChannelBlocks () const
 
size_t NDirections () const
 
size_t NSubSolutions () const
 
size_t NSubThreads () const
 
size_t NVisibilities () const
 
void PrepareConstraints ()
 
bool ReachedStoppingCriterion (size_t iteration, bool has_converged, bool constraints_satisfied, const std::vector< double > &step_magnitudes)
 
void Step (const std::vector< std::vector< DComplex >> &solutions, SolutionTensor &next_solutions) const
 
- Static Protected Member Functions inherited from dp3::ddecal::SolverBase
static void MakeSolutionsFinite1Pol (std::vector< std::vector< DComplex >> &solutions)
 
static void MakeSolutionsFinite2Pol (std::vector< std::vector< DComplex >> &solutions)
 
static void MakeSolutionsFinite4Pol (std::vector< std::vector< DComplex >> &solutions)
 

Detailed Description

This class implements the functionality for a hybrid solver. A hybrid solver maintains a list of solvers of different types and calls them one by one with a provided number of maximum iterations.

All solvers must solve the same number of solutions. The solvers can have different settings and constraints.

This allows starting with a slow, stable solver to converge when the initial values are quite off, and switches to faster solvers when approaching the correct solutions.

Constructor & Destructor Documentation

◆ HybridSolver()

dp3::ddecal::HybridSolver::HybridSolver ( )
inline

Member Function Documentation

◆ AddSolver()

void dp3::ddecal::HybridSolver::AddSolver ( std::unique_ptr< SolverBase solver)

Add a solver. Solvers should be added in the order that they should be called, and each solver should have its maximum number of iterations set before adding it.

◆ ConstraintSolvers()

std::vector<SolverBase*> dp3::ddecal::HybridSolver::ConstraintSolvers ( )
inlineoverridevirtual

List of solvers that need constraint initialization. This list does not include the Hybrid(Base) solver, i.e., it does not contain the "this" pointer.

Reimplemented from dp3::ddecal::SolverBase.

◆ Initialize()

void dp3::ddecal::HybridSolver::Initialize ( size_t  n_antennas,
const std::vector< size_t > &  n_solutions_per_direction,
size_t  n_channel_blocks 
)
inlineoverridevirtual

Prepares the solver with the given dimensionality info and antenna mapping. The antenna arrays map the data provided in @Solve to the antennas.

Reimplemented from dp3::ddecal::SolverBase.

◆ NSolutionPolarizations()

size_t dp3::ddecal::HybridSolver::NSolutionPolarizations ( ) const
inlineoverridevirtual
Returns
The number of polarizations in the solution.

Implements dp3::ddecal::SolverBase.

◆ SetStopOnConvergence()

void dp3::ddecal::HybridSolver::SetStopOnConvergence ( bool  stop_on_convergence)
inline

◆ Solve()

SolveResult dp3::ddecal::HybridSolver::Solve ( const FullSolveData data,
std::vector< std::vector< DComplex >> &  solutions,
double  time 
)
overridevirtual

Solves multi-directional Jones matrices. Takes the (single) measured data and the (multi-directional) model data, and solves the optimization problem that minimizes the norm of the differences.

Parameters
dataBuffer with weighted data and model data.
solutionsThe per-channel and per-antenna solutions. solutions[ch] is a pointer for channelblock ch to antenna x directions x pol solutions.

Reimplemented from dp3::ddecal::SolverBase.

◆ StopOnConvergence()

bool dp3::ddecal::HybridSolver::StopOnConvergence ( ) const
inline

If set to true and a solver finishes before reaching its maximum number of iterations, subsequent solvers are not called.


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