Raymond | dee0849 | 2015-04-02 10:43:13 -0700 | [diff] [blame] | 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 org.apache.commons.math.linear; |
| 19 | |
| 20 | |
| 21 | /** |
| 22 | * An interface to classes that implement an algorithm to calculate the |
| 23 | * Cholesky decomposition of a real symmetric positive-definite matrix. |
| 24 | * <p>This interface is based on the class with similar name from the |
| 25 | * <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a> library, with the |
| 26 | * following changes:</p> |
| 27 | * <ul> |
| 28 | * <li>a {@link #getLT() getLT} method has been added,</li> |
| 29 | * <li>the <code>isspd</code> method has been removed, the constructors of |
| 30 | * implementation classes being expected to throw {@link |
| 31 | * NotPositiveDefiniteMatrixException} when a matrix cannot be decomposed,</li> |
| 32 | * <li>a {@link #getDeterminant() getDeterminant} method has been added,</li> |
| 33 | * <li>the <code>solve</code> method has been replaced by a {@link |
| 34 | * #getSolver() getSolver} method and the equivalent method provided by |
| 35 | * the returned {@link DecompositionSolver}.</li> |
| 36 | * </ul> |
| 37 | * |
| 38 | * @see <a href="http://mathworld.wolfram.com/CholeskyDecomposition.html">MathWorld</a> |
| 39 | * @see <a href="http://en.wikipedia.org/wiki/Cholesky_decomposition">Wikipedia</a> |
| 40 | * @version $Revision: 826627 $ $Date: 2009-10-19 12:27:47 +0200 (lun. 19 oct. 2009) $ |
| 41 | * @since 2.0 |
| 42 | */ |
| 43 | public interface CholeskyDecomposition { |
| 44 | |
| 45 | /** |
| 46 | * Returns the matrix L of the decomposition. |
| 47 | * <p>L is an lower-triangular matrix</p> |
| 48 | * @return the L matrix |
| 49 | */ |
| 50 | RealMatrix getL(); |
| 51 | |
| 52 | /** |
| 53 | * Returns the transpose of the matrix L of the decomposition. |
| 54 | * <p>L<sup>T</sup> is an upper-triangular matrix</p> |
| 55 | * @return the transpose of the matrix L of the decomposition |
| 56 | */ |
| 57 | RealMatrix getLT(); |
| 58 | |
| 59 | /** |
| 60 | * Return the determinant of the matrix |
| 61 | * @return determinant of the matrix |
| 62 | */ |
| 63 | double getDeterminant(); |
| 64 | |
| 65 | /** |
| 66 | * Get a solver for finding the A × X = B solution in least square sense. |
| 67 | * @return a solver |
| 68 | */ |
| 69 | DecompositionSolver getSolver(); |
| 70 | |
| 71 | } |