X-Git-Url: http://gitweb.michael.orlitzky.com/?p=numerical-analysis.git;a=blobdiff_plain;f=src%2FLinear%2FQR.hs;h=4c1c56446f836c348b1b7e65ad138fb650dd9ed3;hp=8d9ea42a1e19bd880ffb9211238e53ba3d7b8c5b;hb=14c40575357025bbc37e5111ee879ff7f95d6e6f;hpb=6892f38cf4dab275a91fbe06bfb8efe229518336 diff --git a/src/Linear/QR.hs b/src/Linear/QR.hs index 8d9ea42..4c1c564 100644 --- a/src/Linear/QR.hs +++ b/src/Linear/QR.hs @@ -140,7 +140,8 @@ givens_rotator i j xi xj = -- 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 @@ -162,7 +163,7 @@ qr matrix = | 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