Skip to content

Commit

Permalink
Clang compile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
attcs committed Mar 9, 2024
1 parent 330681f commit a0a63ac
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 44 deletions.
58 changes: 29 additions & 29 deletions adaptor.boost.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,44 +72,44 @@ namespace OrthoTree

if constexpr (DIMENSION_NO == 1)
{
return point.get<0>();
return point.template get<0>();
}
else if constexpr (DIMENSION_NO == 2)
{
switch (dimensionID)
{
case 0: return point.get<0>();
case 1: return point.get<1>();
case 0: return point.template get<0>();
case 1: return point.template get<1>();
}
}
else if constexpr (DIMENSION_NO == 3)
{
switch (dimensionID)
{
case 0: return point.get<0>();
case 1: return point.get<1>();
case 2: return point.get<2>();
case 0: return point.template get<0>();
case 1: return point.template get<1>();
case 2: return point.template get<2>();
}
}
else if constexpr (DIMENSION_NO == 4)
{
switch (dimensionID)
{
case 0: return point.get<0>();
case 1: return point.get<1>();
case 2: return point.get<2>();
case 3: return point.get<3>();
case 0: return point.template get<0>();
case 1: return point.template get<1>();
case 2: return point.template get<2>();
case 3: return point.template get<3>();
}
}
else
{
switch (dimensionID)
{
case 0: return point.get<0>();
case 1: return point.get<1>();
case 2: return point.get<2>();
case 3: return point.get<3>();
case 4: return point.get<4>();
case 0: return point.template get<0>();
case 1: return point.template get<1>();
case 2: return point.template get<2>();
case 3: return point.template get<3>();
case 4: return point.template get<4>();
}
}

Expand All @@ -130,38 +130,38 @@ namespace OrthoTree
{
switch (dimensionID)
{
case 0: point.set<0>(value); return;
case 1: point.set<1>(value); return;
case 0: point.template set<0>(value); return;
case 1: point.template set<1>(value); return;
}
}
else if constexpr (DIMENSION_NO == 3)
{
switch (dimensionID)
{
case 0: point.set<0>(value); return;
case 1: point.set<1>(value); return;
case 2: point.set<2>(value); return;
case 0: point.template set<0>(value); return;
case 1: point.template set<1>(value); return;
case 2: point.template set<2>(value); return;
}
}
else if constexpr (DIMENSION_NO == 4)
{
switch (dimensionID)
{
case 0: point.set<0>(value); return;
case 1: point.set<1>(value); return;
case 2: point.set<2>(value); return;
case 3: point.set<3>(value); return;
case 0: point.template set<0>(value); return;
case 1: point.template set<1>(value); return;
case 2: point.template set<2>(value); return;
case 3: point.template set<3>(value); return;
}
}
else
{
switch (dimensionID)
{
case 0: point.set<0>(value); return;
case 1: point.set<1>(value); return;
case 2: point.set<2>(value); return;
case 3: point.set<3>(value); return;
case 4: point.set<4>(value); return;
case 0: point.template set<0>(value); return;
case 1: point.template set<1>(value); return;
case 2: point.template set<2>(value); return;
case 3: point.template set<3>(value); return;
case 4: point.template set<4>(value); return;
}
}

Expand Down
2 changes: 1 addition & 1 deletion adaptortests/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#pragma once

#include "gtest/gtest.h"
#include <gtest/gtest.h>

#include <span>
#include <vector>
15 changes: 2 additions & 13 deletions adaptortests/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,7 @@ namespace
using namespace OrthoTree;
auto constexpr DIMENSION_NO = 3;

using AD = typename TOrthoTreeA::AD;
using GeometryA = typename TOrthoTreeA::TGeometry;
using VectorA = typename TOrthoTreeA::TVector;
using BoxA = typename TOrthoTreeA::TBox;
using RayA = typename TOrthoTreeA::TRay;
using PlaneA = typename TOrthoTreeA::TPlane;

using Vector = VectorND<DIMENSION_NO, GeometryA>;
using Box = BoundingBoxND<DIMENSION_NO, GeometryA>;
Expand Down Expand Up @@ -343,7 +338,7 @@ namespace
auto const pointsInFrustumExpected = std::vector<std::size_t>{ 2, 3, 4, 6, 7 };

tree.Insert(pointNo - 1, points.back());
tree.Erase<false>(0, points[0]);
tree.template Erase<false>(0, points[0]);
auto const entityIDsInDFS_AfterErase_Actual = tree.CollectAllIdInDFS();
auto const entityIDsInDFS_AfterErase_Expected = std::vector<std::size_t>{ 1, 8, 9, 10, 7, 6, 5, 2, 3, 4 };

Expand Down Expand Up @@ -395,19 +390,13 @@ namespace
using namespace OrthoTree;
auto constexpr DIMENSION_NO = 2;

using AD = typename TOrthoTreeA::AD;
using GeometryA = typename TOrthoTreeA::TGeometry;
using VectorA = typename TOrthoTreeA::TVector;
using BoxA = typename TOrthoTreeA::TBox;
using RayA = typename TOrthoTreeA::TRay;
using PlaneA = typename TOrthoTreeA::TPlane;

using Vector = VectorND<DIMENSION_NO, GeometryA>;
using Box = BoundingBoxND<DIMENSION_NO, GeometryA>;
using Ray = RayND<DIMENSION_NO, GeometryA>;
using Plane = PlaneND<DIMENSION_NO, GeometryA>;

auto const sqrt3Reciproc = GeometryA(1.0 / sqrt(3.0));
auto const sqrt2 = GeometryA(sqrt(2.0));
auto const sqrt2Reciproc = GeometryA(1.0 / sqrt2);

Expand Down Expand Up @@ -476,7 +465,7 @@ namespace

// Overlapping Boxes with the range
constexpr bool shouldFullyContain = false; // overlap is enough
auto const overlappingBoxIDsActual = quadtree.RangeSearch<shouldFullyContain>(searchBox); //: { 1, 2, 3, 4 }
auto const overlappingBoxIDsActual = quadtree.template RangeSearch<shouldFullyContain>(searchBox); //: { 1, 2, 3, 4 }
auto const overlappingBoxIDsExpected = std::vector<std::size_t>{ 1, 2, 3, 4 };

auto const pickedIDsActual = quadtree.PickSearch(pickPoint); //: { 2, 4 }
Expand Down
1 change: 0 additions & 1 deletion unittests/compile_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ void testCompilePointC()
template<OrthoTree::dim_t N, typename execution_policy_type, uint32_t nSplitStrategyAdditionalDepth = 2>
void testCompileBoxC()
{
using Vector = OrthoTree::VectorND<N>;
using BoundingBox = OrthoTree::BoundingBoxND<N>;
using Plane = OrthoTree::PlaneND<N>;
using OT = OrthoTree::TreeBoxContainerND<N, nSplitStrategyAdditionalDepth>;
Expand Down

0 comments on commit a0a63ac

Please sign in to comment.