mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 18:45:43 +00:00
Refactor changes to CombinedVectorDifferentFromNext.h
This commit is contained in:
parent
7ff30cb0c4
commit
84022a02eb
@ -97,17 +97,12 @@ public:
|
||||
|
||||
VTKM_EXEC_CONT vtkm::Id operator()(vtkm::Id i) const
|
||||
{
|
||||
// When performing an exclusive scan we need to run 1 element extra. But that doesn't matter so just return 0
|
||||
if (i >= this->OverallSortOrderPortal.GetNumberOfValues() - 1)
|
||||
{
|
||||
return vtkm::Id{ 0 };
|
||||
}
|
||||
else
|
||||
{
|
||||
vtkm::Id currGlobalIdx = this->GetGlobalMeshIndex(this->OverallSortOrderPortal.Get(i));
|
||||
vtkm::Id nextGlobalIdx = this->GetGlobalMeshIndex(this->OverallSortOrderPortal.Get(i + 1));
|
||||
return (currGlobalIdx != nextGlobalIdx) ? 1 : 0;
|
||||
}
|
||||
vtkm::Id currGlobalIdx = this->GetGlobalMeshIndex(this->OverallSortOrderPortal.Get(i));
|
||||
// When performing an exclusive scan we need to run 1 element extra. But that doesn't
|
||||
// matter so just return 0. Emulate this effect by implictly duplicating the last element
|
||||
vtkm::Id nextI = (i < this->OverallSortOrderPortal.GetNumberOfValues() - 1) ? i + 1 : i;
|
||||
vtkm::Id nextGlobalIdx = this->GetGlobalMeshIndex(this->OverallSortOrderPortal.Get(nextI));
|
||||
return (currGlobalIdx != nextGlobalIdx) ? 1 : 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user