Package elki.math.linearalgebra.pca
Class EigenPair
- java.lang.Object
-
- elki.math.linearalgebra.pca.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.
-
-
-
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 interfacejava.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 classjava.lang.Object
- Returns:
- a string representation of this EigenPair
-
-