|
inline |
Calculates \( p \), \( t \) s.t. \( p·t = a \) and \( p \) has as few columns as possible.
[in] | a | input matrix |
[in] | thresholds_in | matrix of thresholds/errors associated to each element of a |
[out] | p | matrix p with columns to be kept |
[out] | t | transfer matrix s.t. p·t = a |
[in] | relax_if_necessary | if true, sets thresholds to at least SYTEN_DELINEARISE_THRESHOLD |
Steps of the algorithm:
a
and thresholds_in
such that columns with maximal zeroness score are in the frontt
, otherwise, add the column to p
.This step is done via QR decomposition of the matrix of previously-kept columns. After multiplication of \( Q^H \) into the RHS, each element of \( R \) is scaled s.t. the RHS entries are 1 (unless they are exactly zero).
During the backsubstitution in Gaussian elimination, we require that the residual of each ( \( Q^H \)-transformed) row is smaller than the threshold associated to this ( \( Q^H \)-transformed) row.
The residual of the untransformed column minus the build-up from the calculated coefficients is checked against the thresholds specified for this column. This ensures correctness, i.e. the algorithm will rather keep a linearly-dependent column than introduce an error larger than the specified threshold in any row.
p
matrix, the matrix t
is the transfer matrix.p
are de-linearised as well. If this results in fewer rows than columns, the left transfer matrix is taken as the new p
and the left p
matrix is multiplied into the previous transfer matrix.Symbolically, we write
\begin{align} A & = P_A \cdot T_A \quad \textrm{column-delinearisation of A} \\ P^H_A & = P_P \cdot T_T \quad \textrm{column-delinearisation of }P^H_A\textrm{ (row-delinearisation of }P_A\textrm{)} \\ P_A & = T_T^H \cdot P_P^H \\ A & = T_T^H \cdot P_P^H \cdot T_A \\ \textrm{if }&\mathrm{cols}(T_T^H) < \mathrm{cols}(P_P^H)\textrm{, then } P = T_T^H \textrm{ and } T = P_P^H \cdot T_A \\ \textrm{otherwise }& P = P_A \textrm{ and } T = T_A \end{align}
References cols(), cols_only(), syten::DenseTensor< rank, Scalar >::dim(), syten::DenseTensor< rank, Scalar >::getDims(), syten::herm(), syten::makeIdentity(), and SYTEN_DELINEARISE_THRESHOLD.
Referenced by cols(), syten::STensorImpl::delinearise(), and rows().