nthIndices static method

List<int> nthIndices(
  1. List<double> data,
  2. int threshold
)

Returns sampled indices for Nth-point strategy.

Implementation

static List<int> nthIndices(List<double> data, int threshold) {
  final finiteView = _finiteDoubleView(data);
  if (finiteView != null) {
    final indices = _nthIndicesFinite(finiteView.values, threshold);
    return [for (final i in indices) finiteView.sourceIndices[i]];
  }
  return _nthIndicesFinite(data, threshold);
}