SG++-Doxygen-Documentation
sgpp::optimization::math Namespace Reference

Namespace with linear algebra functions. More...

Functions

void hessenbergForm (base::DataMatrix &A, base::DataMatrix &V)
 Hessenberg form of given matrix \(A\) with transformation matrix \(V\) with \(H = V^{-1} AV\) in Hessenberg form (similiarity transformation such that entries \((i,j)\) vanish for \(i > j + 1\), \(V\) orthogonal). More...
 
void householderTransformation (const base::DataMatrix &A, size_t i, size_t j, base::DataMatrix &Q)
 Calculate transformation matrix \(Q\) of a Householder transformation. More...
 
void QRDecomposition (base::DataMatrix &A, base::DataMatrix &Q)
 QR decomposition of given matrix \(A\) with transformation matrix \(Q\) with \(A = QR\) ( \(Q\) orthogonal and \(R\) upper triangular). More...
 
void schurDecomposition (base::DataMatrix &A, base::DataMatrix &V)
 Schur decomposition of given matrix \(A\) with transformation matrix \(V\) (similiarity transformation such that \(S = V^{-1} AV\) upper triangular, \(V\) orthogonal). More...
 

Detailed Description

Namespace with linear algebra functions.

Function Documentation

◆ hessenbergForm()

void sgpp::optimization::math::hessenbergForm ( base::DataMatrix A,
base::DataMatrix V 
)

Hessenberg form of given matrix \(A\) with transformation matrix \(V\) with \(H = V^{-1} AV\) in Hessenberg form (similiarity transformation such that entries \((i,j)\) vanish for \(i > j + 1\), \(V\) orthogonal).

Parameters
[in,out]Asquare matrix, afterwards \(H\)
[out]Vtransformation matrix (must have correct size \(n \times n\))

References sgpp::base::DataMatrix::getNrows(), householderTransformation(), python.statsfileInfo::i, python.utils.statsfile2gnuplot::j, m, friedman::p, sgpp::base::DataMatrix::resize(), and python.utils.pca_normalize_dataset::V.

Referenced by schurDecomposition().

◆ householderTransformation()

void sgpp::optimization::math::householderTransformation ( const base::DataMatrix A,
size_t  i,
size_t  j,
base::DataMatrix Q 
)

Calculate transformation matrix \(Q\) of a Householder transformation.

The normal vector (defining the reflection hyperplane) used is \(d := (c_1 + \sigma \lVert c \rVert_2, c_2, \dotsc, c_n)\) with \(c := A(i:end,j)\) and \(\sigma := +1\) for \(\sigma \ge 0\) and \(\sigma := -1\) otherwise. \(Q\) is symmetric and orthogonal (i.e. \(Q = Q^{\mathrm{t}} = Q^{-1}\)). After applying \(QA\), the entries \((i+1:end,j)\) should vanish.

Parameters
Asquare matrix containing the normal vector
irow index of starting row of normal vector
jcolumn index of starting column of normal vector
[out]Qtransformation matrix (must have correct size \((n-i) \times (n-i)\))

References sgpp::base::DataMatrix::getNrows(), python.statsfileInfo::i, m, friedman::p, and chess::r.

Referenced by hessenbergForm(), and QRDecomposition().

◆ QRDecomposition()

void sgpp::optimization::math::QRDecomposition ( base::DataMatrix A,
base::DataMatrix Q 
)

QR decomposition of given matrix \(A\) with transformation matrix \(Q\) with \(A = QR\) ( \(Q\) orthogonal and \(R\) upper triangular).

Parameters
[in,out]Asquare matrix, afterwards \(R\)
[out]Qtransformation matrix (must have correct size \(n \times n\))

References sgpp::base::DataMatrix::getNrows(), householderTransformation(), python.statsfileInfo::i, python.utils.statsfile2gnuplot::j, m, and sgpp::base::DataMatrix::resize().

Referenced by schurDecomposition().

◆ schurDecomposition()

void sgpp::optimization::math::schurDecomposition ( base::DataMatrix A,
base::DataMatrix V 
)

Schur decomposition of given matrix \(A\) with transformation matrix \(V\) (similiarity transformation such that \(S = V^{-1} AV\) upper triangular, \(V\) orthogonal).

The diagonal of \(S\) contains the eigenvalues of \(A\). The Schur decomposition exists iff the characteristic polynomial of \(A\) factorizes in real linear factors. If \(A\) is symmetric, then the Schur decomposition exists with diagonal \(S\), i.e., the columns of \(V\) are the eigenvectors of \(A\).

Parameters
[in,out]Asquare matrix, afterwards \(S\)
[out]Vtransformation matrix (must have correct size \(n \times n\))

References sgpp::base::DataMatrix::getNrows(), hessenbergForm(), python.statsfileInfo::i, python.utils.statsfile2gnuplot::j, lambda, m, friedman::p, QRDecomposition(), sgpp::base::DataMatrix::resize(), and python.utils.pca_normalize_dataset::V.

Referenced by sgpp::optimization::optimizer::CMAES::optimize().