Abstract
This paper evaluates the elegance and efficiency of functional programming in numerical scientific computing, an interesting area because time and space efficiency are important: many scientific programs work with large data sets and run for a long time. The example we use is the conjugate gradient algorithm, an iterative method to solve systems of linear equations. We investigated various implementations of the algorithm in the functional languages Clean and Haskell and the imperative language C. Good results are obtained when comparing the algorithm written in Clean with the same algorithm in C and Haskell.
Preview
Unable to display preview. Download preview PDF.
References
E. Barendsen and J.E.W Smetsers. Conventional and uniqueness typing in graph rewrite systems. Technical Report CSI-R9328, Computer Science Institute, Faculty of Mathematics and Informatics, University of Nijmegen, December 1993.
S. Choi, T.K. Sarkar, and Choi J. Adaptive antenna array for direction-of-arrival estimation utilizing the conjugate gradient method. Signal Processing (SIGPRO), 45(3):313–327, Sep 1995.
R.G. Ellis and D.W. Oldenburg. The pole-pole 3-d dc resistivity inverse problem: a conjugate gradient approach. Geophysical Journal International, 119:187–194, 1994.
A. Gill, J. Launchbury, and S.L. Peyton Jones. A short cut to deforestation. In Proceedings of the ACM Conference on Functional Programming Languages and Computer Architecture (FPCA'93), pages 223–232, April 1993.
P.H. Hartel et al. Benchmarking implementations of functional languages with “pseudoknot”, a float-intensive benchmark. Journal functional programming, 6(4): 621–655, July 1996.
P. Hudak, S.L. Peyton Jones, and P. Wadler. Report on the programming language haskell, a non-strict purely functional language (version 1.2). SIGPLAN Notices, Mar, 1992.
A.G. Hoekstra and P.M.A. Sloot. Implementation of a parallel conjugate gradient method for simulation of elastic light. 4th Physics Computing '92, pages 345–346, 1993.
E.M. Johansson, F.U. Dowla, and D.M. Goodman. Backpropagation learning for multi-layer feed-forward neural networks using the conjugate gradient method. International Journal of Neural Systems, 2(4), 1992.
V. Kumar, A. Grama, A. Gupta, and G. Karypis. Introduction to Parallel Computing, Design and Analysis of Algorithms. The Benjamin/Cummings Publishing Company, Inc., California, 1994.
J. Launchbury and S.L. Peyton Jones. Lazy functional state threads. In Programming Languages Design and Implementation, Orlando, 1994. ACM Press.
S.L. Peyton Jones. Bulk types with class. In Proceedings of the 1996 Glasgow Workshop on Fucntional Programming, Ullapool, Scotland, July 1996.
S.L. Peyton Jones and J. Launchbury. Unboxed values as first class citizens. In FPCA '91 — Functional Programming Languages and Computer Architecture, pages 636–666, 1991.
M.J. Plasmeijer and M.C.J.D. van Eekelen. Functional Programming and Parallel Graph Rewriting. Addison-Wesley Publishers Ltd., 1993.
T. Sheard and L. Fegaras. A fold for all seasons. In Proceedings of the ACM Conference on Functional Programming Languages and Computer Architecture (FPCA '93), pages 233–242, Orlando, April 1993. ACM Press.
P. Wadler. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Serrarens, P.R. (1997). Implementing the conjugate gradient algorithm in a functional language. In: Kluge, W. (eds) Implementation of Functional Languages. IFL 1996. Lecture Notes in Computer Science, vol 1268. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-63237-9_22
Download citation
DOI: https://doi.org/10.1007/3-540-63237-9_22
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-63237-5
Online ISBN: 978-3-540-69239-3
eBook Packages: Springer Book Archive