Package elki.svm.data

Class SimilarityQueryAdapter

  • All Implemented Interfaces:
    DataSet

    public class SimilarityQueryAdapter
    extends java.lang.Object
    implements DataSet
    Use a relation as data set
    Since:
    0.8.0
    Author:
    Erich Schubert
    • Constructor Detail

    • Method Detail

      • size

        public int size()
        Description copied from interface: DataSet
        Size of data set.
        Specified by:
        size in interface DataSet
        Returns:
        Data set size.
      • 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
      • 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