X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FIntegration%2FGaussian.hs;h=be92e5c8bdfd85e232cee5db3b1d57b7ce7675b1;hb=9ef91ad4ec3a5c0966f0850d40310722b6c38b68;hp=8fcca4f710d4fd918e061f475196ad3c9a2af1e5;hpb=6f237bfcd5890513cd390000c1ac8cdbdbaffb8c;p=numerical-analysis.git diff --git a/src/Integration/Gaussian.hs b/src/Integration/Gaussian.hs index 8fcca4f..be92e5c 100644 --- a/src/Integration/Gaussian.hs +++ b/src/Integration/Gaussian.hs @@ -28,8 +28,8 @@ import Linear.Matrix ( construct, fromList, identity_matrix, - matmap, - row', + map2, + row, transpose ) import Linear.QR ( eigenvectors_symmetric ) import Normed ( Normed(..) ) @@ -119,11 +119,11 @@ nodes_and_weights iterations = nodes = shifted_nodes + ones -- unshift the nodes -- Get the first component of each column. - first_components = row' vecs 0 + first_components = row vecs 0 -- Square it and multiply by 2; see the Golub-Welsch paper for -- this magic. - weights_row = matmap (\x -> (fromInteger 2)*x^2) first_components + weights_row = map2 (\x -> (fromInteger 2)*x^2) first_components weights = transpose $ weights_row @@ -212,5 +212,5 @@ gaussian' f nodes weights = -- want. norm_p (1::Int) weighted_values where - function_values = matmap f nodes + function_values = map2 f nodes weighted_values = colzipwith (*) weights function_values