Skip to content

Commit

Permalink
more template keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
nyoungbq committed Aug 20, 2024
1 parent c982c56 commit 87fa2bb
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GenerateHistogramFromData

void operator()() const
{
const auto& inputStore = m_InputArray.getIDataStoreRefAs<AbstractDataStore<Type>>();
const auto& inputStore = m_InputArray.template getIDataStoreRefAs<AbstractDataStore<Type>>();
auto end = inputStore.getSize();

// tuple visualization: Histogram = {(bin maximum, count), (bin maximum, count), ... }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class ComputeKMeansTemplate
ComputeKMeansTemplate(ComputeKMeans* filter, const IDataArray* inputIDataArray, IDataArray* meansIDataArray, const std::unique_ptr<MaskCompare>& maskDataArray, usize numClusters,
Int32AbstractDataStore& fIds, ClusterUtilities::DistanceMetric distMetric, std::mt19937_64::result_type seed)
: m_Filter(filter)
, m_InputArray(inputIDataArray->getIDataStoreRefAs<AbstractDataStoreT>())
, m_Means(meansIDataArray->getIDataStoreRefAs<AbstractDataStoreT>())
, m_InputArray(inputIDataArray->template getIDataStoreRefAs<AbstractDataStoreT>())
, m_Means(meansIDataArray->template getIDataStoreRefAs<AbstractDataStoreT>())
, m_Mask(maskDataArray)
, m_NumClusters(numClusters)
, m_FeatureIds(fIds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,22 +306,22 @@ struct DBSCANFunctor
{
if(useRandom)
{
DBSCANTemplate<T, true, true>(filter, inputIDataArray.getIDataStoreRefAs<AbstractDataStore<T>>(), maskCompare, fIds.getDataStoreRef(), epsilon, minPoints, distMetric, seed)();
DBSCANTemplate<T, true, true>(filter, inputIDataArray.template getIDataStoreRefAs<AbstractDataStore<T>>(), maskCompare, fIds.getDataStoreRef(), epsilon, minPoints, distMetric, seed)();
}
else
{
DBSCANTemplate<T, true, false>(filter, inputIDataArray.getIDataStoreRefAs<AbstractDataStore<T>>(), maskCompare, fIds.getDataStoreRef(), epsilon, minPoints, distMetric, seed)();
DBSCANTemplate<T, true, false>(filter, inputIDataArray.template getIDataStoreRefAs<AbstractDataStore<T>>(), maskCompare, fIds.getDataStoreRef(), epsilon, minPoints, distMetric, seed)();
}
}
else
{
if(useRandom)
{
DBSCANTemplate<T, false, true>(filter, inputIDataArray.getIDataStoreRefAs<AbstractDataStore<T>>(), maskCompare, fIds.getDataStoreRef(), epsilon, minPoints, distMetric, seed)();
DBSCANTemplate<T, false, true>(filter, inputIDataArray.template getIDataStoreRefAs<AbstractDataStore<T>>(), maskCompare, fIds.getDataStoreRef(), epsilon, minPoints, distMetric, seed)();
}
else
{
DBSCANTemplate<T, false, false>(filter, inputIDataArray.getIDataStoreRefAs<AbstractDataStore<T>>(), maskCompare, fIds.getDataStoreRef(), epsilon, minPoints, distMetric, seed)();
DBSCANTemplate<T, false, false>(filter, inputIDataArray.template getIDataStoreRefAs<AbstractDataStore<T>>(), maskCompare, fIds.getDataStoreRef(), epsilon, minPoints, distMetric, seed)();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct CopyDataFunctor
void operator()(const IDataArray* srcIArray, IDataArray* destIArray, const std::vector<bool>& maskArray)
{
const auto& srcArray = srcIArray->template getIDataStoreRefAs<AbstractDataStore<T>>();
auto& destArray = destIArray->getIDataStoreRefAs<AbstractDataStore<T>>();
auto& destArray = destIArray->template getIDataStoreRefAs<AbstractDataStore<T>>();

bool useMask = !maskArray.empty();
usize destTupleIdx = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct ExecuteTemplate
void operator()(const ImageGeom& imageGeom, IDataArray* inputIDataArray, int32 comparisonAlgorithm, float thresholdValue, bool loopUntilDone, const std::atomic_bool& shouldCancel,
const IFilter::MessageHandler& messageHandler)
{
const auto& inputStore = inputIDataArray->getIDataStoreRefAs<AbstractDataStore<T>>();
const auto& inputStore = inputIDataArray->template getIDataStoreRefAs<AbstractDataStore<T>>();

const size_t totalPoints = inputStore.getNumberOfTuples();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Result<> WriteAvizoRectilinearCoordinate::writeData(FILE* outputFile) const

fprintf(outputFile, "@1 # FeatureIds in z, y, x with X moving fastest, then Y, then Z\n");

const auto& featureIds = m_DataStructure.getDataAs<IDataArray>(m_InputValues->FeatureIdsArrayPath)->getIDataStoreRefAs<DataStore<int32>>();
const auto& featureIds = m_DataStructure.getDataAs<IDataArray>(m_InputValues->FeatureIdsArrayPath)->template getIDataStoreRefAs<DataStore<int32>>();
const usize totalPoints = featureIds.getNumberOfTuples();

if(m_InputValues->WriteBinaryFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Result<> WriteAvizoUniformCoordinate::writeData(FILE* outputFile) const
{
fprintf(outputFile, "@1\n");

const auto& featureIds = m_DataStructure.getDataAs<IDataArray>(m_InputValues->FeatureIdsArrayPath)->getIDataStoreRefAs<DataStore<int32>>();
const auto& featureIds = m_DataStructure.getDataAs<IDataArray>(m_InputValues->FeatureIdsArrayPath)->template getIDataStoreRefAs<DataStore<int32>>();
const usize totalPoints = featureIds.getNumberOfTuples();

if(m_InputValues->WriteBinaryFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,37 @@ class ComputeNeighborListStatisticsImpl
using DataArrayType = DataArray<T>;
using StoreType = AbstractDataStore<T>;

auto* array0 = m_Length ? m_Arrays[0]->getIDataStoreAs<AbstractDataStore<uint64>>() : nullptr;
auto* array0 = m_Length ? m_Arrays[0]->template getIDataStoreAs<AbstractDataStore<uint64>>() : nullptr;
if(m_Length && array0 == nullptr)
{
throw std::invalid_argument("ComputeNeighborListStatisticsFilter::compute() could not dynamic_cast 'Length' array to needed type. Check input array selection.");
}
auto* array1 = m_Min ? m_Arrays[1]->getIDataStoreAs<StoreType>() : nullptr;
auto* array1 = m_Min ? m_Arrays[1]->template getIDataStoreAs<StoreType>() : nullptr;
if(m_Min && array1 == nullptr)
{
throw std::invalid_argument("ComputeNeighborListStatisticsFilter::compute() could not dynamic_cast 'Min' array to needed type. Check input array selection.");
}
auto* array2 = m_Max ? m_Arrays[2]->getIDataStoreAs<StoreType>() : nullptr;
auto* array2 = m_Max ? m_Arrays[2]->template getIDataStoreAs<StoreType>() : nullptr;
if(m_Max && array2 == nullptr)
{
throw std::invalid_argument("ComputeNeighborListStatisticsFilter::compute() could not dynamic_cast 'Max' array to needed type. Check input array selection.");
}
auto* array3 = m_Mean ? m_Arrays[3]->getIDataStoreAs<AbstractDataStore<float32>>() : nullptr;
auto* array3 = m_Mean ? m_Arrays[3]->template getIDataStoreAs<AbstractDataStore<float32>>() : nullptr;
if(m_Mean && array3 == nullptr)
{
throw std::invalid_argument("ComputeNeighborListStatisticsFilter::compute() could not dynamic_cast 'Mean' array to needed type. Check input array selection.");
}
auto* array4 = m_Median ? m_Arrays[4]->getIDataStoreAs<AbstractDataStore<float32>>() : nullptr;
auto* array4 = m_Median ? m_Arrays[4]->template getIDataStoreAs<AbstractDataStore<float32>>() : nullptr;
if(m_Median && array4 == nullptr)
{
throw std::invalid_argument("ComputeNeighborListStatisticsFilter::compute() could not dynamic_cast 'Median' array to needed type. Check input array selection.");
}
auto* array5 = m_StdDeviation ? m_Arrays[5]->getIDataStoreAs<AbstractDataStore<float32>>() : nullptr;
auto* array5 = m_StdDeviation ? m_Arrays[5]->template getIDataStoreAs<AbstractDataStore<float32>>() : nullptr;
if(m_StdDeviation && array5 == nullptr)
{
throw std::invalid_argument("ComputeNeighborListStatisticsFilter::compute() could not dynamic_cast 'StdDev' array to needed type. Check input array selection.");
}
auto* array6 = m_Summation ? m_Arrays[6]->getIDataStoreAs<AbstractDataStore<float32>>() : nullptr;
auto* array6 = m_Summation ? m_Arrays[6]->template getIDataStoreAs<AbstractDataStore<float32>>() : nullptr;
if(m_Summation && array6 == nullptr)
{
throw std::invalid_argument("ComputeNeighborListStatisticsFilter::compute() could not dynamic_cast 'Summation' array to needed type. Check input array selection.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Result<> CreateFeatureArrayFromElementArrayFilter::executeImpl(DataStructure& da
usize maxValue = featureIds[featureIdsMaxIdx];
auto& cellFeatureAttrMat = dataStructure.getDataRefAs<AttributeMatrix>(pCellFeatureAttributeMatrixPathValue);

auto* createdArrayStore = createdArray->getIDataStoreAs<IDataStore>();
auto* createdArrayStore = createdArray->template getIDataStoreAs<IDataStore>();
createdArrayStore->resizeTuples(std::vector<usize>{maxValue + 1});
cellFeatureAttrMat.resizeTuples(std::vector<usize>{maxValue + 1});

Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/SimplnxCore/test/DREAM3DFileTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ TEST_CASE("DREAM3DFileTest:Import/Export DREAM3D Filter Test")
REQUIRE(importDataStructure.getData(DataPath({DataNames::k_Group1Name})) != nullptr);
auto* dataArray = importDataStructure.getDataAs<DataArray<int8>>(DataPath({DataNames::k_ArrayName}));
REQUIRE(dataArray != nullptr);
REQUIRE(dataArray->getIDataStoreAs<DataStore<int8>>() != nullptr);
REQUIRE(dataArray->template getIDataStoreAs<DataStore<int8>>() != nullptr);
}
{
auto importPipeline = CreateImportPipeline();
Expand All @@ -340,7 +340,7 @@ TEST_CASE("DREAM3DFileTest:Import/Export DREAM3D Filter Test")
REQUIRE(importDataStructure.getData(DataPath({DataNames::k_Group1Name})) != nullptr);
auto* dataArray = importDataStructure.getDataAs<DataArray<int8>>(DataPath({DataNames::k_ArrayName}));
REQUIRE(dataArray != nullptr);
REQUIRE(dataArray->getIDataStoreAs<EmptyDataStore<int8>>() != nullptr);
REQUIRE(dataArray->template getIDataStoreAs<EmptyDataStore<int8>>() != nullptr);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/simplnx/DataStructure/Geometry/INodeGeometry0D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ BoundingBox3Df INodeGeometry0D::getBoundingBox() const

try
{
auto& vertexListStore = vertexList.getIDataStoreRefAs<const DataStore<float32>>();
auto& vertexListStore = vertexList.template getIDataStoreRefAs<const DataStore<float32>>();

for(size_t tuple = 0; tuple < vertexListStore.getNumberOfTuples(); tuple++)
{
Expand Down Expand Up @@ -130,7 +130,7 @@ Result<bool> INodeGeometry0D::isPlane(usize dimensionIndex) const
try
{
const IGeometry::SharedVertexList& vertexList = getVerticesRef();
auto& vertexListStore = vertexList.getIDataStoreRefAs<const DataStore<float32>>();
auto& vertexListStore = vertexList.template getIDataStoreRefAs<const DataStore<float32>>();

std::set<float32> pointSet;
for(usize tuple = 0; tuple < vertexListStore.getNumberOfTuples(); tuple++)
Expand Down
4 changes: 2 additions & 2 deletions src/simplnx/Utilities/DataArrayUtilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,8 @@ class CopyTupleUsingIndexList

void convert(usize start, usize end) const
{
const auto& oldDataStore = m_OldCellArray.getIDataStoreRefAs<AbstractDataStore<T>>();
auto& newDataStore = m_NewCellArray.getIDataStoreRefAs<AbstractDataStore<T>>();
const auto& oldDataStore = m_OldCellArray.template getIDataStoreRefAs<AbstractDataStore<T>>();
auto& newDataStore = m_NewCellArray.template getIDataStoreRefAs<AbstractDataStore<T>>();

for(usize i = start; i < end; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions src/simplnx/Utilities/ImageRotationUtilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ class RotateImageGeometryWithNearestNeighbor
destImageGeomPtr->setSpacing(m_Params.TransformedSpacing);
destImageGeomPtr->setOrigin(m_Params.TransformedOrigin);

const auto& oldDataStore = m_SourceArray->getIDataStoreRefAs<AbstractDataStore<T>>();
auto& newDataStore = m_TargetArray->getIDataStoreRefAs<AbstractDataStore<T>>();
const auto& oldDataStore = m_SourceArray->template getIDataStoreRefAs<AbstractDataStore<T>>();
auto& newDataStore = m_TargetArray->template getIDataStoreRefAs<AbstractDataStore<T>>();

Matrix4fR inverseTransform = m_TransformationMatrix.inverse();
for(int64 k = 0; k < m_Params.zpNew; k++)
Expand Down
2 changes: 1 addition & 1 deletion src/simplnx/Utilities/Math/GeometryMath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ BoundingBox3Df nx::core::GeometryMath::FindBoundingBoxOfVertices(INodeGeometry0D
return {ll, ur}; // will be invalid
}

auto& vertexListStore = vertexList.getIDataStoreRefAs<const DataStore<float32>>();
auto& vertexListStore = vertexList.template getIDataStoreRefAs<const DataStore<float32>>();

for(size_t tuple = 0; tuple < vertexListStore.getNumberOfTuples(); tuple++)
{
Expand Down

0 comments on commit 87fa2bb

Please sign in to comment.