Interface QMatrix

  • All Known Implementing Classes:
    CachedQMatrix, Kernel, R2_Qq, SVC_Q, SVR_Q

    public interface QMatrix
    API to get kernel similarity values.
    Since:
    0.8.0
    Author:
    Erich Schubert
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void get_Q​(int column, int len, float[] out)
      Get a column of the matrix.
      double[] get_QD()
      Get the diagonal values, as reference.
      void initialize()
      Initialize the Q Matrix.
      double similarity​(int i, int j)
      (Slow) compute the similarity (not distance) of objects i and j.
      void swap_index​(int i, int j)
      Reorganize the data by swapping two entries.
    • Method Detail

      • get_Q

        default void get_Q​(int column,
                           int len,
                           float[] out)
        Get a column of the matrix.
        Parameters:
        column - Column number
        len - Number of entries to get
        out - Output array for similarity values
      • get_QD

        double[] get_QD()
        Get the diagonal values, as reference.
        Returns:
        Diagonal values
      • swap_index

        void swap_index​(int i,
                        int j)
        Reorganize the data by swapping two entries.

        This also must modify the QD array!

        Parameters:
        i - First entry
        j - Second entry
      • similarity

        double similarity​(int i,
                          int j)
        (Slow) compute the similarity (not distance) of objects i and j.

        If you need many, use get_Q(int, int, float[]) instead.

        Parameters:
        i - First object
        j - Second object
        Returns:
        Similarity
      • initialize

        void initialize()
        Initialize the Q Matrix.