1 | /*
|
---|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | * contributor license agreements. See the NOTICE file distributed with
|
---|
4 | * this work for additional information regarding copyright ownership.
|
---|
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | * (the "License"); you may not use this file except in compliance with
|
---|
7 | * the License. You may obtain a copy of the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | * See the License for the specific language governing permissions and
|
---|
15 | * limitations under the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | package agents.org.apache.commons.math.linear;
|
---|
19 |
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * An interface to classes that implement an algorithm to calculate the
|
---|
23 | * eigen decomposition of a real matrix.
|
---|
24 | * <p>The eigen decomposition of matrix A is a set of two matrices:
|
---|
25 | * V and D such that A = V × D × V<sup>T</sup>.
|
---|
26 | * A, V and D are all m × m matrices.</p>
|
---|
27 | * <p>This interface is similar in spirit to the <code>EigenvalueDecomposition</code>
|
---|
28 | * class from the <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a>
|
---|
29 | * library, with the following changes:</p>
|
---|
30 | * <ul>
|
---|
31 | * <li>a {@link #getVT() getVt} method has been added,</li>
|
---|
32 | * <li>two {@link #getRealEigenvalue(int) getRealEigenvalue} and {@link #getImagEigenvalue(int)
|
---|
33 | * getImagEigenvalue} methods to pick up a single eigenvalue have been added,</li>
|
---|
34 | * <li>a {@link #getEigenvector(int) getEigenvector} method to pick up a single
|
---|
35 | * eigenvector has been added,</li>
|
---|
36 | * <li>a {@link #getDeterminant() getDeterminant} method has been added.</li>
|
---|
37 | * <li>a {@link #getSolver() getSolver} method has been added.</li>
|
---|
38 | * </ul>
|
---|
39 | * @see <a href="http://mathworld.wolfram.com/EigenDecomposition.html">MathWorld</a>
|
---|
40 | * @see <a href="http://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix">Wikipedia</a>
|
---|
41 | * @version $Revision: 997726 $ $Date: 2010-09-16 14:39:51 +0200 (jeu. 16 sept. 2010) $
|
---|
42 | * @since 2.0
|
---|
43 | */
|
---|
44 | public interface EigenDecomposition {
|
---|
45 |
|
---|
46 | /**
|
---|
47 | * Returns the matrix V of the decomposition.
|
---|
48 | * <p>V is an orthogonal matrix, i.e. its transpose is also its inverse.</p>
|
---|
49 | * <p>The columns of V are the eigenvectors of the original matrix.</p>
|
---|
50 | * <p>No assumption is made about the orientation of the system axes formed
|
---|
51 | * by the columns of V (e.g. in a 3-dimension space, V can form a left-
|
---|
52 | * or right-handed system).</p>
|
---|
53 | * @return the V matrix
|
---|
54 | */
|
---|
55 | RealMatrix getV();
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * Returns the block diagonal matrix D of the decomposition.
|
---|
59 | * <p>D is a block diagonal matrix.</p>
|
---|
60 | * <p>Real eigenvalues are on the diagonal while complex values are on
|
---|
61 | * 2x2 blocks { {real +imaginary}, {-imaginary, real} }.</p>
|
---|
62 | * @return the D matrix
|
---|
63 | * @see #getRealEigenvalues()
|
---|
64 | * @see #getImagEigenvalues()
|
---|
65 | */
|
---|
66 | RealMatrix getD();
|
---|
67 |
|
---|
68 | /**
|
---|
69 | * Returns the transpose of the matrix V of the decomposition.
|
---|
70 | * <p>V is an orthogonal matrix, i.e. its transpose is also its inverse.</p>
|
---|
71 | * <p>The columns of V are the eigenvectors of the original matrix.</p>
|
---|
72 | * <p>No assumption is made about the orientation of the system axes formed
|
---|
73 | * by the columns of V (e.g. in a 3-dimension space, V can form a left-
|
---|
74 | * or right-handed system).</p>
|
---|
75 | * @return the transpose of the V matrix
|
---|
76 | */
|
---|
77 | RealMatrix getVT();
|
---|
78 |
|
---|
79 | /**
|
---|
80 | * Returns a copy of the real parts of the eigenvalues of the original matrix.
|
---|
81 | * @return a copy of the real parts of the eigenvalues of the original matrix
|
---|
82 | * @see #getD()
|
---|
83 | * @see #getRealEigenvalue(int)
|
---|
84 | * @see #getImagEigenvalues()
|
---|
85 | */
|
---|
86 | double[] getRealEigenvalues();
|
---|
87 |
|
---|
88 | /**
|
---|
89 | * Returns the real part of the i<sup>th</sup> eigenvalue of the original matrix.
|
---|
90 | * @param i index of the eigenvalue (counting from 0)
|
---|
91 | * @return real part of the i<sup>th</sup> eigenvalue of the original matrix
|
---|
92 | * @see #getD()
|
---|
93 | * @see #getRealEigenvalues()
|
---|
94 | * @see #getImagEigenvalue(int)
|
---|
95 | */
|
---|
96 | double getRealEigenvalue(int i);
|
---|
97 |
|
---|
98 | /**
|
---|
99 | * Returns a copy of the imaginary parts of the eigenvalues of the original matrix.
|
---|
100 | * @return a copy of the imaginary parts of the eigenvalues of the original matrix
|
---|
101 | * @see #getD()
|
---|
102 | * @see #getImagEigenvalue(int)
|
---|
103 | * @see #getRealEigenvalues()
|
---|
104 | */
|
---|
105 | double[] getImagEigenvalues();
|
---|
106 |
|
---|
107 | /**
|
---|
108 | * Returns the imaginary part of the i<sup>th</sup> eigenvalue of the original matrix.
|
---|
109 | * @param i index of the eigenvalue (counting from 0)
|
---|
110 | * @return imaginary part of the i<sup>th</sup> eigenvalue of the original matrix
|
---|
111 | * @see #getD()
|
---|
112 | * @see #getImagEigenvalues()
|
---|
113 | * @see #getRealEigenvalue(int)
|
---|
114 | */
|
---|
115 | double getImagEigenvalue(int i);
|
---|
116 |
|
---|
117 | /**
|
---|
118 | * Returns a copy of the i<sup>th</sup> eigenvector of the original matrix.
|
---|
119 | * @param i index of the eigenvector (counting from 0)
|
---|
120 | * @return copy of the i<sup>th</sup> eigenvector of the original matrix
|
---|
121 | * @see #getD()
|
---|
122 | */
|
---|
123 | RealVector getEigenvector(int i);
|
---|
124 |
|
---|
125 | /**
|
---|
126 | * Return the determinant of the matrix
|
---|
127 | * @return determinant of the matrix
|
---|
128 | */
|
---|
129 | double getDeterminant();
|
---|
130 |
|
---|
131 | /**
|
---|
132 | * Get a solver for finding the A × X = B solution in exact linear sense.
|
---|
133 | * @return a solver
|
---|
134 | */
|
---|
135 | DecompositionSolver getSolver();
|
---|
136 |
|
---|
137 | }
|
---|