001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 package org.apache.commons.math.linear;
019
020
021 /**
022 * An interface to classes that implement an algorithm to calculate the
023 * Cholesky decomposition of a real symmetric positive-definite matrix.
024 * <p>This interface is based on the class with similar name from the
025 * <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a> library, with the
026 * following changes:</p>
027 * <ul>
028 * <li>a {@link #getLT() getLT} method has been added,</li>
029 * <li>the <code>isspd</code> method has been removed, the constructors of
030 * implementation classes being expected to throw {@link
031 * NotPositiveDefiniteMatrixException} when a matrix cannot be decomposed,</li>
032 * <li>a {@link #getDeterminant() getDeterminant} method has been added,</li>
033 * <li>the <code>solve</code> method has been replaced by a {@link
034 * #getSolver() getSolver} method and the equivalent method provided by
035 * the returned {@link DecompositionSolver}.</li>
036 * </ul>
037 *
038 * @see <a href="http://mathworld.wolfram.com/CholeskyDecomposition.html">MathWorld</a>
039 * @see <a href="http://en.wikipedia.org/wiki/Cholesky_decomposition">Wikipedia</a>
040 * @version $Revision: 826627 $ $Date: 2009-10-19 06:27:47 -0400 (Mon, 19 Oct 2009) $
041 * @since 2.0
042 */
043 public interface CholeskyDecomposition {
044
045 /**
046 * Returns the matrix L of the decomposition.
047 * <p>L is an lower-triangular matrix</p>
048 * @return the L matrix
049 */
050 RealMatrix getL();
051
052 /**
053 * Returns the transpose of the matrix L of the decomposition.
054 * <p>L<sup>T</sup> is an upper-triangular matrix</p>
055 * @return the transpose of the matrix L of the decomposition
056 */
057 RealMatrix getLT();
058
059 /**
060 * Return the determinant of the matrix
061 * @return determinant of the matrix
062 */
063 double getDeterminant();
064
065 /**
066 * Get a solver for finding the A × X = B solution in least square sense.
067 * @return a solver
068 */
069 DecompositionSolver getSolver();
070
071 }