30 for (std::size_t y = 0u; y < field.
height(); ++y) {
31 for (std::size_t x = 0u; x < field.
width(); ++x) {
32 const float re =
static_cast<float>(10u * y + x);
33 const float im =
static_cast<float>(x) * 0.5f;
43 error =
"horizontal section size or snapped position is wrong";
46 if (std::fabs(horizontal.
realPart[3] - 23.0) > 1.0e-9) {
47 error =
"horizontal section sampled the wrong row/value";
50 const double expectedP = 23.0 * 23.0 + 1.5 * 1.5;
51 if (std::fabs(horizontal.
probability[3] - expectedP) > 1.0e-9) {
52 error =
"probability value is inconsistent with complex sample";
61 error =
"vertical section size or snapped position is wrong";
64 if (std::fabs(vertical.
realPart[4] - 41.0) > 1.0e-9) {
65 error =
"vertical section sampled the wrong column/value";
Owning Cartesian grid of complex scalar samples.
std::size_t height() const noexcept
Returns the number of samples along Y.
std::complex< float > Value
std::size_t width() const noexcept
Returns the number of samples along X.
static WaveFunctionCrossSection2DData sample(const ComplexField2D &field, CrossSectionAxis axis, double position)
Performs sample.
Declares the complex scalar field container representing two-dimensional wave functions.
bool runWaveFunctionCrossSection2DTests(std::string &error)
Runs wave function cross section2 d tests.
Data structure used by the Wave Function Cross Section2D Data component.
std::vector< double > probability
std::vector< double > realPart
std::vector< double > coordinate
Declares the wavefunctioncrosssection2d physics/numerical component used by QPE experiments.
Declares regression and invariant tests for wavefunctioncrosssection2d tests.