31 research outputs found
Specific "scientific" data structures, and their processing
Programming physicists use, as all programmers, arrays, lists, tuples,
records, etc., and this requires some change in their thought patterns while
converting their formulae into some code, since the "data structures" operated
upon, while elaborating some theory and its consequences, are rather: power
series and Pad\'e approximants, differential forms and other instances of
differential algebras, functionals (for the variational calculus), trajectories
(solutions of differential equations), Young diagrams and Feynman graphs, etc.
Such data is often used in a [semi-]numerical setting, not necessarily
"symbolic", appropriate for the computer algebra packages. Modules adapted to
such data may be "just libraries", but often they become specific, embedded
sub-languages, typically mapped into object-oriented frameworks, with
overloaded mathematical operations. Here we present a functional approach to
this philosophy. We show how the usage of Haskell datatypes and - fundamental
for our tutorial - the application of lazy evaluation makes it possible to
operate upon such data (in particular: the "infinite" sequences) in a natural
and comfortable manner.Comment: In Proceedings DSL 2011, arXiv:1109.032
Python avancé et programmation scientifique: Techniques d'algorithmisation et de construction de programmes compacts et efficaces
National audienceCet ouvrage prĂ©sente les techniques de programmation avancĂ©es dans le contexte numĂ©rique, ainsi que dans les domaines de visualisation et traitement dâimages. Il compte plusieurs sujets Ă faire en autonomie
Generating Power of Lazy Semantics
We discuss the use of the lazy evaluation scheme as coding tool in some algebraic manipulations. We show --- on several examples --- how to process the infinite power series or other open-ended data structures with co-recurrent algorithms, which simplify enormously the coding of recurrence relations or solving equations in the power series domain. The important point is not the "infinite" length of the data, but the fact that the algorithms use open recursion, and the user never thinks about the truncation. 1 Introduction This article develops some applications of the functional lazy evaluation schemes to symbolic calculus. Neither the idea of non-strict semantics, nor its application to generate infinite, open structures such as power series, are new, see for example [1, 2], some books on functional programming ([3, 4]), etc. The lazy evaluation (or call by need is a protocol which delays the evaluation of the arguments of a function: while evaluating f(x) the code for f is entered, ..
Teaching with Dynamic Documents - Web Applications and Local Resources
International audienc
Python avancé et programmation scientifique: Techniques d'algorithmisation et de construction de programmes compacts et efficaces
National audienceCet ouvrage prĂ©sente les techniques de programmation avancĂ©es dans le contexte numĂ©rique, ainsi que dans les domaines de visualisation et traitement dâimages. Il compte plusieurs sujets Ă faire en autonomie
Functional framework for sound synthesis
Abstract. We present an application of functional programming in the domain of sound generation and processing. We use the lazy language Clean to define purely functional stream generators, filters and other processors, such as reverberators. Audio signals are represented (before the final output to arrays processed by the system primitives) as co-recursive lazy streams, and the processing algorithms have a strong dataflow taste. This formalism seems particularly appropriate to implement the âwaveguideâ, or âphysically-oriented â sound models. Lazy programming allocates the dynamical memory quite heavily, so we do not propose a real-time, industrial strength package, but rather a pedagogical library, offering natural, easy to understand coding tools. We believe that, thanks to their simplicity and clearness, such functional tools can be also taught to students interested in audio processing, but with a limited competence in programming
Functional Differentiation of Computer Programs
. We present a purely functional implementation of the computational differentiation tools --- the well known numeric (i.e., not symbolic) techniques which permit one to compute point-wise derivatives of functions defined by computer programs economically and exactly (with machine precision). We show how the use of lazy evaluation permits a transparent and elegant construction of the entire infinite tower of derivatives of higher order for any expressions present in the program. The formalism may be useful in various problems of scientific computing which often demand a hard and ungracious human preprocessing before writing the final code. Some concrete examples are given. Keywords: Haskell, differentiation, arithmetic, lazy semantics 1. Introduction The aim of this paper is to show the usefulness of lazy functional techniques in the domain of scientific computing. We present a functional implementation of the Computational Differentiation techniques which permit an efficient comput..