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
18package org.apache.commons.math.linear;
19
20
21/**
22 * An interface to classes that implement an algorithm to calculate the
23 * QR-decomposition of a real 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 #getQT() getQT} method has been added,</li>
29 *   <li>the <code>solve</code> and <code>isFullRank</code> methods have been replaced
30 *   by a {@link #getSolver() getSolver} method and the equivalent methods provided by
31 *   the returned {@link DecompositionSolver}.</li>
32 * </ul>
33 *
34 * @see <a href="http://mathworld.wolfram.com/QRDecomposition.html">MathWorld</a>
35 * @see <a href="http://en.wikipedia.org/wiki/QR_decomposition">Wikipedia</a>
36 * @version $Revision: 826627 $ $Date: 2009-10-19 12:27:47 +0200 (lun. 19 oct. 2009) $
37 * @since 1.2
38 */
39public interface QRDecomposition {
40
41    /**
42     * Returns the matrix R of the decomposition.
43     * <p>R is an upper-triangular matrix</p>
44     * @return the R matrix
45     */
46    RealMatrix getR();
47
48    /**
49     * Returns the matrix Q of the decomposition.
50     * <p>Q is an orthogonal matrix</p>
51     * @return the Q matrix
52     */
53    RealMatrix getQ();
54
55    /**
56     * Returns the transpose of the matrix Q of the decomposition.
57     * <p>Q is an orthogonal matrix</p>
58     * @return the Q matrix
59     */
60    RealMatrix getQT();
61
62    /**
63     * Returns the Householder reflector vectors.
64     * <p>H is a lower trapezoidal matrix whose columns represent
65     * each successive Householder reflector vector. This matrix is used
66     * to compute Q.</p>
67     * @return a matrix containing the Householder reflector vectors
68     */
69    RealMatrix getH();
70
71    /**
72     * Get a solver for finding the A &times; X = B solution in least square sense.
73     * @return a solver
74     */
75    DecompositionSolver getSolver();
76
77}
78