From b32831b5dde3440b85cbef62f4c47fcce0ee974f Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 7 Dec 2018 10:52:09 -0500 Subject: [PATCH] src/Integration/Gaussian.hs: fix monomorphism restriction warnings. --- src/Integration/Gaussian.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Integration/Gaussian.hs b/src/Integration/Gaussian.hs index 554dadc..c2e4d5f 100644 --- a/src/Integration/Gaussian.hs +++ b/src/Integration/Gaussian.hs @@ -102,14 +102,12 @@ nodes_and_weights :: forall m a. nodes_and_weights iterations = (nodes, weights) where - jac = jacobi_matrix - -- A shift is needed to make sure the QR algorithm -- converges. Since the roots (and thus eigenvalues) of orthogonal -- polynomials are real and distinct, there does exist a shift -- that will make it work. We guess lambda=1 makes it work. - shifted_jac = jac - identity_matrix + shifted_jac = jacobi_matrix - identity_matrix :: Mat (S m) (S m) a (shifted_nodes, vecs) = eigenvectors_symmetric iterations shifted_jac ones :: Col (S m) a @@ -147,6 +145,7 @@ gaussian :: forall a. gaussian f = gaussian' f nodes weights where + coerce :: (ToRational.C b) => b -> a coerce = fromRational' . toRational nodes :: Col10 a -- 2.43.2