/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math.linear;
/**
* An interface to classes that implement an algorithm to calculate a
* rectangular variation of Cholesky decomposition of a real symmetric
* positive semidefinite matrix.
* <p>The rectangular Cholesky decomposition of a real symmetric positive
* semidefinite matrix A consists of a rectangular matrix B with the same
* number of rows such that: A is almost equal to BB<sup>T</sup>, depending
* on a user-defined tolerance. In a sense, this is the square root of A.</p>
* <p>The difference with respect to the regular {@link CholeskyDecomposition}
* is that rows/columns may be permuted (hence the rectangular shape instead
* of the traditional triangular shape) and there is a threshold to ignore
* small diagonal elements. This is used for example to generate {@link
* org.apache.commons.math.random.CorrelatedRandomVectorGenerator correlated
* random n-dimensions vectors} in a p-dimension subspace (p < n).
* In other words, it allows generating random vectors from a covariance
* matrix that is only positive semidefinite, and not positive definite.</p>
* <p>Rectangular Cholesky decomposition is <em>not</em> suited for solving
* linear systems, so it does not provide any {@link DecompositionSolver
* decomposition solver}.</p>
*
* @see CholeskyDecomposition
* @see org.apache.commons.math.random.CorrelatedRandomVectorGenerator
* @version $Id: RectangularCholeskyDecomposition.java 1131229 2011-06-03 20:49:25Z luc $
* @since 3.0
*/
public interface RectangularCholeskyDecomposition {
/** Get the root of the covariance matrix.
* The root is the rectangular matrix <code>B</code> such that
* the covariance matrix is equal to <code>B.B<sup>T</sup></code>
* @return root of the square matrix
* @see #getRank()
*/
RealMatrix getRootMatrix();
/** Get the rank of the symmetric positive semidefinite matrix.
* The r is the number of independent rows in the symmetric positive semidefinite
* matrix, it is also the number of columns of the rectangular
* matrix of the decomposition.
* @return r of the square matrix.
* @see #getRootMatrix()
*/
int getRank();
}