-
Notifications
You must be signed in to change notification settings - Fork 11
COMP: Fix MSVC template warnings #1474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
imikejackson
wants to merge
1
commit into
BlueQuartzSoftware:develop
Choose a base branch
from
imikejackson:topic/fix_misc_template_warnings
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+69
−32
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
|
|
||
| Statistics (Morphological) | ||
|
|
||
| ## Warning | ||
| ## Caveats | ||
|
|
||
| This filter has two caveats. | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -526,12 +526,12 @@ class MedianByFeatureRangeImpl | |
| { | ||
| } | ||
|
|
||
| void compute(usize start, usize end) const | ||
| void compute(size_t start, size_t end) const | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| { | ||
| m_MessageHelper.sendMessage(fmt::format("Starting Median Array Calculation: Feature/Ensemble [{}-{}]", start, end)); | ||
|
|
||
| const usize numTuples = m_Source.getNumberOfTuples(); | ||
| for(usize featureId = start; featureId < end; featureId++) | ||
| for(size_t featureId = start; featureId < end; featureId++) | ||
| { | ||
| const usize truePosition = std::distance(m_FeatureIdsMap.begin(), std::find(m_FeatureIdsMap.begin(), m_FeatureIdsMap.end(), featureId)); | ||
| std::set<int32> valuesSet = {}; | ||
|
|
@@ -542,11 +542,11 @@ class MedianByFeatureRangeImpl | |
| { | ||
| if(m_FindMedian) | ||
| { | ||
| values.push_back(m_Source[i]); | ||
| values.push_back(static_cast<float>(m_Source[i])); | ||
| } | ||
| if(m_FindNumUniqueValues) | ||
| { | ||
| valuesSet.emplace(m_Source[i]); | ||
| valuesSet.emplace(static_cast<int32>(m_Source[i])); | ||
| } | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -144,7 +144,14 @@ class ComputeBaseStatsImpl | |
| count++; | ||
| minValue = std::min(minValue, value); | ||
| maxValue = std::max(maxValue, value); | ||
| summationValue += value; | ||
| if constexpr(std::is_same_v<T, bool>) | ||
| { | ||
| summationValue = value == true ? true : false; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same as |
||
| } | ||
| else | ||
| { | ||
| summationValue += value; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -372,7 +379,14 @@ class ComputeBasicAndFrequencyStatsImpl | |
| count++; | ||
| minValue = std::min(minValue, value); | ||
| maxValue = std::max(maxValue, value); | ||
| summationValue += value; | ||
| if constexpr(std::is_same_v<T, bool>) | ||
| { | ||
| summationValue = value == true ? true : false; | ||
| } | ||
| else | ||
| { | ||
| summationValue += value; | ||
| } | ||
|
|
||
| // modes | ||
| frequencyMap[value]++; | ||
|
|
@@ -490,7 +504,15 @@ class ComputeStdDevImpl | |
|
|
||
| // We are working with primitives here for their trivially copyable nature, this lets us cut accesses to output vector | ||
| float64 sumOfDiffs = 0.0f; | ||
| float32 meanValue = m_StatsVector[targetBoundsIndex].summationValue / static_cast<float32>(m_StatsVector[targetBoundsIndex].count); | ||
| float32 meanValue = 0.0f; | ||
| if constexpr(std::is_same_v<T, bool>) | ||
| { | ||
| meanValue = (m_StatsVector[targetBoundsIndex].summationValue ? 1.0f : 0.0f) / static_cast<float32>(m_StatsVector[targetBoundsIndex].count); | ||
| } | ||
| else | ||
| { | ||
| meanValue = m_StatsVector[targetBoundsIndex].summationValue / static_cast<float32>(m_StatsVector[targetBoundsIndex].count); | ||
| } | ||
|
|
||
| usize zStride = 0, yStride = 0; | ||
| for(usize zIndex = voxelIndices[k_MinZIndex]; zIndex < voxelIndices[k_MaxZIndex]; zIndex++) | ||
|
|
@@ -630,7 +652,8 @@ Result<> FillStatsArrays(const std::vector<StatsCacheT>& statsVector, DataStruct | |
| float32 meanValue = 0.0f; | ||
| if constexpr(std::is_same_v<T, bool>) | ||
| { | ||
| meanValue = static_cast<float32>(statsVector[i].summationValue >= (statsVector.size() - statsVector[i].summationValue)); | ||
| usize sumValue = statsVector[i].summationValue == true ? 1ULL : 0ULL; | ||
| meanValue = static_cast<float32>(sumValue >= (statsVector.size() - sumValue)); | ||
| } | ||
| else | ||
| { | ||
|
|
@@ -739,8 +762,6 @@ Result<> ComputeBoundingBoxStats::operator()() | |
| { | ||
| return ExecuteNeighborFunction(ExecuteBoundsStatsCalculations<true>{}, inputArray.getDataType(), m_DataStructure, m_InputValues, geom, unifiedArray, inputArray); | ||
| } | ||
| else | ||
| { | ||
| return ExecuteDataFunction(ExecuteBoundsStatsCalculations<false>{}, inputArray.getDataType(), m_DataStructure, m_InputValues, geom, unifiedArray, inputArray); | ||
| } | ||
|
|
||
| return ExecuteDataFunction(ExecuteBoundsStatsCalculations<false>{}, inputArray.getDataType(), m_DataStructure, m_InputValues, geom, unifiedArray, inputArray); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here
k_180OverPiFgets promoted tofloat64due towso I think keeping it ask_180OverPiDis ok.