Class KMeansPlusPlus.Instance<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long diststat
      Count the number of distance computations.
      protected elki.database.ids.DBIDs ids
      Object IDs
      protected java.util.Random random
      Random generator
      protected elki.database.datastore.WritableDoubleDataStore weights
      Weights
    • Constructor Summary

      Constructors 
      Constructor Description
      Instance​(elki.database.ids.DBIDs ids, elki.utilities.random.RandomFactory rnd)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract double distance​(T a, elki.database.ids.DBIDRef b)
      Compute the distance of two objects.
      protected double initialWeights​(T first)
      Initialize the weight list.
      protected double nextDouble​(double weightsum)  
      protected double updateWeights​(T latest)
      Update the weight list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ids

        protected elki.database.ids.DBIDs ids
        Object IDs
      • weights

        protected elki.database.datastore.WritableDoubleDataStore weights
        Weights
      • diststat

        protected long diststat
        Count the number of distance computations.
      • random

        protected java.util.Random random
        Random generator
    • Constructor Detail

      • Instance

        public Instance​(elki.database.ids.DBIDs ids,
                        elki.utilities.random.RandomFactory rnd)
        Constructor.
        Parameters:
        ids - IDs to process
        rnd - Random generator
    • Method Detail

      • distance

        protected abstract double distance​(T a,
                                           elki.database.ids.DBIDRef b)
        Compute the distance of two objects.
        Parameters:
        a - First object
        b - Second object
        Returns:
        Distance
      • initialWeights

        protected double initialWeights​(T first)
        Initialize the weight list.
        Parameters:
        first - Added ID
        Returns:
        Weight sum
      • updateWeights

        protected double updateWeights​(T latest)
        Update the weight list.
        Parameters:
        latest - Added ID
        Returns:
        Weight sum
      • nextDouble

        protected double nextDouble​(double weightsum)