-- True
--
qr :: forall m n a. (Arity m, Arity n, Eq a, Algebraic.C a, Ring.C a)
- => Mat m n a -> (Mat m m a, Mat m n a)
+ => Mat (S m) (S n) a
+ -> (Mat (S m) (S m) a, Mat (S m) (S n) a)
qr matrix =
ifoldl col_function initial_qr columns
where
| otherwise = (q*rotator, (transpose rotator)*r)
where
y = r !!! (idx, col_idx)
- rotator :: Mat m m a
+ rotator :: Mat (S m) (S m) a
rotator = givens_rotator col_idx idx (r !!! (col_idx, col_idx)) y