17namespace qpe {
namespace tests {
30 if (!c1.
binaryField || c1.
levels.size() != 1u || c1.
segments.empty()) { error =
"Binary contour extraction failed";
return false; }
31 if (std::fabs(c1.
levels[0] - 4.0f) > 1.0e-5f) { error =
"Binary midpoint level is wrong";
return false; }
34 for (std::size_t y = 0; y < ramp.
height(); ++y) {
35 for (std::size_t x = 0; x < ramp.
width(); ++x) {
36 ramp.
set(x, y,
static_cast<float>(x));
40 if (c2.
binaryField || c2.
levels.size() != 3u || c2.
segments.empty()) { error =
"Continuous contour extraction failed";
return false; }
static PotentialContours2DResult compute(const PotentialField2D &potential, std::size_t requestedLevels)
Performs compute.
Implements the Potential Field2D component.
std::size_t height() const noexcept
Returns height.
void clear() noexcept
Performs clear.
void addRectangle(float centerX, float centerY, float width, float height, Value value)
Adds rectangle.
std::size_t width() const noexcept
Returns width.
void set(std::size_t x, std::size_t y, Value value) noexcept
Performs set.
bool runPotentialContours2DTests(std::string &error)
Runs potential contours2 d tests.
Declares the potentialcontours2d physics/numerical component used by QPE experiments.
Declares regression and invariant tests for potentialcontours2d tests.
Declares the potentialfield2d physics/numerical component used by QPE experiments.
Data record containing Potential Contours2D Result.
std::vector< float > levels
std::vector< PotentialContourSegment2D > segments