diff --git a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp index 05c6489bcb9..0255545c891 100644 --- a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp +++ b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp @@ -87,6 +87,10 @@ class BoundaryTolerance { throw std::invalid_argument( "AbsoluteCartesian: Tolerance must be non-negative"); } + if ((tolerance0 == 0) != (tolerance1 == 0)) { + throw std::invalid_argument( + "AbsoluteCartesian: Both tolerances must be zero or non-zero"); + } } }; diff --git a/Tests/UnitTests/Core/Surfaces/BoundsRegressionTests.cpp b/Tests/UnitTests/Core/Surfaces/BoundsRegressionTests.cpp new file mode 100644 index 00000000000..56bec3caaa8 --- /dev/null +++ b/Tests/UnitTests/Core/Surfaces/BoundsRegressionTests.cpp @@ -0,0 +1,3184 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#include +#include +#include + +#include "Acts/Geometry/GeometryContext.hpp" +#include "Acts/Surfaces/AnnulusBounds.hpp" +#include "Acts/Surfaces/DiscSurface.hpp" +#include "Acts/Surfaces/PlanarBounds.hpp" +#include "Acts/Surfaces/PlaneSurface.hpp" +#include "Acts/Surfaces/RectangleBounds.hpp" +#include "Acts/Surfaces/RegularSurface.hpp" +#include "Acts/Surfaces/TrapezoidBounds.hpp" + +#include +#include + +namespace Acts::Test { + +GeometryContext gctx; + +std::size_t matrixResolution = 80; + +struct TestMatrix : public std::vector> { + TestMatrix() + : std::vector>( + matrixResolution, std::vector(matrixResolution, 0)) { + }; +}; + +std::pair boundingBox(const RegularSurface& surface, + double relMargin) { + Vector2 min{std::numeric_limits::max(), + std::numeric_limits::max()}; + Vector2 max{std::numeric_limits::lowest(), + std::numeric_limits::lowest()}; + + std::vector vertices; + if (const auto* pBounds = + dynamic_cast(&surface.bounds()); + pBounds) { + vertices = pBounds->vertices(); + } else if (const auto* dBounds = + dynamic_cast(&surface.bounds()); + dBounds) { + vertices = dBounds->vertices(); + } else { + throw std::runtime_error("Unsupported bounds type"); + } + + for (const auto& vertex : vertices) { + min = min.cwiseMin(vertex); + max = max.cwiseMax(vertex); + } + + Vector2 size = max - min; + + min = min - relMargin * size; + max = max + relMargin * size; + + Vector3 min3 = surface.transform(gctx) * Vector3{min[0], min[1], 0}; + Vector3 max3 = surface.transform(gctx) * Vector3{max[0], max[1], 0}; + + return {min3.head<2>(), max3.head<2>()}; +} + +TestMatrix makeTestMatrix(const RegularSurface& surface, + const BoundaryTolerance& tolerance, + double relMargin = 0.1) { + auto [min, max] = boundingBox(surface, relMargin); + Vector2 delta = max - min; + + TestMatrix testMatrix; + + Vector2 step = delta / (matrixResolution - 1); + + for (std::size_t i = 0; i < matrixResolution; ++i) { + for (std::size_t j = 0; j < matrixResolution; ++j) { + Vector2 query = min + Vector2(j, i).cwiseProduct(step); + Vector2 local = + surface.globalToLocal(gctx, Vector3{query[0], query[1], 0}).value(); + bool inside = surface.bounds().inside(local, tolerance); + testMatrix.at(i).at(j) = inside ? 1 : 0; + } + } + + return testMatrix; +} + +void printTestMatrix(const TestMatrix& matrix) { + for (const auto& row : matrix) { + for (std::uint8_t inside : row) { + std::cout << (inside == 1 ? "X" : "."); + } + std::cout << std::endl; + } +} + +TestMatrix parseMatrix(const std::string& matrix) { + TestMatrix result; + + std::size_t i = 0; + std::size_t j = 0; + + for (auto it = matrix.find_first_not_of("\n "); it < matrix.size(); it++) { + const char c = matrix.at(it); + if (c == ' ') { + continue; + } + if (c == '\n') { + i += 1; + j = 0; + continue; + } + if (c == '.') { + result.at(i).at(j) = 0; + } else { + result.at(i).at(j) = 1; + } + j += 1; + } + + return result; +} + +void printMatrixDiff(const TestMatrix& ref, const TestMatrix& act) { + static const std::string s_ref = "-"; + static const std::string s_act = "+"; + static const std::string s_in = "X"; + static const std::string s_out = "."; + + bool tty = isatty(fileno(stdout)) != 0; + + // Print special output in case the reference is empty so we can easily update + // the reference. + bool refEmpty = std::ranges::all_of(ref, [](const auto& row) { + return std::ranges::all_of(row, [](const auto& v) { return v == 0; }); + }); + + auto red = [tty](const std::string& s) { + if (!tty) { + return s; + } + return "\033[1;31m" + s + "\033[0m"; + }; + + auto green = [tty](const std::string& s) { + if (!tty) { + return s; + } + return "\033[1;32m" + s + "\033[0m"; + }; + + for (std::size_t i = 0; i <= matrixResolution - 1; ++i) { + for (std::size_t j = 0; j <= matrixResolution - 1; ++j) { + bool insideRef = ref.at(i).at(j) == 1; + bool insideAct = act.at(i).at(j) == 1; + + if (refEmpty) { + std::cout << (insideAct ? s_in : s_out); + continue; + } + + if (!insideRef && !insideAct) { + std::cout << s_out; + } + if (insideRef && !insideAct) { + std::cout << red(s_ref); + } + if (!insideRef && insideAct) { + std::cout << green(s_act); + } + if (insideRef && insideAct) { + std::cout << s_in; + } + } + std::cout << std::endl; + } + + if (!refEmpty) { + std::cout << red(s_ref + ": inside reference but not inside actual") + << std::endl; + std::cout << green(s_act + ": not inside reference but inside actual") + << std::endl; + std::cout << s_in + ": inside both" << std::endl; + std::cout << s_out + ": outside both" << std::endl; + } else { + std::cout << red("REFERENCE IS EMPTY") << std::endl; + std::cout << s_in + ": inside actual" << std::endl; + std::cout << s_out + ": outside actual" << std::endl; + } +} + +boost::test_tools::predicate_result checkMatrices(const TestMatrix& val, + const TestMatrix& ref) { + if (val == ref) { + return true; + } + printMatrixDiff(ref, val); + boost::test_tools::predicate_result res(false); + res.message() << "Actual test matrix differs from reference"; + return res; +} + +BOOST_AUTO_TEST_SUITE(Surfaces) + +BOOST_AUTO_TEST_CASE(Rectangle) { + auto bounds = std::make_shared(10, 20); + auto surface = + Surface::makeShared(Transform3::Identity(), bounds); + + BOOST_TEST_CONTEXT("None") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::None(); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteEuclidean(2)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteEuclidean(2); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.2), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteEuclidean(-2)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteEuclidean(-2); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("Chi2Bound(eye, 0.1)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = + BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 0.1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.5), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("Chi2Bound(eye, -0.1)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = + BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), -0.1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteBound(0.8, 0.05)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteBound(0.8, 0.05); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.2), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteBound(1, 0)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteBound(1, 0); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.15), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteCartesian(1, 1)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteBound(0, 0.1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.15), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteCartesian(1, 1)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteCartesian(1, 1.2); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteCartesian(1, 0.01)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteCartesian(1, 0.01); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteCartesian(0.01, 1)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteCartesian(0.01, 1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteCartesian(0, 0)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = + BoundaryTolerance::AbsoluteCartesian(0.0, 0.0); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } +} + +BOOST_AUTO_TEST_CASE(Trapezoid) { + auto bounds = std::make_shared(10, 20, 5, 0.1); + auto surface = + Surface::makeShared(Transform3::Identity(), bounds); + + BOOST_TEST_CONTEXT("None") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.....................................................XX......................... +..................................................XXXXX......................... +...............................................XXXXXXXXX........................ +............................................XXXXXXXXXXXX........................ +........................................XXXXXXXXXXXXXXXXX....................... +.....................................XXXXXXXXXXXXXXXXXXXX....................... +..................................XXXXXXXXXXXXXXXXXXXXXXX....................... +...............................XXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................................... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................................... +.........XXXXXXXXXXXXXXXXXXXXXXXXX.............................................. +.........XXXXXXXXXXXXXXXXXXXXXX................................................. +.........XXXXXXXXXXXXXXXXXXX.................................................... +.........XXXXXXXXXXXXXXXX....................................................... +........XXXXXXXXXXXXX........................................................... +........XXXXXXXXXX.............................................................. +........XXXXXXX................................................................. +.......XXXXX.................................................................... +.......X........................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + BoundaryTolerance tolerance = BoundaryTolerance::None(); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteEuclidean(2)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +...................................................XXX.......................... +................................................XXXXXX.......................... +.............................................XXXXXXXXXX......................... +.........................................XXXXXXXXXXXXXX......................... +......................................XXXXXXXXXXXXXXXXX......................... +...................................XXXXXXXXXXXXXXXXXXXXX........................ +................................XXXXXXXXXXXXXXXXXXXXXXXX........................ +............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................ +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................. +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................................... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................................... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXX............................................ +.........XXXXXXXXXXXXXXXXXXXXXXXX............................................... +.........XXXXXXXXXXXXXXXXXXXXX.................................................. +.........XXXXXXXXXXXXXXXXX...................................................... +..........XXXXXXXXXXXXX......................................................... +..........XXXXXXXXXX............................................................ +..........XXXXXXX............................................................... +...........XX................................................................... +................................................................................ +................................................................................ +................................................................................ + )X"; + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteEuclidean(2); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.2), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteEuclidean(-2)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +...................................................XXX.......................... +................................................XXXXXXX......................... +............................................XXXXXXXXXXX......................... +.........................................XXXXXXXXXXXXXX......................... +......................................XXXXXXXXXXXXXXXXXX........................ +...................................XXXXXXXXXXXXXXXXXXXXX........................ +...............................XXXXXXXXXXXXXXXXXXXXXXXXXX....................... +............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................. +.................XXXXXXXXXXXXXXXXXXXXXXXXXX..................................... +.................XXXXXXXXXXXXXXXXXXXXXXX........................................ +.................XXXXXXXXXXXXXXXXXXXX........................................... +................XXXXXXXXXXXXXXXXXX.............................................. +................XXXXXXXXXXXXXX.................................................. +................XXXXXXXXXXX..................................................... +...............XXXXXXXXX........................................................ +...............XXXXXX........................................................... +...............XX............................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteEuclidean(-2); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("Chi2Bound(eye, 0.1)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +...............................................XX............................... +............................................XXXXXX.............................. +........................................XXXXXXXXXX.............................. +.....................................XXXXXXXXXXXXX.............................. +..................................XXXXXXXXXXXXXXXXX............................. +...............................XXXXXXXXXXXXXXXXXXXX............................. +.............................XXXXXXXXXXXXXXXXXXXXXXX............................ +.............................XXXXXXXXXXXXXXXXXXXXXXX............................ +............................XXXXXXXXXXXXXXXXXXXXXXXX............................ +............................XXXXXXXXXXXXXXXXXXXXXXXXX........................... +............................XXXXXXXXXXXXXXXXXXXXXXXXX........................... +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +......................XXXXXXXXXXXXXXXXXXXXXXXXXX................................ +.....................XXXXXXXXXXXXXXXXXXXXXXXX................................... +.....................XXXXXXXXXXXXXXXXXXXXX...................................... +.....................XXXXXXXXXXXXXXXXX.......................................... +.....................XXXXXXXXXXXXXX............................................. +....................XXXXXXXXXXXX................................................ +....................XXXXXXXXX................................................... +....................XXXXXX...................................................... +....................XX.......................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = + BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 0.1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.5), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("Chi2Bound(eye, -0.1)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +......................................................X......................... +...................................................XXXX......................... +................................................XXXXXXX......................... +.............................................XXXXXXXXXXX........................ +.........................................XXXXXXXXXXXXXXX........................ +......................................XXXXXXXXXXXXXXXXXXX....................... +...................................XXXXXXXXXXXXXXXXXXXXXX....................... +................................XXXXXXXXXXXXXXXXXXXXXXXXX....................... +............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................................ +...........XXXXXXXXXXXXXXXXXXXXXXXXXX........................................... +...........XXXXXXXXXXXXXXXXXXXXXX............................................... +...........XXXXXXXXXXXXXXXXXXX.................................................. +..........XXXXXXXXXXXXXXXXX..................................................... +..........XXXXXXXXXXXXXX........................................................ +..........XXXXXXXXXX............................................................ +.........XXXXXXXX............................................................... +.........XXXXX.................................................................. +.........XX..................................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = + BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), -0.1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteBound(0.8, 0.05)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +...................................................XXX.......................... +................................................XXXXXX.......................... +.............................................XXXXXXXXX.......................... +.........................................XXXXXXXXXXXXX.......................... +......................................XXXXXXXXXXXXXXXX.......................... +...................................XXXXXXXXXXXXXXXXXXX.......................... +................................XXXXXXXXXXXXXXXXXXXXXX.......................... +............................XXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................ +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................. +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXX......................................... +...........XXXXXXXXXXXXXXXXXXXXXXXXX............................................ +...........XXXXXXXXXXXXXXXXXXXXXX............................................... +...........XXXXXXXXXXXXXXXXXXX.................................................. +...........XXXXXXXXXXXXXXX...................................................... +...........XXXXXXXXXXXX......................................................... +...........XXXXXXXXX............................................................ +...........XXXXXX............................................................... +...........XX................................................................... +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteBound(0.8, 2); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.2), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteBound(1, 0)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +......................................................X......................... +...................................................XXXX......................... +................................................XXXXXXX......................... +............................................XXXXXXXXXXX......................... +.........................................XXXXXXXXXXXXXX......................... +......................................XXXXXXXXXXXXXXXXXX........................ +...................................XXXXXXXXXXXXXXXXXXXXX........................ +...............................XXXXXXXXXXXXXXXXXXXXXXXXX........................ +............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................................... +............XXXXXXXXXXXXXXXXXXXXXXXXXX.......................................... +............XXXXXXXXXXXXXXXXXXXXXXX............................................. +...........XXXXXXXXXXXXXXXXXXXXX................................................ +...........XXXXXXXXXXXXXXXXXX................................................... +...........XXXXXXXXXXXXXX....................................................... +...........XXXXXXXXXXX.......................................................... +..........XXXXXXXXX............................................................. +..........XXXXXX................................................................ +..........XX.................................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteBound(1, 0); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.15), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteBound(0, 0.1)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.....................................................X.......................... +.................................................XXXXX.......................... +..............................................XXXXXXXX.......................... +...........................................XXXXXXXXXXXX......................... +........................................XXXXXXXXXXXXXXX......................... +....................................XXXXXXXXXXXXXXXXXXXX........................ +.................................XXXXXXXXXXXXXXXXXXXXXXX........................ +..............................XXXXXXXXXXXXXXXXXXXXXXXXXX........................ +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXX........................................ +............XXXXXXXXXXXXXXXXXXXXXXXXX........................................... +...........XXXXXXXXXXXXXXXXXXXXXX............................................... +...........XXXXXXXXXXXXXXXXXXX.................................................. +...........XXXXXXXXXXXXXXXX..................................................... +...........XXXXXXXXXXX.......................................................... +..........XXXXXXXXX............................................................. +..........XXXXXX................................................................ +..........XXX................................................................... +..........X..................................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteBound(0, 0.1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.15), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteCartesian(1, 1.2)") { + std::string reference = R"X( +................................................................................ +.....................................................XXX........................ +..................................................XXXXXXX....................... +...............................................XXXXXXXXXX....................... +...........................................XXXXXXXXXXXXXX....................... +........................................XXXXXXXXXXXXXXXXXX...................... +.....................................XXXXXXXXXXXXXXXXXXXXX...................... +..................................XXXXXXXXXXXXXXXXXXXXXXXXX..................... +..............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................ +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................... +.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................................... +.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................................... +.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................................. +.....XXXXXXXXXXXXXXXXXXXXXXXXXXX................................................ +.....XXXXXXXXXXXXXXXXXXXXXXX.................................................... +.....XXXXXXXXXXXXXXXXXXXX....................................................... +.....XXXXXXXXXXXXXXXXX.......................................................... +......XXXXXXXXXXXXX............................................................. +......XXXXXXXXX................................................................. +......XXXXXX.................................................................... +......XXX....................................................................... +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteCartesian(1, 1.2); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteCartesian(1, 0.01)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.....................................................XXX........................ +..................................................XXXXXXX....................... +...............................................XXXXXXXXXX....................... +............................................XXXXXXXXXXXXX....................... +........................................XXXXXXXXXXXXXXXXX....................... +.....................................XXXXXXXXXXXXXXXXXXXX....................... +..................................XXXXXXXXXXXXXXXXXXXXXXX....................... +...............................XXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................................... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................................... +.........XXXXXXXXXXXXXXXXXXXXXXXXXX............................................. +.........XXXXXXXXXXXXXXXXXXXXXX................................................. +.........XXXXXXXXXXXXXXXXXXX.................................................... +........XXXXXXXXXXXXXXXXX....................................................... +........XXXXXXXXXXXXXX.......................................................... +........XXXXXXXXXX.............................................................. +........XXXXXXX................................................................. +.......XXXXX.................................................................... +.......XX....................................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteCartesian(1, 0.01); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteCartesian(0.01, 1)") { + std::string reference = R"X( +................................................................................ +................................................................................ +.....................................................XX......................... +..................................................XXXXX......................... +...............................................XXXXXXXX......................... +...........................................XXXXXXXXXXXX......................... +........................................XXXXXXXXXXXXXXX......................... +.....................................XXXXXXXXXXXXXXXXXX......................... +..................................XXXXXXXXXXXXXXXXXXXXX......................... +..............................XXXXXXXXXXXXXXXXXXXXXXXXXX........................ +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................ +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................................... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................................... +........XXXXXXXXXXXXXXXXXXXXXXXXXXX............................................. +........XXXXXXXXXXXXXXXXXXXXXXX................................................. +.......XXXXXXXXXXXXXXXXXXXXX.................................................... +.......XXXXXXXXXXXXXXXXXX....................................................... +.......XXXXXXXXXXXXXXX.......................................................... +.......XXXXXXXXXXXX............................................................. +.......XXXXXXXX................................................................. +.......XXXXX.................................................................... +.......XX....................................................................... +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteCartesian(0.01, 1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + BOOST_TEST_CONTEXT("AbsoluteCartesian(0, 0)") { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.....................................................XX......................... +..................................................XXXXX......................... +...............................................XXXXXXXXX........................ +............................................XXXXXXXXXXXX........................ +........................................XXXXXXXXXXXXXXXXX....................... +.....................................XXXXXXXXXXXXXXXXXXXX....................... +..................................XXXXXXXXXXXXXXXXXXXXXXX....................... +...............................XXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................................... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................................... +.........XXXXXXXXXXXXXXXXXXXXXXXXX.............................................. +.........XXXXXXXXXXXXXXXXXXXXXX................................................. +.........XXXXXXXXXXXXXXXXXXX.................................................... +.........XXXXXXXXXXXXXXXX....................................................... +........XXXXXXXXXXXXX........................................................... +........XXXXXXXXXX.............................................................. +........XXXXXXX................................................................. +.......XXXXX.................................................................... +.......X........................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = + BoundaryTolerance::AbsoluteCartesian(0.0, 0.0); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } +} + +BOOST_AUTO_TEST_CASE(Annulus) { + const double minRadius = 7.2; + const double maxRadius = 12.0; + const double minPhi = 0.74195; + const double maxPhi = 1.33970; + + const Vector2 offset(-2., 2.); + + auto bounds = std::make_shared(minRadius, maxRadius, minPhi, + maxPhi, offset); + auto surface = + Surface::makeShared(Transform3::Identity(), bounds); + + { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +....................................X........................................... +...................................XXX.......................................... +...................................XXXX......................................... +..................................XXXXXXX....................................... +..................................XXXXXXXX...................................... +.................................XXXXXXXXXXX.................................... +................................XXXXXXXXXXXXX................................... +................................XXXXXXXXXXXXXX.................................. +...............................XXXXXXXXXXXXXXXXX................................ +..............................XXXXXXXXXXXXXXXXXXX............................... +..............................XXXXXXXXXXXXXXXXXXXXX............................. +.............................XXXXXXXXXXXXXXXXXXXXXXX............................ +............................XXXXXXXXXXXXXXXXXXXXXXXXX........................... +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................ +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXX...................................... +...............XXXXXXXXXXXXXXXXXXXXXXXXXX....................................... +................XXXXXXXXXXXXXXXXXXXXXXX......................................... +................XXXXXXXXXXXXXXXXXXXXX........................................... +................XXXXXXXXXXXXXXXXXXX............................................. +................XXXXXXXXXXXXXXXXX............................................... +.................XXXXXXXXXXXXXX................................................. +.................XXXXXXXXXXXX................................................... +.................XXXXXXXXXX..................................................... +..................XXXXXXX....................................................... +..................XXXX.......................................................... +..................XX............................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::None(); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +...................................XXX.......................................... +................................XXXXXXXXX....................................... +...............................XXXXXXXXXXX...................................... +..............................XXXXXXXXXXXXX..................................... +..............................XXXXXXXXXXXXXXX................................... +.............................XXXXXXXXXXXXXXXXXX................................. +.............................XXXXXXXXXXXXXXXXXXX................................ +............................XXXXXXXXXXXXXXXXXXXXXX.............................. +............................XXXXXXXXXXXXXXXXXXXXXXX............................. +...........................XXXXXXXXXXXXXXXXXXXXXXXXX............................ +..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................. +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXX..................................... +................XXXXXXXXXXXXXXXXXXXXXXXXX....................................... +................XXXXXXXXXXXXXXXXXXXXXXXX........................................ +................XXXXXXXXXXXXXXXXXXXXXX.......................................... +.................XXXXXXXXXXXXXXXXXX............................................. +.................XXXXXXXXXXXXXXXX............................................... +..................XXXXXXXXXXXXX................................................. +....................XXXXXXXX.................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteEuclidean(1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.3), + parseMatrix(reference))); + } + + { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.......................................X........................................ +......................................XXX....................................... +.....................................XXXXXX..................................... +....................................XXXXXXXX.................................... +....................................XXXXXXXXXX.................................. +...................................XXXXXXXXXXXX................................. +..................................XXXXXXXXXXXXXX................................ +.................................XXXXXXXXXXXXXXXXX.............................. +................................XXXXXXXXXXXXXXXXXXX............................. +...............................XXXXXXXXXXXXXXXXXXXXXX........................... +..............................XXXXXXXXXXXXXXXXXXXXXXXX.......................... +............................XXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................ +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXX............................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXX................................. +.....................XXXXXXXXXXXXXXXXXXXXXXXXX.................................. +......................XXXXXXXXXXXXXXXXXXXXXXX................................... +......................XXXXXXXXXXXXXXXXXXXXX..................................... +......................XXXXXXXXXXXXXXXXXXXX...................................... +......................XXXXXXXXXXXXXXXXXXX....................................... +.......................XXXXXXXXXXXXXXXX......................................... +.......................XXXXXXXXXXXXXXX.......................................... +.......................XXXXXXXXXXXXX............................................ +........................XXXXXXXXXX.............................................. +........................XXXXXXXXX............................................... +........................XXXXXXX................................................. +.........................XXXX................................................... +.........................XX..................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteEuclidean(-1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +.....................................X.......................................... +....................................XX.XX....................................... +....................................XXXXXXX..................................... +....................................XXXXXXXX.................................... +...................................XXXXXXXXXXX.................................. +..................................XXXXXXXXXXXXXX................................ +..................................XXXXXXXXXXXXXXXX.............................. +.................................XXXXXXXXXXXXXXXXXX............................. +................................XXXXXXXXXXXXXXXXXXXXX........................... +................................XXXXXXXXXXXXXXXXXXXXXXX......................... +...............................XXXXXXXXXXXXXXXXXXXXXXXXX........................ +..............................XXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................. +..................XXXXXXXXXXXXXXXXXXXXXXXXXXX................................... +..................XXXXXXXXXXXXXXXXXXXXXXXXX..................................... +..................XXXXXXXXXXXXXXXXXXXXXXXX...................................... +..................XXXXXXXXXXXXXXXXXXXXXX........................................ +...................XXXXXXXXXXXXXXXXXXX.......................................... +...................XXXXXXXXXXXXXXXXX............................................ +...................XXXXXXXXXXXXXXX.............................................. +...................XXXXXXXXXXXX................................................. +...................XXXXXXXXXX................................................... +.......................XXX...................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = + BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 0.1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.5), + parseMatrix(reference))); + } + + { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +...................................X............................................ +..................................XXX........................................... +..................................XXXX.......................................... +.................................XXXXXX......................................... +................................XXXXXXXX........................................ +...............................XXXXXXXXXXX...................................... +...............................XXXXXXXXXXXX..................................... +..............................XXXXXXXXXXXXXX.................................... +.............................XXXXXXXXXXXXXXXX................................... +............................XXXXXXXXXXXXXXXXXX.................................. +...........................XXXXXXXXXXXXXXXXXXXX................................. +..........................XXXXXXXXXXXXXXXXXXXXXX................................ +.........................XXXXXXXXXXXXXXXXXXXXXXXXX.............................. +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................ +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................ +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +........................XXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +........................XXXXXXXXXXXXXXXXXXXXXXXX................................ +.........................XXXXXXXXXXXXXXXXXXXXXX................................. +.........................XXXXXXXXXXXXXXXXXXXXX.................................. +..........................XXXXXXXXXXXXXXXXXX.................................... +..........................XXXXXXXXXXXXXXXXX..................................... +..........................XXXXXXXXXXXXXXX....................................... +...........................XXXXXXXXXXXX......................................... +...........................XXXXXXXXXXX.......................................... +............................XXXXXXXX............................................ +............................XXXXXX.............................................. +.............................XXX................................................ +.............................X.................................................. +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = + BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), -0.1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + { + std::string reference = R"X( +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::Infinite(); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance), + parseMatrix(reference))); + } + + { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +...............................XX............................................... +...............................XXX.............................................. +...............................XXXXX............................................ +..............................XXXXXXX........................................... +..............................XXXXXXXXX......................................... +.............................XXXXXXXXXXX........................................ +.............................XXXXXXXXXXXXX...................................... +............................XXXXXXXXXXXXXXXX.................................... +............................XXXXXXXXXXXXXXXXX................................... +...........................XXXXXXXXXXXXXXXXXXXX................................. +..........................XXXXXXXXXXXXXXXXXXXXXX................................ +..........................XXXXXXXXXXXXXXXXXXXXXXXX.............................. +.........................XXXXXXXXXXXXXXXXXXXXXXXXXX............................. +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +.......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................ +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................ +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................. +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXX..................................... +...............XXXXXXXXXXXXXXXXXXXXXXXXXX....................................... +...............XXXXXXXXXXXXXXXXXXXXXXXX......................................... +................XXXXXXXXXXXXXXXXXXXXX........................................... +................XXXXXXXXXXXXXXXXXXX............................................. +................XXXXXXXXXXXXXXXXX............................................... +................XXXXXXXXXXXXXXX................................................. +.................XXXXXXXXXXX.................................................... +.................XXXXXXXXX...................................................... +.................XXXXXX......................................................... +.................XXX............................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteBound(0.8, 0.05); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.2), + parseMatrix(reference))); + } + + { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +............................XX.................................................. +............................XXXX................................................ +...........................XXXXXX............................................... +...........................XXXXXXXX............................................. +..........................XXXXXXXXXX............................................ +..........................XXXXXXXXXXX........................................... +.........................XXXXXXXXXXXXXX......................................... +.........................XXXXXXXXXXXXXXX........................................ +........................XXXXXXXXXXXXXXXXXX...................................... +.......................XXXXXXXXXXXXXXXXXXXX..................................... +.......................XXXXXXXXXXXXXXXXXXXXX.................................... +......................XXXXXXXXXXXXXXXXXXXXXXXX.................................. +.....................XXXXXXXXXXXXXXXXXXXXXXXXXX................................. +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................ +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +.........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.... +...........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +.............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... +................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................ +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................... +...................XXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................ +...................XXXXXXXXXXXXXXXXXXXXXXXXXXX.................................. +...................XXXXXXXXXXXXXXXXXXXXXXXXX.................................... +....................XXXXXXXXXXXXXXXXXXXXXXX..................................... +....................XXXXXXXXXXXXXXXXXXXXX....................................... +....................XXXXXXXXXXXXXXXXXXX......................................... +....................XXXXXXXXXXXXXXXXX........................................... +.....................XXXXXXXXXXXXXX............................................. +.....................XXXXXXXXXXX................................................ +.....................XXXXXXXXX.................................................. +......................XXXXXX.................................................... +......................XXX....................................................... +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteBound(1, 0); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.15), + parseMatrix(reference))); + } + + { + std::string reference = R"X( +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +......................................X......................................... +......................................XXX....................................... +.....................................XXXXXX..................................... +.....................................XXXXXXX.................................... +....................................XXXXXXXXXX.................................. +....................................XXXXXXXXXXXX................................ +...................................XXXXXXXXXXXXXX............................... +...................................XXXXXXXXXXXXXXXX............................. +..................................XXXXXXXXXXXXXXXXXXX........................... +..................................XXXXXXXXXXXXXXXXXXXXX......................... +.................................XXXXXXXXXXXXXXXXXXXXXXX........................ +................................XXXXXXXXXXXXXXXXXXXXXXXXXX...................... +................................XXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +...............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +..............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +.............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +.............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +............................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +...........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +.........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +......................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..... +.....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...... +....................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +..................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....... +.................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........ +...............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +..............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......... +............XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......... +..........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +........XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............ +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. +...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............. +...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............... +...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................ +...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................. +...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................. +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................... +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................ +....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................... +.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................... +.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................... +.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................. +.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.............................. +.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................... +.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................................. +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................. +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................................... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................................... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................................... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX......................................... +......XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.......................................... +.......XXXXXXXXXXXXXXXXXXXXXXXXXXXXX............................................ +.......XXXXXXXXXXXXXXXXXXXXXXXXXXX.............................................. +.......XXXXXXXXXXXXXXXXXXXXXXXXX................................................ +.......XXXXXXXXXXXXXXXXXXXXXXX.................................................. +.......XXXXXXXXXXXXXXXXXXXX..................................................... +.......XXXXXXXXXXXXXXXXXX....................................................... +........XXXXXXXXXXXXXX.......................................................... +........XXXXXXXXXXXX............................................................ +........XXXXXXXXX............................................................... +........XXXXXX.................................................................. +........XX...................................................................... +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ +................................................................................ + )X"; + + BoundaryTolerance tolerance = BoundaryTolerance::AbsoluteBound(0, 0.1); + BOOST_CHECK(checkMatrices(makeTestMatrix(*surface, tolerance, 0.15), + parseMatrix(reference))); + } +} + +BOOST_AUTO_TEST_SUITE_END() +} // namespace Acts::Test diff --git a/Tests/UnitTests/Core/Surfaces/CMakeLists.txt b/Tests/UnitTests/Core/Surfaces/CMakeLists.txt index 906967dd54d..47037b14126 100644 --- a/Tests/UnitTests/Core/Surfaces/CMakeLists.txt +++ b/Tests/UnitTests/Core/Surfaces/CMakeLists.txt @@ -28,3 +28,4 @@ add_unittest(TrapezoidBounds TrapezoidBoundsTests.cpp) add_unittest(VerticesHelper VerticesHelperTests.cpp) add_unittest(AlignmentHelper AlignmentHelperTests.cpp) add_unittest(PolyhedronSurfacesTests PolyhedronSurfacesTests.cpp) +add_unittest(BoundsRegression BoundsRegressionTests.cpp)