Renaming the functions is I think a reasonable solution
To be honest, I'm not sure why this function was added. If you just want to make a new array with a permuted copy of the original array (without having to apply a mask) then this should be just 2 lines of code in VTKm, i.e, call make_ArryHandlePermutation
to create a fancy version of the permuted value array followed by ArrayCopyDevice
to copy to the target.
My guess is that Mingzhe maybe didn't have the ValueType
template parameter required by the existing PermuteArray
function or wanted to avoid the extra masking step. Otherwise, the results the existing functions creates should be the same. The contour tree algorithm encodes certain properties of the calculating in the leading bits of index values as bit flags. As such, if we want to use index values that have those bit flags set (here to permute an array), then we need to remove those bit flags first by masking them in order to retrieve the real index value. If an index array does not have any bit flags set, then applying the mask is an extra step, but should otherwise have no effect on the result (unless your dataset is so large that you are exhausting the range of int64, but if that happens, then you'd run into trouble way earlier in the computation).
I.e., I think we have three options: 1) rename the functions to be more explicit about the differences, or 2) remove the new function and change the places where it used with a call to the existing method, or 3) remove the existing function and replace it with a call to make_ArryHandlePermutation
followed by ArrayCopyDevice
. In principle, I think Option 3 is probably cleanest and simplest. However, Option 1 is fine too.
If we go with Option 1, in terms of renaming, I agree with Gunther's comment, that both functions apply to arrays in general (not just value arrays) since they have the array type as a template. I would suggest the following names:
PermuteValueArray
to PermuteArrayWithRawIndex
to indicate that the index array has no bit flags, and as such the raw index values can be used to permute the array.PermuteArray
to PermuteArrayWithMaskedIndex
to indicate that the index array needs to be masked to remove bit flags before using it to permute the array.Oliver Ruebel (b44456bf) at 11 Dec 12:48
Added fixes for HierarchicalHyperSweeper for pre-simplification
... and 1 more commit
Oliver Ruebel (94f3f60a) at 11 Dec 05:38
Updated code to call presimplification
Oliver Ruebel (8466eef9) at 06 Nov 08:52
Add presimplfy threshold and dependent volume to HierarchicalAugmen...
... and 4 more commits
Oliver Ruebel (169c0f04) at 06 Nov 08:47
Add TransferToSuperarc in contourtree types
Oliver Ruebel (ab70afde) at 07 Aug 09:39
Enable setting presimplification for distributed CT app/filter
... and 2 more commits
Oliver Ruebel (b84cf10e) at 06 Mar 18:46
Log hierarchical tree stats after Fan Out
... and 44 more commits
Do: merge
Will do. Thanks!
@kmorel I synced this merge request with the current VTKm master. This merge request should be good to merge now.
Do: reformat
Oliver Ruebel (cad654f6) at 16 Jan 21:29
Remove bad import and fix warning in ContourTreeAppDataIO.h
... and 271 more commits
Oliver Ruebel (d4974a19) at 20 Sep 04:42
Fix error in ContourTreeAppDataIO
Oliver Ruebel (35735c6e) at 20 Sep 04:22
Updated contour tree distributed IO to use CellSetStructured
... and 12 more commits
Do: reformat
Oliver Ruebel (1d201ccb) at 07 Sep 08:12
Run branchDecomposition without requiring save and add timer
Oliver Ruebel (d066dda3) at 14 Mar 18:10
Fix HDF5 float data read bug
Oliver Ruebel (6a983bdd) at 07 Mar 06:22
Use Parallel HDF5 and fix axis swap bug