Skip to content

Commit

Permalink
COMP: Fix warning in PointSetToPointSetMetricv4
Browse files Browse the repository at this point in the history
change index type to SizeValueType in functor for ParallelizeArray
also change start/end index type to SizeValueType.
  • Loading branch information
dyollb committed May 13, 2020
1 parent a10f19e commit cf50566
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ PointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInternalComputation

PointIdentifierRanges ranges = this->CreateRanges();
std::vector<CompensatedSummation<MeasureType>> threadValues(ranges.size());
std::function<void(unsigned int)> sumNeighborhoodValues =
[this, &threadValues, &ranges, &virtualTransformedPointSet, &fixedTransformedPointSet](unsigned int rangeIndex) {
std::function<void(SizeValueType)> sumNeighborhoodValues =
[this, &threadValues, &ranges, &virtualTransformedPointSet, &fixedTransformedPointSet](SizeValueType rangeIndex) {
CompensatedSummation<MeasureType> threadValue = 0;
PixelType pixel;
NumericTraits<PixelType>::SetLength(pixel, 1);
Expand All @@ -210,7 +210,7 @@ PointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInternalComputation

// Sum per thread
MultiThreaderBase::New()->ParallelizeArray(
(PointIdentifier)0, (PointIdentifier)ranges.size(), sumNeighborhoodValues, nullptr);
(SizeValueType)0, (SizeValueType)ranges.size(), sumNeighborhoodValues, nullptr);
// Join sums
CompensatedSummation<MeasureType> value = 0;
for (unsigned int i = 0; i < threadValues.size(); i++)
Expand Down Expand Up @@ -281,9 +281,9 @@ PointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInternalComputation
std::vector<CompensatedSummation<MeasureType>> threadValues(ranges.size());
using CompensatedDerivative = typename std::vector<CompensatedSummation<ParametersValueType>>;
std::vector<CompensatedDerivative> threadDerivatives(ranges.size());
std::function<void(unsigned int)> sumNeighborhoodValues =
std::function<void(SizeValueType)> sumNeighborhoodValues =
[this, &derivative, &threadDerivatives, &threadValues, &ranges, &calculateValue, &numberOfLocalParameters](
unsigned int rangeIndex) {
SizeValueType rangeIndex) {
// Use STL container to make sure no unesecarry checks are performed
using FixedTransformedVectorContainer = typename FixedPointsContainer::STLContainerType;
using VirtualPointsContainer = typename VirtualPointSetType::PointsContainer;
Expand Down Expand Up @@ -386,7 +386,7 @@ PointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet, TInternalComputation

// Sum per thread
MultiThreaderBase::New()->ParallelizeArray(
(PointIdentifier)0, (PointIdentifier)ranges.size(), sumNeighborhoodValues, nullptr);
(SizeValueType)0, (SizeValueType)ranges.size(), sumNeighborhoodValues, nullptr);

// Sum thread results
CompensatedSummation<MeasureType> value = 0;
Expand Down

0 comments on commit cf50566

Please sign in to comment.