fix sampleset -> pointset sorting sideeffects

This commit is contained in:
Vyacheslav Matyukhin 2022-09-13 03:55:59 +04:00
parent 7d6ffecc4a
commit 1b714f0633
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -62,6 +62,7 @@ let toPointSetDist = (
~samplingInputs: SamplingInputs.samplingInputs,
(),
): Internals.Types.outputs => {
let samples = Js.Array2.copy(samples)
Array.fast_sort(compare, samples)
let minDiscreteToKeep = MagicNumbers.ToPointSet.minDiscreteToKeep(samples)
let (continuousPart, discretePart) = E.A.Floats.Sorted.splitContinuousAndDiscreteForMinWeight(