DP3
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
dp3::ddecal::test::SolverTester Class Reference

#include <SolverTester.h>

Public Member Functions

 SolverTester ()
 
const std::vector< int > & Antennas1 () const
 
const std::vector< int > & Antennas2 () const
 
void CheckDualResults (double tolerance)
 
void CheckPolarizationLeakageResults (double tolerance)
 
void CheckScalarResults (double tolerance)
 
const ddecal::BdaSolverBufferFillBDAData ()
 
std::vector< base::DPBufferFillDdIntervalData (bool leakage_only=false)
 
std::vector< std::vector< std::complex< double > > > & GetSolverSolutions ()
 
void InitializeSolver (dp3::ddecal::SolverBase &solver) const
 
size_t NSolutions () const
 
const std::vector< size_t > & NSolutionsPerDirection () const
 
std::vector< uint32_t > NSolutionsPerDirection32 () const
 
void SetScalarSolutions (bool use_dd_intervals)
 
void SetDiagonalSolutions (bool use_dd_intervals)
 
void SetLeakageSolutions (bool use_dd_intervals)
 

Static Public Member Functions

static std::vector< std::string > CreateDirectionNames ()
 

Static Public Attributes

static constexpr double kAccuracy = 1e-8
 
static constexpr size_t kBatchIterations = 2
 
static constexpr double kBdaUnitTimeInterval = 1.0
 
static constexpr size_t kDDSolutionsPerDirection [kNDirections] = {1, 2, 5}
 
static constexpr size_t kEpochs = 2
 
static const std::vector< double > kFrequencies
 
static constexpr size_t kHistory = 10
 
static constexpr size_t kMaxIterations = 100
 
static constexpr double kMaxSolution = 1000.0
 
static constexpr size_t kMinibatches = 4
 
static constexpr double kMinSolution = -1000.0
 
static constexpr size_t kNAntennas = 50
 
static constexpr size_t kNBaselines = kNAntennas * (kNAntennas - 1) / 2
 
static constexpr size_t kNBDATimes = 128
 
static constexpr size_t kNChannelBlocks = 4
 
static constexpr size_t kNChannels = 16
 
static constexpr size_t kNDirections = 3
 
static constexpr size_t kNPolarizations = 4
 
static constexpr size_t kNRegularTimes = 50
 
static constexpr size_t kNThreads = 4
 
static constexpr bool kPhaseOnly = false
 
static constexpr double kRobustDOF = 200.0
 
static constexpr std::array< size_t, 3 > kShape
 
static constexpr double kStepSize = 0.2
 

Detailed Description

The SolverTester is a fixture for testing solvers. It supports both regular data and BDA data.

Constructor & Destructor Documentation

◆ SolverTester()

dp3::ddecal::test::SolverTester::SolverTester ( )

Member Function Documentation

◆ Antennas1()

const std::vector<int>& dp3::ddecal::test::SolverTester::Antennas1 ( ) const
inline
Returns
The first antennas for the generated baselines.

◆ Antennas2()

const std::vector<int>& dp3::ddecal::test::SolverTester::Antennas2 ( ) const
inline
Returns
The second antennas for the generated baselines.

◆ CheckDualResults()

void dp3::ddecal::test::SolverTester::CheckDualResults ( double  tolerance)

◆ CheckPolarizationLeakageResults()

void dp3::ddecal::test::SolverTester::CheckPolarizationLeakageResults ( double  tolerance)

◆ CheckScalarResults()

void dp3::ddecal::test::SolverTester::CheckScalarResults ( double  tolerance)

Checks if the solver solutions match the generated input solutions.

Parameters
toleranceTolerance value for BOOST_CHECK_CLOSE.

◆ CreateDirectionNames()

static std::vector<std::string> dp3::ddecal::test::SolverTester::CreateDirectionNames ( )
static

◆ FillBDAData()

const ddecal::BdaSolverBuffer& dp3::ddecal::test::SolverTester::FillBDAData ( )

Creates BDA data, for testing BDA solvers.

Returns
The internal solver buffer that contains the data.

◆ FillDdIntervalData()

std::vector<base::DPBuffer> dp3::ddecal::test::SolverTester::FillDdIntervalData ( bool  leakage_only = false)

Creates regular data with direction-dependent solution intervals.

◆ GetSolverSolutions()

std::vector<std::vector<std::complex<double> > >& dp3::ddecal::test::SolverTester::GetSolverSolutions ( )
inline

Get the solution data that can be passed to the solver as initial values. and that will contain the solve result after running the solver. The various Check functions like CheckScalarResults() can verify the solve result.

See also
SetScalarSolutions() et al.

◆ InitializeSolver()

void dp3::ddecal::test::SolverTester::InitializeSolver ( dp3::ddecal::SolverBase solver) const

