Class EigenPair

  • All Implemented Interfaces:
    java.lang.Comparable<EigenPair>

    public class EigenPair
    extends java.lang.Object
    implements java.lang.Comparable<EigenPair>
    Helper class which encapsulates an eigenvector and its corresponding eigenvalue. This class is used to sort eigenpairs.
    Since:
    0.1
    Author:
    Elke Achtert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double eigenvalue
      The corresponding eigenvalue.
      private double[] eigenvector
      The eigenvector as a matrix.
    • Constructor Summary

      Constructors 
      Constructor Description
      EigenPair​(double[] eigenvector, double eigenvalue)
      Creates a new EigenPair object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(EigenPair o)
      Compares this object with the specified object for order.
      double getEigenvalue()
      Returns the eigenvalue.
      double[] getEigenvector()
      Returns the eigenvector.
      java.lang.String toString()
      Returns a string representation of this EigenPair.
      • Methods inherited from class java.lang.Object

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

      • eigenvector

        private double[] eigenvector
        The eigenvector as a matrix.
      • eigenvalue

        private double eigenvalue
        The corresponding eigenvalue.
    • Constructor Detail

      • EigenPair

        public EigenPair​(double[] eigenvector,
                         double eigenvalue)
        Creates a new EigenPair object.
        Parameters:
        eigenvector - the eigenvector as a matrix
        eigenvalue - the corresponding eigenvalue
    • Method Detail

      • compareTo

        public int compareTo​(EigenPair o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object's eigenvalue is greater than, equal to, or less than the specified object's eigenvalue.
        Specified by:
        compareTo in interface java.lang.Comparable<EigenPair>
        Parameters:
        o - the Eigenvector to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object's eigenvalue is greater than, equal to, or less than the specified object's eigenvalue.
      • getEigenvector

        public double[] getEigenvector()
        Returns the eigenvector.
        Returns:
        the eigenvector
      • getEigenvalue

        public double getEigenvalue()
        Returns the eigenvalue.
        Returns:
        the eigenvalue
      • toString

        public java.lang.String toString()
        Returns a string representation of this EigenPair.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this EigenPair