1dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/*
2dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Licensed to the Apache Software Foundation (ASF) under one or more
3dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * contributor license agreements.  See the NOTICE file distributed with
4dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * this work for additional information regarding copyright ownership.
5dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * The ASF licenses this file to You under the Apache License, Version 2.0
6dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (the "License"); you may not use this file except in compliance with
7dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the License.  You may obtain a copy of the License at
8dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
9dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *      http://www.apache.org/licenses/LICENSE-2.0
10dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
11dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Unless required by applicable law or agreed to in writing, software
12dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * distributed under the License is distributed on an "AS IS" BASIS,
13dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * See the License for the specific language governing permissions and
15dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * limitations under the License.
16dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
17dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
18dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpackage org.apache.commons.math.linear;
19dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
20dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
21dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/**
22dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * An interface to classes that implement an algorithm to calculate the
23dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Cholesky decomposition of a real symmetric positive-definite matrix.
24dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <p>This interface is based on the class with similar name from the
25dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a> library, with the
26dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * following changes:</p>
27dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * <ul>
28dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *   <li>a {@link #getLT() getLT} method has been added,</li>
29dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *   <li>the <code>isspd</code> method has been removed, the constructors of
30dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *   implementation classes being expected to throw {@link
31dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *   NotPositiveDefiniteMatrixException} when a matrix cannot be decomposed,</li>
32dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *   <li>a {@link #getDeterminant() getDeterminant} method has been added,</li>
33dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *   <li>the <code>solve</code> method has been replaced by a {@link
34dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *   #getSolver() getSolver} method and the equivalent method provided by
35dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *   the returned {@link DecompositionSolver}.</li>
36dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * </ul>
37dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
38dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see <a href="http://mathworld.wolfram.com/CholeskyDecomposition.html">MathWorld</a>
39dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @see <a href="http://en.wikipedia.org/wiki/Cholesky_decomposition">Wikipedia</a>
40dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @version $Revision: 826627 $ $Date: 2009-10-19 12:27:47 +0200 (lun. 19 oct. 2009) $
41dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.0
42dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
43dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpublic interface CholeskyDecomposition {
44dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
45dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
46dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * Returns the matrix L of the decomposition.
47dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>L is an lower-triangular matrix</p>
48dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return the L matrix
49dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
50dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    RealMatrix getL();
51dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
52dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
53dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * Returns the transpose of the matrix L of the decomposition.
54dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * <p>L<sup>T</sup> is an upper-triangular matrix</p>
55dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return the transpose of the matrix L of the decomposition
56dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
57dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    RealMatrix getLT();
58dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
59dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
60dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * Return the determinant of the matrix
61dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return determinant of the matrix
62dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
63dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    double getDeterminant();
64dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
65dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
66dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * Get a solver for finding the A &times; X = B solution in least square sense.
67dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @return a solver
68dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
69dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    DecompositionSolver getSolver();
70dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
71dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond}
72