Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Complex stuff
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-01-08 (19:15)
From: shiv@m...
Subject: [Caml-list] Complex stuff
Sorry to bring this up again ...

I know that the Ocaml team might be implementing complex numbers in 

However, I need complex support now and I was wondering what the best 
way to proceed would be, if I want to port the code over to the native 
complex support as and when it becomes available?

I need the basic arithmetic and trignometric operations and bigarray 
(complex32, complex64 and fortran layout) support.

I could borrow the basic arithmetic and trignometric stuff from Psilab 
or even Clean libraries. Should I represent complex numbers as tuples or 
record (tuples I guess, since that is what Psilab does)?

What about the bigarray support? The basic stuff I can roll on my own, 
unless somebody else has already done it and can provide me with code. 
How about the bracket notation? Do I need to use camlp4 to get a.{i,j} 
to return a complex number and a.{i,j} <- to store a complex number in 
(i,j)th position (etc..)?

The reason I need the a.{i,j} notation is that I already have real 
number versions of my code and the complex versions will be identical. 
However, for performance reasons I cannot use functors. So I intend to 
do cut-and-paste!

Any advice and/or code will be appreciated.



Bug reports:  FAQ:
To unsubscribe, mail  Archives: