autoIndices static method

List<int> autoIndices(
  1. List<double> data,
  2. int threshold, {
  3. SamplingStrategy? forceStrategy,
})

Auto-selects strategy and returns sampled indices.

Implementation

static List<int> autoIndices(
  List<double> data,
  int threshold, {
  SamplingStrategy? forceStrategy,
}) {
  final finiteView = _finiteDoubleView(data);
  if (finiteView != null) {
    final indices = _autoIndicesFinite(
      finiteView.values,
      threshold,
      forceStrategy: forceStrategy,
    );
    return [for (final i in indices) finiteView.sourceIndices[i]];
  }
  return _autoIndicesFinite(data, threshold, forceStrategy: forceStrategy);
}