クラス テンプレート JAMA::QR< Real >

#include <jama_qr.h>

すべてのメンバ一覧

Public メソッド

 QR (const TNT::Array2D< Real > &A)
int isFullRank () const
TNT::Array2D< Real > getHouseholder (void) const
TNT::Array2D< Real > getR () const
TNT::Array2D< Real > getQ () const
TNT::Array1D< Real > solve (const TNT::Array1D< Real > &b) const
TNT::Array2D< Real > solve (const TNT::Array2D< Real > &B) const

Private 変数

TNT::Array2D< Real > QR_
int m
int n
TNT::Array1D< Real > Rdiag


説明

template<class Real>
class JAMA::QR< Real >

Classical QR Decompisition: for an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n orthogonal matrix Q and an n-by-n upper triangular matrix R so that A = Q*R.

The QR decompostion always exists, even if the matrix does not have full rank, so the constructor will never fail. The primary use of the QR decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if isFullRank() returns 0 (false).

The Q and R factors can be retrived via the getQ() and getR() methods. Furthermore, a solve() method is provided to find the least squares solution of Ax=b using the QR factors.

(Adapted from JAMA, a Java Matrix Library, developed by jointly by the Mathworks and NIST; see http://math.nist.gov/javanumerics/jama).

例:

qr.cpp.

jama_qr.h35 行で定義されています。


コンストラクタとデストラクタ

template<class Real >
JAMA::QR< Real >::QR ( const TNT::Array2D< Real > &  A  )  [inline]

Create a QR factorization object for A.

引数:
A rectangular (m>=n) matrix.

jama_qr.h63 行で定義されています。

参照先 TNT::Array2D< T >::copy(), TNT::Array2D< T >::dim1(), TNT::Array2D< T >::dim2(), TNT::hypot(), JAMA::QR< Real >::m, JAMA::QR< Real >::n, JAMA::QR< Real >::QR_, と JAMA::QR< Real >::Rdiag.


関数

template<class Real >
TNT::Array2D<Real> JAMA::QR< Real >::getHouseholder ( void   )  const [inline]

Retreive the Householder vectors from QR factorization

戻り値:
lower trapezoidal matrix whose columns define the reflections

jama_qr.h130 行で定義されています。

参照先 JAMA::QR< Real >::m, JAMA::QR< Real >::n, と JAMA::QR< Real >::QR_.

template<class Real >
TNT::Array2D<Real> JAMA::QR< Real >::getQ (  )  const [inline]

Generate and return the (economy-sized) orthogonal factor

戻り値:
Q the (ecnomy-sized) orthogonal factor (Q*R=A).

jama_qr.h183 行で定義されています。

参照先 JAMA::QR< Real >::m, JAMA::QR< Real >::n, と JAMA::QR< Real >::QR_.

template<class Real >
TNT::Array2D<Real> JAMA::QR< Real >::getR (  )  const [inline]

Return the upper triangular factor, R, of the QR factorization

戻り値:
R

jama_qr.h157 行で定義されています。

参照先 JAMA::QR< Real >::n, JAMA::QR< Real >::QR_, と JAMA::QR< Real >::Rdiag.

template<class Real >
int JAMA::QR< Real >::isFullRank (  )  const [inline]

Flag to denote the matrix is of full rank.

戻り値:
1 if matrix is full rank, 0 otherwise.

jama_qr.h111 行で定義されています。

参照先 JAMA::QR< Real >::n, と JAMA::QR< Real >::Rdiag.

参照元 JAMA::QR< Real >::solve().

template<class Real >
TNT::Array2D<Real> JAMA::QR< Real >::solve ( const TNT::Array2D< Real > &  B  )  const [inline]

Least squares solution of A*X = B

引数:
B m x k Array (must conform).
戻り値:
X n x k Array that minimizes the two norm of Q*R*X-B. If B is non-conformant, or if QR.isFullRank() is false, the routine returns a null (0x0) array.

jama_qr.h268 行で定義されています。

参照先 TNT::Array2D< T >::copy(), TNT::Array2D< T >::dim1(), TNT::Array2D< T >::dim2(), JAMA::QR< Real >::isFullRank(), JAMA::QR< Real >::m, JAMA::QR< Real >::n, JAMA::QR< Real >::QR_, と JAMA::QR< Real >::Rdiag.

template<class Real >
TNT::Array1D<Real> JAMA::QR< Real >::solve ( const TNT::Array1D< Real > &  b  )  const [inline]

Least squares solution of A*x = b

引数:
b m-length array (vector).
戻り値:
x n-length array (vector) that minimizes the two norm of Q*R*X-B. If B is non-conformant, or if QR.isFullRank() is false, the routine returns a null (0-length) vector.

jama_qr.h217 行で定義されています。

参照先 TNT::Array1D< T >::copy(), TNT::Array1D< T >::dim1(), JAMA::QR< Real >::isFullRank(), JAMA::QR< Real >::m, JAMA::QR< Real >::n, JAMA::QR< Real >::QR_, と JAMA::QR< Real >::Rdiag.


変数

template<class Real >
int JAMA::QR< Real >::m [private]

Row and column dimensions. column dimension. row dimension.

jama_qr.h48 行で定義されています。

参照元 JAMA::QR< Real >::getHouseholder(), JAMA::QR< Real >::getQ(), JAMA::QR< Real >::QR(), と JAMA::QR< Real >::solve().

template<class Real >
int JAMA::QR< Real >::n [private]

template<class Real >
TNT::Array2D<Real> JAMA::QR< Real >::QR_ [private]

Array for internal storage of decomposition. internal array storage.

jama_qr.h42 行で定義されています。

参照元 JAMA::QR< Real >::getHouseholder(), JAMA::QR< Real >::getQ(), JAMA::QR< Real >::getR(), JAMA::QR< Real >::QR(), と JAMA::QR< Real >::solve().

template<class Real >
TNT::Array1D<Real> JAMA::QR< Real >::Rdiag [private]

Array for internal storage of diagonal of R. diagonal of R.

jama_qr.h53 行で定義されています。

参照元 JAMA::QR< Real >::getR(), JAMA::QR< Real >::isFullRank(), JAMA::QR< Real >::QR(), と JAMA::QR< Real >::solve().


このクラスの説明は次のファイルから生成されました:

TNTに対してThu Nov 13 00:45:18 2008に生成されました。  doxygen 1.5.7.1