net.talvi.puffinplot.data
Class Eigens

java.lang.Object
  extended by net.talvi.puffinplot.data.Eigens

public class Eigens
extends java.lang.Object

A class to calculate and store the eigenvalues and eigenvectors of a matrix. It can also construct an orientation matrix from a supplied collection of vectors and perform eigen analysis on that matrix.


Constructor Summary
Eigens(Matrix matrix)
          Create an object holding the eigenvectors and eigenvalues of the supplied matrix.
 
Method Summary
static Eigens fromVectors(java.util.Collection<Vec3> vectors, boolean normalize)
          Create an orientation tensor from the supplied vectors, then return the results of eigen analysis upon the constructed matrix.
 double getMad1()
           
 double getMad3()
           
 java.util.List<java.lang.Double> getValues()
          Returns the eigenvalues in decreasing order.
 java.util.List<Vec3> getVectors()
          Returns the eigenvectors in order of decreasing eigenvalue.
 Matrix toMatrix()
          Returns a matrix of the eigenvectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Eigens

public Eigens(Matrix matrix)
Create an object holding the eigenvectors and eigenvalues of the supplied matrix. They will be sorted in descending order of eigenvalue.

Parameters:
matrix - the matrix on which to perform eigen analysis
Method Detail

fromVectors

public static Eigens fromVectors(java.util.Collection<Vec3> vectors,
                                 boolean normalize)
Create an orientation tensor from the supplied vectors, then return the results of eigen analysis upon the constructed matrix.

Parameters:
vectors - a collection of three-dimensional vectors
normalize - true to normalize the vectors before analysis
Returns:
the eigenvectors and eigenvalues of the orientation tensor

toMatrix

public Matrix toMatrix()
Returns a matrix of the eigenvectors.

Returns:
a matrix of the eigenvectors

getVectors

public java.util.List<Vec3> getVectors()
Returns the eigenvectors in order of decreasing eigenvalue.

Returns:
the eigenvectors in order of decreasing eigenvalue

getValues

public java.util.List<java.lang.Double> getValues()
Returns the eigenvalues in decreasing order.

Returns:
the eigenvalues in decreasing order

getMad1

public double getMad1()

getMad3

public double getMad3()