IvfFlatIndex constructor

IvfFlatIndex(
  1. int dim, {
  2. required int nlist,
  3. int nprobe = 1,
  4. VectorMetric defaultMetric = VectorMetric.l2sq,
  5. int seed = 1234,
  6. int niter = 25,
})

Implementation

IvfFlatIndex(
  this.dim, {
  required this.nlist,
  this.nprobe = 1,
  this.defaultMetric = VectorMetric.l2sq,
  int seed = 1234,
  int niter = 25,
})  : _quantizer = _KMeans(dim: dim, k: nlist, niter: niter, seed: seed),
      _cellVecs = List<Float32List>.generate(nlist, (_) => Float32List(0)),
      _cellIds = List<List<Object?>>.generate(nlist, (_) => <Object?>[]),
      _cellCounts = List<int>.filled(nlist, 0);