Package elki.svm.data

Class DoubleWeightedDataSet

  • All Implemented Interfaces:
    DataSet

    public class DoubleWeightedDataSet
    extends java.lang.Object
    implements DataSet
    This is an efficient array based data set implementation.
    Since:
    0.8.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int[] idx  
      (package private) DataSet inner  
      (package private) int size  
      (package private) double[] weight  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int v, double w)  
      int classnum​(int i)
      Get the class number of the ith element.
      void clear()  
      double similarity​(int i, int j)
      Get the ith element.
      int size()
      Size of data set.
      void swap​(int i, int j)
      Swap two elements.
      double value​(int i)
      Get the value of the ith element.
      • Methods inherited from class java.lang.Object

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

      • idx

        int[] idx
      • weight

        double[] weight
      • size

        int size
    • Constructor Detail

      • DoubleWeightedDataSet

        public DoubleWeightedDataSet​(DataSet inner,
                                     int size)
    • Method Detail

      • similarity

        public double similarity​(int i,
                                 int j)
        Description copied from interface: DataSet
        Get the ith element.
        Specified by:
        similarity in interface DataSet
        Parameters:
        i - Element offset
        j - Element offset
        Returns:
        Element
      • size

        public int size()
        Description copied from interface: DataSet
        Size of data set.
        Specified by:
        size in interface DataSet
        Returns:
        Data set size.
      • value

        public double value​(int i)
        Description copied from interface: DataSet
        Get the value of the ith element.
        Specified by:
        value in interface DataSet
        Parameters:
        i - Element offset
        Returns:
        Value
      • classnum

        public int classnum​(int i)
        Description copied from interface: DataSet
        Get the class number of the ith element.
        Specified by:
        classnum in interface DataSet
        Parameters:
        i - Element offset
        Returns:
        Class number
      • swap

        public void swap​(int i,
                         int j)
        Description copied from interface: DataSet
        Swap two elements.
        Specified by:
        swap in interface DataSet
        Parameters:
        i - First position
        j - Second position
      • add

        public void add​(int v,
                        double w)
      • clear

        public void clear()