Initializes a solver using default values. After using this function, a test can adjust the default values. Before calling this function, the solutions should be initialized with SetScalarSolutions() or SetDiagonalSolutions().

◆ NSolutions()

size_t dp3::ddecal::test::SolverTester::NSolutions ( ) const
inline

◆ NSolutionsPerDirection()

const std::vector<size_t>& dp3::ddecal::test::SolverTester::NSolutionsPerDirection ( ) const
inline

◆ NSolutionsPerDirection32()

std::vector<uint32_t> dp3::ddecal::test::SolverTester::NSolutionsPerDirection32 ( ) const
inline

◆ SetDiagonalSolutions()

void dp3::ddecal::test::SolverTester::SetDiagonalSolutions ( bool  use_dd_intervals)

◆ SetLeakageSolutions()

void dp3::ddecal::test::SolverTester::SetLeakageSolutions ( bool  use_dd_intervals)

◆ SetScalarSolutions()

void dp3::ddecal::test::SolverTester::SetScalarSolutions ( bool  use_dd_intervals)

Initializes input solutions and solver solutions. The input solutions are for generating data. Sets the solver solutions to unit values with the appropriate dimensions. The solver can then use these values as initial values.

Member Data Documentation

◆ kAccuracy

constexpr double dp3::ddecal::test::SolverTester::kAccuracy = 1e-8
staticconstexpr

◆ kBatchIterations

constexpr size_t dp3::ddecal::test::SolverTester::kBatchIterations = 2
staticconstexpr

◆ kBdaUnitTimeInterval

constexpr double dp3::ddecal::test::SolverTester::kBdaUnitTimeInterval = 1.0
staticconstexpr

◆ kDDSolutionsPerDirection

constexpr size_t dp3::ddecal::test::SolverTester::kDDSolutionsPerDirection[kNDirections] = {1, 2, 5}
staticconstexpr

◆ kEpochs

constexpr size_t dp3::ddecal::test::SolverTester::kEpochs = 2
staticconstexpr

◆ kFrequencies

const std::vector<double> dp3::ddecal::test::SolverTester::kFrequencies
inlinestatic
Initial value:
{150e6, 160e6, 170e6,
180e6}

◆ kHistory

constexpr size_t dp3::ddecal::test::SolverTester::kHistory = 10
staticconstexpr

◆ kMaxIterations

constexpr size_t dp3::ddecal::test::SolverTester::kMaxIterations = 100
staticconstexpr

◆ kMaxSolution

constexpr double dp3::ddecal::test::SolverTester::kMaxSolution = 1000.0
staticconstexpr

◆ kMinibatches

constexpr size_t dp3::ddecal::test::SolverTester::kMinibatches = 4
staticconstexpr

◆ kMinSolution

constexpr double dp3::ddecal::test::SolverTester::kMinSolution = -1000.0
staticconstexpr

◆ kNAntennas

constexpr size_t dp3::ddecal::test::SolverTester::kNAntennas = 50
staticconstexpr

◆ kNBaselines

constexpr size_t dp3::ddecal::test::SolverTester::kNBaselines = kNAntennas * (kNAntennas - 1) / 2
staticconstexpr

◆ kNBDATimes

constexpr size_t dp3::ddecal::test::SolverTester::kNBDATimes = 128
staticconstexpr

◆ kNChannelBlocks

constexpr size_t dp3::ddecal::test::SolverTester::kNChannelBlocks = 4
staticconstexpr

◆ kNChannels

constexpr size_t dp3::ddecal::test::SolverTester::kNChannels = 16
staticconstexpr

◆ kNDirections

constexpr size_t dp3::ddecal::test::SolverTester::kNDirections = 3
staticconstexpr

◆ kNPolarizations

constexpr size_t dp3::ddecal::test::SolverTester::kNPolarizations = 4
staticconstexpr

◆ kNRegularTimes

constexpr size_t dp3::ddecal::test::SolverTester::kNRegularTimes = 50
staticconstexpr

◆ kNThreads

constexpr size_t dp3::ddecal::test::SolverTester::kNThreads = 4
staticconstexpr

◆ kPhaseOnly

constexpr bool dp3::ddecal::test::SolverTester::kPhaseOnly = false
staticconstexpr

◆ kRobustDOF

constexpr double dp3::ddecal::test::SolverTester::kRobustDOF = 200.0
staticconstexpr

◆ kShape

constexpr std::array<size_t, 3> dp3::ddecal::test::SolverTester::kShape
staticconstexpr
Initial value:
static constexpr size_t kNChannels
Definition: SolverTester.h:106
static constexpr size_t kNBaselines
Definition: SolverTester.h:114
static constexpr size_t kNPolarizations
Definition: SolverTester.h:103

◆ kStepSize

constexpr double dp3::ddecal::test::SolverTester::kStepSize = 0.2
staticconstexpr

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