# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.algebra.linear.matrix.doubles.factorization.eigen

## Class CharacteristicPolynomial

• java.lang.Object
• com.numericalmethod.suanshu.algebra.linear.matrix.doubles.factorization.eigen.CharacteristicPolynomial
• All Implemented Interfaces:
Spectrum

public class CharacteristicPolynomial
extends Object
implements Spectrum
The characteristic polynomial of a square matrix is the function

p(λ) = det(A - λI)

The zeros of this polynomial are the eigenvalues of A. That is, λ being an eigenvalue of A is equivalent to stating that the system of linear equations

(A - λI) v = 0

where I is an identity matrix, has a non-zero solution v (namely an eigenvector).

The Cayley-Hamilton theorem states that every square matrix satisfies its own characteristic polynomial, that is, p(A) = 0 .

• ### Constructor Summary

Constructors
Constructor and Description
CharacteristicPolynomial(Matrix A)
Construct the characteristic polynomial for a square matrix.
• ### Method Summary

All Methods
Modifier and Type Method and Description
Polynomial getCharacteristicPolynomial()
Get the characteristic polynomial.
List<Number> getEigenvalues()
Get all the eigenvalues.
String toString()
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Constructor Detail

• #### CharacteristicPolynomial

public CharacteristicPolynomial(Matrix A)
Construct the characteristic polynomial for a square matrix.
Parameters:
A - a square matrix
Throws:
IllegalArgumentException - if A is not square
• ### Method Detail

• #### getCharacteristicPolynomial

public Polynomial getCharacteristicPolynomial()
Get the characteristic polynomial.
Returns:
the characteristic polynomial
• #### getEigenvalues

public List<Number> getEigenvalues()
Description copied from interface: Spectrum
Get all the eigenvalues.
Specified by:
getEigenvalues in interface Spectrum
Returns:
the eigenvalues
• #### toString

public String toString()
Overrides:
toString in class Object