Safe Haskell | None |
---|---|

Language | Haskell2010 |

## Synopsis

- householderReflectionInplaceR :: forall (s :: Type) (t :: Type) (n :: Nat) (m :: Nat). (PrimBytes t, Ord t, Epsilon t, KnownDim n, KnownDim m) => STDataFrame s t '[m] -> STDataFrame s t '[m, m] -> STDataFrame s t '[n, m] -> Idxs '[n, m] -> ST s Bool
- householderReflectionInplaceL :: forall (s :: Type) (t :: Type) (n :: Nat) (m :: Nat). (PrimBytes t, Ord t, Epsilon t, KnownDim n, KnownDim m) => STDataFrame s t '[n] -> STDataFrame s t '[n, n] -> STDataFrame s t '[n, m] -> Idxs '[n, m] -> ST s Bool

# Documentation

householderReflectionInplaceR Source #

:: forall (s :: Type) (t :: Type) (n :: Nat) (m :: Nat). (PrimBytes t, Ord t, Epsilon t, KnownDim n, KnownDim m) | |

=> STDataFrame s t '[m] | Temporary buffer for a Householder axis vector |

-> STDataFrame s t '[m, m] | Current state of \(P^\intercal\) |

-> STDataFrame s t '[n, m] | Current state of \(R\) |

-> Idxs '[n, m] | Pivot element |

-> ST s Bool |

Run a Householder transformation inplace.

Similar to `householderReflectionInplaceR`

, but works from right to left
- use to zero elements to the right from the pivot.

Returns `True`

if reflection has been performed, and `False`

if it was not needed.
This can be used to track the sign of `det P`

.

householderReflectionInplaceL Source #

:: forall (s :: Type) (t :: Type) (n :: Nat) (m :: Nat). (PrimBytes t, Ord t, Epsilon t, KnownDim n, KnownDim m) | |

=> STDataFrame s t '[n] | Temporary buffer for a Householder axis vector |

-> STDataFrame s t '[n, n] | Current state of \(P^\intercal\) |

-> STDataFrame s t '[n, m] | Current state of \(R\) |

-> Idxs '[n, m] | Pivot element |

-> ST s Bool |

Run a Householder transformation inplace.

Given some orthongonal matrix \(P\), some matrix \(R\) and index \((k,l)\), reflects \(R\) along some hyperplane, such that all elements of \(R\) below index \( (k, l) \) become zeros, then updates \(P\) with the inverse of the same transform as \(R\).

Notes and invariants:

- The transformation happens inplace for both matrices \(P\) and \(R\); if \( R = P^\intercal A \), then \( R' = P^*PR = P'^\intercal A \), where \( P' \) and \( R' \) are the updated versions of the input matrices, \( P^* \) and \( A \) are implicit matrices.
- All elements below and to the left of index \(k,l\) in \(R\) are assumed (and not checked) to be zeros; these are not touched by the subroutine to save flops.
- A logical starting value for \(P\) is an identity matrix. The subroutine can be used for a QR decomposition: \( Q = P \).

Returns `True`

if reflection has been performed, and `False`

if it was not needed.
This can be used to track the sign of `det P`

.