comp.lang.ada
 help / color / mirror / Atom feed
* small example, using complex variables in Ada
@ 2010-06-09 10:49 Nasser M. Abbasi
  2010-06-09 11:26 ` Ludovic Brenta
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: Nasser M. Abbasi @ 2010-06-09 10:49 UTC (permalink / raw)


I never used complex variables before in Ada, so for the last 3 hrs I 
was learning how to do it. I wrote a simple program, to find the DFT of 
an array of 3 elements {1,2,3} (DFT=discrete Fourier transform).

The definition of DFT is one equation with summation, here it is, first 
equation you'll see:

http://en.wikipedia.org/wiki/Discrete_Fourier_transform

Since I have not programmed in Ada nor in FORTRAN for a looong time, I 
am very rusty, I program in Mathematica and sometimes in matlab these 
days, but I wanted to try Ada on complex numbers.

I also wrote a FORTRAN equivalent of the small Ada function.  Here is 
below the Ada code, and the FORTRAN code.  Again, do not scream too much 
if it is not good code, I just learned this now, I am sure this can be 
improved a lot.

And for comparing, I show the Matlab and the Mathematica output just to 
make sure.


====== START ADA ============
--
-- dtf.adb, compiled with GNAT 4.3.4 20090804 (release) 1
-- under CYGWIN 1.7.5
-- gnatmake dft.adb
--
-- ./dft.exe
-- ( 6.00000E+00, 0.00000E+00)
-- (-1.50000E+00, 8.66026E-01)
-- (-1.50000E+00,-8.66025E-01)
-- $


with Ada.Text_IO; use Ada.Text_IO;
with Ada.Numerics.Complex_Types; use  Ada.Numerics.Complex_Types;

with Ada.Numerics; use  Ada.Numerics;

with Ada.Numerics.Complex_Elementary_Functions;
use  Ada.Numerics.Complex_Elementary_Functions;

with Ada.Complex_Text_IO; use Ada.Complex_Text_IO;

procedure dft is
     N : positive := 3;
     J : constant complex :=(0.0,1.0);  -- SQRT(-1)
     X : array(0 .. N-1) of Complex  := (others=>(0.0,0.0));
     data : array(0 .. N-1) of float :=(1.0,2.0,3.0);

begin
     FOR k in X'range LOOP
         FOR m in data'range LOOP
             X(k) := X(k) + data(m) * exp(- J*(2.0*Pi)/float(N) * 
float(m*k) );
         END LOOP;
         put(X(k)); new_line;
     END LOOP;

end dft;
================== END ADA ==============

======= FORTRAN code ===========
! dtf.f90, compiled with GCC 4.3.4
! under CYGWIN 1.7.5
! gfortran -Wall dft.f90
! ./a.exe
! (  6.0000000    ,  0.0000000    )
! ( -1.4999999    , 0.86602557    )
! ( -1.5000005    ,-0.86602497    )
!

PROGRAM dft

   IMPLICIT NONE

   INTEGER, PARAMETER :: N = 3
   COMPLEX, parameter :: J =(0,1)

   REAL, parameter :: Pi = ACOS(-1.0)
   INTEGER :: k,m
   COMPLEX, dimension(N) :: X
   REAL, dimension(N) :: data=(/1.0,2.0,3.0/)

DO k=1,N
    X(k)=(0,0)
    DO m=1,N
       X(k) = X(k) + data(m) * EXP(-1.0*J*2.0*Pi/N *(m-1)*(k-1) )
    END DO
    print *,X(k)

END DO

END PROGRAM dft
==================================

==== Matlab code ====
EDU>> fft([1,2,3])'

ans =

    6.0000
   -1.5000 - 0.8660i
   -1.5000 + 0.8660i
===============================

=== Mathematica ====
In[5]:= Chop[Fourier[{1, 2, 3}, FourierParameters -> {1, -1}]]

Out[5]= {6., -1.5 + 0.8660254037844386*I,  -1.5 - 0.8660254037844386*I}
=========================

Conclusion:
I actually liked the Ada implementation more than FORTRAN because:

1. In Ada, I did not have to change the index of m and k in the 
summation to reflect the 1-off per the definition of DFT.
DFT starts from 0 to N-1. In Ada, using 'Range and defining the arrays 
to go from 0 .. N-1 solved the problem.

2. In Ada, the compiler complained more times more about types being 
mixed up. I placed float() around the places it complained about.

3. It actually took me less time to do the Ada function than the FORTRAN 
one, even though I am equally not familiar with both at this time :)

ok, this was a fun learning exercise


--Nasser



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-09 10:49 small example, using complex variables in Ada Nasser M. Abbasi
@ 2010-06-09 11:26 ` Ludovic Brenta
  2010-06-09 23:50   ` Jerry
  2010-06-10 15:48   ` Colin Paul Gloster
  2010-06-09 12:43 ` Niklas Holsti
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 32+ messages in thread
From: Ludovic Brenta @ 2010-06-09 11:26 UTC (permalink / raw)


On Jun 9, 12:49 pm, "Nasser M. Abbasi" <n...@12000.org> wrote:
> I never used complex variables before in Ada, so for the last 3 hrs I
> was learning how to do it. I wrote a simple program, to find the DFT of
> an array of 3 elements {1,2,3} (DFT=discrete Fourier transform).
>
> The definition of DFT is one equation with summation, here it is, first
> equation you'll see:
>
> http://en.wikipedia.org/wiki/Discrete_Fourier_transform
>
> Since I have not programmed in Ada nor in FORTRAN for a looong time, I
> am very rusty, I program in Mathematica and sometimes in matlab these
> days, but I wanted to try Ada on complex numbers.
>
> I also wrote a FORTRAN equivalent of the small Ada function.  Here is
> below the Ada code, and the FORTRAN code.  Again, do not scream too much
> if it is not good code, I just learned this now, I am sure this can be
> improved a lot.
>
> And for comparing, I show the Matlab and the Mathematica output just to
> make sure.
>
> ====== START ADA ============
> --
> -- dtf.adb, compiled with GNAT 4.3.4 20090804 (release) 1
> -- under CYGWIN 1.7.5
> -- gnatmake dft.adb
> --
> -- ./dft.exe
> -- ( 6.00000E+00, 0.00000E+00)
> -- (-1.50000E+00, 8.66026E-01)
> -- (-1.50000E+00,-8.66025E-01)
> -- $
>
> with Ada.Text_IO; use Ada.Text_IO;
> with Ada.Numerics.Complex_Types; use  Ada.Numerics.Complex_Types;
>
> with Ada.Numerics; use  Ada.Numerics;
>
> with Ada.Numerics.Complex_Elementary_Functions;
> use  Ada.Numerics.Complex_Elementary_Functions;
>
> with Ada.Complex_Text_IO; use Ada.Complex_Text_IO;
>
> procedure dft is
>      N : positive := 3;
>      J : constant complex :=(0.0,1.0);  -- SQRT(-1)
>      X : array(0 .. N-1) of Complex  := (others=>(0.0,0.0));
>      data : array(0 .. N-1) of float :=(1.0,2.0,3.0);
>
> begin
>      FOR k in X'range LOOP
>          FOR m in data'range LOOP
>              X(k) := X(k) + data(m) * exp(- J*(2.0*Pi)/float(N) *
> float(m*k) );
>          END LOOP;
>          put(X(k)); new_line;
>      END LOOP;
>
> end dft;
> ================== END ADA ==============
>
> ======= FORTRAN code ===========
> ! dtf.f90, compiled with GCC 4.3.4
> ! under CYGWIN 1.7.5
> ! gfortran -Wall dft.f90
> ! ./a.exe
> ! (  6.0000000    ,  0.0000000    )
> ! ( -1.4999999    , 0.86602557    )
> ! ( -1.5000005    ,-0.86602497    )
> !
>
> PROGRAM dft
>
>    IMPLICIT NONE
>
>    INTEGER, PARAMETER :: N = 3
>    COMPLEX, parameter :: J =(0,1)
>
>    REAL, parameter :: Pi = ACOS(-1.0)
>    INTEGER :: k,m
>    COMPLEX, dimension(N) :: X
>    REAL, dimension(N) :: data=(/1.0,2.0,3.0/)
>
> DO k=1,N
>     X(k)=(0,0)
>     DO m=1,N
>        X(k) = X(k) + data(m) * EXP(-1.0*J*2.0*Pi/N *(m-1)*(k-1) )
>     END DO
>     print *,X(k)
>
> END DO
>
> END PROGRAM dft
> ==================================
>
> ==== Matlab code ====
> EDU>> fft([1,2,3])'
>
> ans =
>
>     6.0000
>    -1.5000 - 0.8660i
>    -1.5000 + 0.8660i
> ===============================
>
> === Mathematica ====
> In[5]:= Chop[Fourier[{1, 2, 3}, FourierParameters -> {1, -1}]]
>
> Out[5]= {6., -1.5 + 0.8660254037844386*I,  -1.5 - 0.8660254037844386*I}
> =========================
>
> Conclusion:
> I actually liked the Ada implementation more than FORTRAN because:
>
> 1. In Ada, I did not have to change the index of m and k in the
> summation to reflect the 1-off per the definition of DFT.
> DFT starts from 0 to N-1. In Ada, using 'Range and defining the arrays
> to go from 0 .. N-1 solved the problem.
>
> 2. In Ada, the compiler complained more times more about types being
> mixed up. I placed float() around the places it complained about.
>
> 3. It actually took me less time to do the Ada function than the FORTRAN
> one, even though I am equally not familiar with both at this time :)
>
> ok, this was a fun learning exercise

You should use constants and named numbers instead of variables
wherever possible; this simplifies your Ada program. Also, i and j are
predefined so you do not need to declare a "new" value for J:

with Ada.Text_IO; use Ada.Text_IO;
with Ada.Numerics.Complex_Types; use  Ada.Numerics.Complex_Types;

with Ada.Numerics; use  Ada.Numerics;

with Ada.Numerics.Complex_Elementary_Functions;
use  Ada.Numerics.Complex_Elementary_Functions;

with Ada.Complex_Text_IO; use Ada.Complex_Text_IO;

procedure dft is
     N : constant := 3; -- named number, no conversion to Float needed
     X : array(0 .. N-1) of Complex  := (others=>(0.0,0.0));
     data : constant array(0 .. N-1) of float :=(1.0,2.0,3.0);
     Two_Pi_Over_N : constant := 2 * Pi / N;
      -- named number, outside the loop, like in ARM 3.3.2(9)
begin
     FOR k in X'range LOOP
         FOR m in data'range LOOP
             X(k) := X(k) + data(m) * exp(- J*Two_Pi_Over_N *
float(m*k) );
         END LOOP;
         put(X(k)); new_line;
     END LOOP;
end dft;

--
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-09 10:49 small example, using complex variables in Ada Nasser M. Abbasi
  2010-06-09 11:26 ` Ludovic Brenta
@ 2010-06-09 12:43 ` Niklas Holsti
  2010-06-10  7:23 ` Stephen Leake
  2010-06-14  9:33 ` Vincent LAFAGE
  3 siblings, 0 replies; 32+ messages in thread
From: Niklas Holsti @ 2010-06-09 12:43 UTC (permalink / raw)


Nasser M. Abbasi wrote [much snipped]:
> I wrote a simple program, to find the DFT of 
> an array of 3 elements {1,2,3} (DFT=discrete Fourier transform).
> I also wrote a FORTRAN equivalent of the small Ada function.  Here is 
> below the Ada code, and the FORTRAN code.
> 
> ====== START ADA ============
>             X(k) := X(k) + data(m) * exp(- J*(2.0*Pi)/float(N) * 
> float(m*k) );

> ======= FORTRAN code ===========
>       X(k) = X(k) + data(m) * EXP(-1.0*J*2.0*Pi/N *(m-1)*(k-1) )

There is an obscure difference in these computations, which can cause 
trouble when the data vector is much longer than the N = 3 in the 
example. The Ada version may then fail because the product m*k may 
overflow the Integer range. It would be safer to write float(m)*float(k).

In the Fortran version, as far as I understand the Fortran rules, the 
compiler may choose to multiply the integer subexpressions (m-1) and 
(k-1) as integers, and then convert the product to REAL (as is done in 
Nasser's Ada version), or the compiler may choose to convert separately 
(m-1) to REAL and (k-1) to REAL and use REAL multiplication, as I 
suggest above for the Ada code. IIUC it would be safer in Fortran, too, 
to prevent integer overflow by explicit conversions of (m-1) and (k-1) 
to REAL before multiplication.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-09 11:26 ` Ludovic Brenta
@ 2010-06-09 23:50   ` Jerry
  2010-06-10  1:03     ` Jeffrey R. Carter
  2010-06-10 15:48   ` Colin Paul Gloster
  1 sibling, 1 reply; 32+ messages in thread
From: Jerry @ 2010-06-09 23:50 UTC (permalink / raw)


On Jun 9, 4:26 am, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:
snip
>      Two_Pi_Over_N : constant := 2 * Pi / N;
>       -- named number, outside the loop, like in ARM 3.3.2(9)
snip
> Ludovic Brenta.

So 2 and N are universal_integer and Pi is probably a universal_real.
I didn't know that one could ever do mixed-mode arithmetic in Ada, but
this is obviously allowed here. By the way, I don't see where in ARM
3.3.2 this mixed operation is described. Line 9 on that ARM page uses
2.0*Ada.Numerics.Pi which is not mixed mode. Is this described
somewhere else?

Jerry



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-09 23:50   ` Jerry
@ 2010-06-10  1:03     ` Jeffrey R. Carter
  0 siblings, 0 replies; 32+ messages in thread
From: Jeffrey R. Carter @ 2010-06-10  1:03 UTC (permalink / raw)


Jerry wrote:
> 
> So 2 and N are universal_integer and Pi is probably a universal_real.
> I didn't know that one could ever do mixed-mode arithmetic in Ada, but
> this is obviously allowed here. By the way, I don't see where in ARM
> 3.3.2 this mixed operation is described. Line 9 on that ARM page uses
> 2.0*Ada.Numerics.Pi which is not mixed mode. Is this described
> somewhere else?

In ARM 4.5.5 you'll find

function "*"(Left : root_real; Right : root_integer) return root_real
function "*"(Left : root_integer; Right : root_real) return root_real
function "/"(Left : root_real; Right : root_integer) return root_real

-- 
Jeff Carter
"I've got to stay here, but there's no reason
why you folks shouldn't go out into the lobby
until this thing blows over."
Horse Feathers
50



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-09 10:49 small example, using complex variables in Ada Nasser M. Abbasi
  2010-06-09 11:26 ` Ludovic Brenta
  2010-06-09 12:43 ` Niklas Holsti
@ 2010-06-10  7:23 ` Stephen Leake
  2010-06-10  9:12   ` J-P. Rosen
  2010-06-10  9:34   ` Nasser M. Abbasi
  2010-06-14  9:33 ` Vincent LAFAGE
  3 siblings, 2 replies; 32+ messages in thread
From: Stephen Leake @ 2010-06-10  7:23 UTC (permalink / raw)


"Nasser M. Abbasi" <nma@12000.org> writes:

> I also wrote a FORTRAN equivalent of the small Ada function.  Here is
> below the Ada code, and the FORTRAN code.  Again, do not scream too
> much if it is not good code, I just learned this now, I am sure this
> can be improved a lot.

This is an interesting comparison. Perhaps, after people finish
polishing your code, you could publish it on
http://en.wikibooks.org/wiki/Ada_Programming 

> -- gnatmake dft.adb
> --
> -- ./dft.exe
> -- ( 6.00000E+00, 0.00000E+00)
> -- (-1.50000E+00, 8.66026E-01)
> -- (-1.50000E+00,-8.66025E-01)
> -- $
>
> ======= FORTRAN code ===========
> ! dtf.f90, compiled with GCC 4.3.4
> ! under CYGWIN 1.7.5
> ! gfortran -Wall dft.f90
> ! ./a.exe
> ! (  6.0000000    ,  0.0000000    )
> ! ( -1.4999999    , 0.86602557    )
> ! ( -1.5000005    ,-0.86602497    )
> !

It would be good to explain the small differences here; something about
how the floating point options are set, I suspect.

It would be good to state the theoretically correct answer; I hope it's
1.5, not 1.499... :).

> Conclusion:
> I actually liked the Ada implementation more than FORTRAN because:
>
> 1. In Ada, I did not have to change the index of m and k in the
> summation to reflect the 1-off per the definition of DFT.
> DFT starts from 0 to N-1. In Ada, using 'Range and defining the arrays
> to go from 0 .. N-1 solved the problem.
>
> 2. In Ada, the compiler complained more times more about types being
> mixed up. I placed float() around the places it complained about.

It's interesting that you list this as a bonus; some people would list
it is a negative feature ("_obviously_ the compiler should do that
conversion for you!").

> 3. It actually took me less time to do the Ada function than the
> FORTRAN one, even though I am equally not familiar with both at this
> time :)

That is my general experience with Ada; it takes less time to get the
result I want.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10  7:23 ` Stephen Leake
@ 2010-06-10  9:12   ` J-P. Rosen
  2010-06-10 11:03     ` Yannick Duchêne (Hibou57)
  2010-06-10  9:34   ` Nasser M. Abbasi
  1 sibling, 1 reply; 32+ messages in thread
From: J-P. Rosen @ 2010-06-10  9:12 UTC (permalink / raw)


Stephen Leake a �crit :
>> -- gnatmake dft.adb
>> --
>> -- ./dft.exe
>> -- ( 6.00000E+00, 0.00000E+00)
>> -- (-1.50000E+00, 8.66026E-01)
>> -- (-1.50000E+00,-8.66025E-01)
>> -- $
>>
>> ======= FORTRAN code ===========
>> ! dtf.f90, compiled with GCC 4.3.4
>> ! under CYGWIN 1.7.5
>> ! gfortran -Wall dft.f90
>> ! ./a.exe
>> ! (  6.0000000    ,  0.0000000    )
>> ! ( -1.4999999    , 0.86602557    )
>> ! ( -1.5000005    ,-0.86602497    )
>> !
> 
> It would be good to explain the small differences here; something about
> how the floating point options are set, I suspect.
In Ada, the value is rounded to the requested accuracy (A.10.9(25)). In
Fortran, the machine value is printed.

> It would be good to state the theoretically correct answer; I hope it's
> 1.5, not 1.499... :).
Note that they are mathematically equal (with an inifinite number of 9s)
-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10  7:23 ` Stephen Leake
  2010-06-10  9:12   ` J-P. Rosen
@ 2010-06-10  9:34   ` Nasser M. Abbasi
  2010-06-10 20:12     ` Simon Wright
  1 sibling, 1 reply; 32+ messages in thread
From: Nasser M. Abbasi @ 2010-06-10  9:34 UTC (permalink / raw)


On 6/10/2010 12:23 AM, Stephen Leake wrote:

>
>> -- gnatmake dft.adb
>> --
>> -- ./dft.exe
>> -- ( 6.00000E+00, 0.00000E+00)
>> -- (-1.50000E+00, 8.66026E-01)
>> -- (-1.50000E+00,-8.66025E-01)
>> -- $
>>
>> ======= FORTRAN code ===========
>> ! dtf.f90, compiled with GCC 4.3.4
>> ! under CYGWIN 1.7.5
>> ! gfortran -Wall dft.f90
>> ! ./a.exe
>> ! (  6.0000000    ,  0.0000000    )
>> ! ( -1.4999999    , 0.86602557    )
>> ! ( -1.5000005    ,-0.86602497    )
>> !
>

> It would be good to explain the small differences here; something about
> how the floating point options are set, I suspect.
>

Yes, I noticed that too. Need to look more into. It could be just a 
formating thing. I just used Print*, in Fortran becuase at the time was 
too lazy to lookin up the other formating functions in Fortran. In Ada, 
I used the predefined Put on Complex of float types.

> It would be good to state the theoretically correct answer; I hope it's
> 1.5, not 1.499... :).
>

Well, the extact answer is -1.5 for the real part of those terms.

Can be seen also by using a CAS such as Mathematica which allows one to 
set an arbitrary precision. Here is one with 50 precision:

SetPrecision[Fourier[{1., 2., 3.}, FourierParameters ->{1, -1}],50]


{6.0000000000000000000000000000000000000000000000000+0.*10^-50 I,

-1.5000000000000000000000000000000000000000000000000 +
0.8660254037844385965340919530941476978114224039018 I,

-1.5000000000000000000000000000000000000000000000000
-0.8660254037844385965340919530941476978114224039018 I}

So, it is 1.5 not 1.499999... (can also be seen by expanding the sum 
itself. and using Euler relation to convert exp() to trig functions and 
looking at the resulting cosine and sin terms, one can see this term 
comes out to be an exact -3/2).

well look into why Fortan prints -1.499999 and correct my code if it is 
because I am not doing something right.


--Nasser



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10  9:12   ` J-P. Rosen
@ 2010-06-10 11:03     ` Yannick Duchêne (Hibou57)
  2010-06-10 13:27       ` J-P. Rosen
  0 siblings, 1 reply; 32+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-06-10 11:03 UTC (permalink / raw)


>> It would be good to state the theoretically correct answer; I hope it's
>> 1.5, not 1.499... :).
> Note that they are mathematically equal (with an inifinite number of 9s)
I'm not using so called Reals, so I am not at ease with details in this  
area: is it specified by the Ada standard or by the IEEE standard ? (I  
know Ada follows IEEE standard, while may be Ada adds some extra stuff  
there)

Humor: where did you ever see an infinite sequence in a computer ? (except  
in a never-ending loop)

-- 
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
--  i.e. forget about previous premises which leads to conclusion
--  and start with new conclusion as premise.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 11:03     ` Yannick Duchêne (Hibou57)
@ 2010-06-10 13:27       ` J-P. Rosen
  2010-06-10 21:15         ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 32+ messages in thread
From: J-P. Rosen @ 2010-06-10 13:27 UTC (permalink / raw)


Yannick Duchï¿œne (Hibou57) a ï¿œcrit :
>>> It would be good to state the theoretically correct answer; I hope it's
>>> 1.5, not 1.499... :).
>> Note that they are mathematically equal (with an inifinite number of 9s)
> I'm not using so called Reals, so I am not at ease with details in this
> area: is it specified by the Ada standard or by the IEEE standard ? (I
> know Ada follows IEEE standard, while may be Ada adds some extra stuff
> there)
For output, rounding is specified in the standard. And BTW, the standard
does not specify IEEE (fortunately, it did not make the same mistake as
Java!). It just makes sure that it is not incompatible with IEEE
arithmetic, and does provide some facilities for handling signed zeroes,
which are present in IEEE, but maybe also provided by other models.

> Humor: where did you ever see an infinite sequence in a computer ?
> (except in a never-ending loop)
> 
I said "mathematically", because of the "..." that followed the last
'9'. But for computers, anybody doing some number crunching should know
that computations are not exact, and that 1.49* should be considered the
same as 1.5

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 15:48   ` Colin Paul Gloster
@ 2010-06-10 14:54     ` Ludovic Brenta
  2010-06-10 16:21       ` Colin Paul Gloster
  2010-06-17  7:44     ` Gautier write-only
  1 sibling, 1 reply; 32+ messages in thread
From: Ludovic Brenta @ 2010-06-10 14:54 UTC (permalink / raw)


On Jun 10, 5:48 pm, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org>
wrote:
> On Wed, 9 Jun 2010, Ludovic Brenta sent:
>
> |     Two_Pi_Over_N : constant := 2 * Pi / N;|
>
> That is a good suggestion.
>
> |"     FOR k in X'range LOOP"                |
>
> No.

Why?

> |"         FOR m in data'range LOOP          |
>
> No. Loop down to zero.

Why?

> If utilizing FOR instead of WHILE, then utilize REVERSE.

Generally, FOR is much better than WHILE because, the instant you see
FOR, you know the loop is finite; the moment you see WHILE you must
look at the exit condition and the body of the loop before you know
whether it terminates or not.

> Additionally, loop unrolling should be considered.

I agree with this but the solution would be less general.

--
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-09 11:26 ` Ludovic Brenta
  2010-06-09 23:50   ` Jerry
@ 2010-06-10 15:48   ` Colin Paul Gloster
  2010-06-10 14:54     ` Ludovic Brenta
  2010-06-17  7:44     ` Gautier write-only
  1 sibling, 2 replies; 32+ messages in thread
From: Colin Paul Gloster @ 2010-06-10 15:48 UTC (permalink / raw)


On Wed, 9 Jun 2010, Ludovic Brenta sent:

|--------------------------------------------|
|"[..]                                       |
|     Two_Pi_Over_N : constant := 2 * Pi / N;|
|[..]"                                       |
|--------------------------------------------|

That is a good suggestion.

|--------------------------------------------|
|"     FOR k in X'range LOOP"                |
|--------------------------------------------|

No.

|--------------------------------------------|
|"         FOR m in data'range LOOP          |
|[..]"                                       |
|--------------------------------------------|

No. Loop down to zero. If utilizing FOR instead of WHILE, then utilize
REVERSE.

Additionally, loop unrolling should be considered.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 14:54     ` Ludovic Brenta
@ 2010-06-10 16:21       ` Colin Paul Gloster
  2010-06-10 17:37         ` Adam Beneschan
  2010-06-10 17:57         ` Jeffrey R. Carter
  0 siblings, 2 replies; 32+ messages in thread
From: Colin Paul Gloster @ 2010-06-10 16:21 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 2488 bytes --]

On Thu, 10 Jun 2010, Ludovic Brenta sent:

|---------------------------------------------------------------------|
|"On Jun 10, 5:48 pm, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org> |
|wrote:                                                               |
|> On Wed, 9 Jun 2010, Ludovic Brenta sent:                           |
|>                                                                    |
|> |     Two_Pi_Over_N : constant := 2 * Pi / N;|                     |
|>                                                                    |
|> That is a good suggestion.                                         |
|>                                                                    |
|> |"     FOR k in X'range LOOP"                |                     |
|>                                                                    |
|> No.                                                                |
|                                                                     |
|Why?                                                                 |
|                                                                     |
|> |"         FOR m in data'range LOOP          |                     |
|>                                                                    |
|> No. Loop down to zero.                                             |
|                                                                     |
|Why?"                                                                |
|---------------------------------------------------------------------|

Though there should be no difference, in reality compilers produce
less slow machine code when looping down to zero instead of up from
zero.

|---------------------------------------------------------------------|
|"[..]                                                                |
|                                                                     |
|> Additionally, loop unrolling should be considered.                 |
|                                                                     |
|I agree with this but the solution would be less general."           |
|---------------------------------------------------------------------|

True.

Complementing Mathematica with Ada does not indicate that the source
code in Ada is supposed to be general instead of fast. The strides in
those loops are really indicative that the loops could be worth
unrolling or running concurrently.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 16:21       ` Colin Paul Gloster
@ 2010-06-10 17:37         ` Adam Beneschan
  2010-06-10 17:57         ` Jeffrey R. Carter
  1 sibling, 0 replies; 32+ messages in thread
From: Adam Beneschan @ 2010-06-10 17:37 UTC (permalink / raw)


On Jun 10, 9:21 am, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org>
wrote:
> On Thu, 10 Jun 2010, Ludovic Brenta sent:
>
> |---------------------------------------------------------------------|
> |"On Jun 10, 5:48 pm, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org> |
> |wrote:                                                               |
> |> On Wed, 9 Jun 2010, Ludovic Brenta sent:                           |
> |>                                                                    |
> |> |     Two_Pi_Over_N : constant := 2 * Pi / N;|                     |
> |>                                                                    |
> |> That is a good suggestion.                                         |
> |>                                                                    |
> |> |"     FOR k in X'range LOOP"                |                     |
> |>                                                                    |
> |> No.                                                                |
> |                                                                     |
> |Why?                                                                 |
> |                                                                     |
> |> |"         FOR m in data'range LOOP          |                     |
> |>                                                                    |
> |> No. Loop down to zero.                                             |
> |                                                                     |
> |Why?"                                                                |
> |---------------------------------------------------------------------|
>
> Though there should be no difference, in reality compilers produce
> less slow machine code when looping down to zero instead of up from
> zero.

I don't think you can state that categorically.  We don't even know
what processor the OP was generating code for.  Not all of them have
"decrement and branch if nonnegative" instructions.  In any event, I
think the only way to really know which one is faster is to try it, or
to examine the generated code---and the latter probably isn't good
enough these days, with all the pipelining that goes on.

                      -- Adam

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 16:21       ` Colin Paul Gloster
  2010-06-10 17:37         ` Adam Beneschan
@ 2010-06-10 17:57         ` Jeffrey R. Carter
  2010-06-10 22:32           ` Randy Brukardt
  1 sibling, 1 reply; 32+ messages in thread
From: Jeffrey R. Carter @ 2010-06-10 17:57 UTC (permalink / raw)


Colin Paul Gloster wrote:
> 
> Though there should be no difference, in reality compilers produce
> less slow machine code when looping down to zero instead of up from
> zero.

The root of all evil.

-- 
Jeff Carter
"You a big nose have it."
Never Give a Sucker an Even Break
107



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10  9:34   ` Nasser M. Abbasi
@ 2010-06-10 20:12     ` Simon Wright
  0 siblings, 0 replies; 32+ messages in thread
From: Simon Wright @ 2010-06-10 20:12 UTC (permalink / raw)


"Nasser M. Abbasi" <nma@12000.org> writes:

> On 6/10/2010 12:23 AM, Stephen Leake wrote:
>
>>
>>> -- gnatmake dft.adb
>>> --
>>> -- ./dft.exe
>>> -- ( 6.00000E+00, 0.00000E+00)
>>> -- (-1.50000E+00, 8.66026E-01)
>>> -- (-1.50000E+00,-8.66025E-01)
>>> -- $
>>>
>>> ======= FORTRAN code ===========
>>> ! dtf.f90, compiled with GCC 4.3.4
>>> ! under CYGWIN 1.7.5
>>> ! gfortran -Wall dft.f90
>>> ! ./a.exe
>>> ! (  6.0000000    ,  0.0000000    )
>>> ! ( -1.4999999    , 0.86602557    )
>>> ! ( -1.5000005    ,-0.86602497    )
>>> !
>>
>
>> It would be good to explain the small differences here; something about
>> how the floating point options are set, I suspect.
>>
>
> Yes, I noticed that too. Need to look more into. It could be just a
> formating thing. I just used Print*, in Fortran becuase at the time
> was too lazy to lookin up the other formating functions in Fortran. In
> Ada, I used the predefined Put on Complex of float types.

I tried with
   put(X(k), Aft => 8, Exp => 0); new_line;
(to match the number of digits output by the Fortran) and got

( 6.00000000, 0.00000000)
(-1.49999988, 0.86602557)
(-1.50000024,-0.86602497)

so I think it's just a formatting thing (though that -1.50000024 looks a
little off; but Float is digits 6 on this hardware - Macbook Pro, so
those last 3 digits are spurious).



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 13:27       ` J-P. Rosen
@ 2010-06-10 21:15         ` Yannick Duchêne (Hibou57)
  2010-06-11  7:22           ` Dmitry A. Kazakov
  2010-06-11  8:48           ` J-P. Rosen
  0 siblings, 2 replies; 32+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-06-10 21:15 UTC (permalink / raw)


Le Thu, 10 Jun 2010 15:27:38 +0200, J-P. Rosen <rosen@adalog.fr> a écrit:
> For output, rounding is specified in the standard. And BTW, the standard
> does not specify IEEE (fortunately, it did not make the same mistake as
> Java!).
Which mistake ? (not to disagree, just to understand)


-- 
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
--  i.e. forget about previous premises which leads to conclusion
--  and start with new conclusion as premise.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 17:57         ` Jeffrey R. Carter
@ 2010-06-10 22:32           ` Randy Brukardt
  2010-06-11 12:42             ` Colin Paul Gloster
  0 siblings, 1 reply; 32+ messages in thread
From: Randy Brukardt @ 2010-06-10 22:32 UTC (permalink / raw)


"Jeffrey R. Carter" <spam.jrcarter.not@spam.acm.org> wrote in message 
news:hur95a$3oh$1@tornado.tornevall.net...
> Colin Paul Gloster wrote:
>>
>> Though there should be no difference, in reality compilers produce
>> less slow machine code when looping down to zero instead of up from
>> zero.
>
> The root of all evil.

Goody, we're playing Jeopardy! I assume that was "Programming" for 200. :-)

Q: What is premature optimization??

                            Randy.





^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 21:15         ` Yannick Duchêne (Hibou57)
@ 2010-06-11  7:22           ` Dmitry A. Kazakov
  2010-06-11  8:48           ` J-P. Rosen
  1 sibling, 0 replies; 32+ messages in thread
From: Dmitry A. Kazakov @ 2010-06-11  7:22 UTC (permalink / raw)


On Thu, 10 Jun 2010 23:15:37 +0200, Yannick Duch�ne (Hibou57) wrote:

> Le Thu, 10 Jun 2010 15:27:38 +0200, J-P. Rosen <rosen@adalog.fr> a �crit:
>> For output, rounding is specified in the standard. And BTW, the standard
>> does not specify IEEE (fortunately, it did not make the same mistake as
>> Java!).
> Which mistake ? (not to disagree, just to understand)

Making language hardware-dependent.

Plus, IEEE is not very good for computational and engineering tasks. In
particular, when programming in Ada, you should better kill IEEE semantics
regarding overflows for built-in types. E.g.

   type Real is new Float range Float'Range; -- Now it works as it has to

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 21:15         ` Yannick Duchêne (Hibou57)
  2010-06-11  7:22           ` Dmitry A. Kazakov
@ 2010-06-11  8:48           ` J-P. Rosen
  2010-06-11 12:00             ` Brian Drummond
  1 sibling, 1 reply; 32+ messages in thread
From: J-P. Rosen @ 2010-06-11  8:48 UTC (permalink / raw)


Yannick Duchï¿œne (Hibou57) a ï¿œcrit :
> Le Thu, 10 Jun 2010 15:27:38 +0200, J-P. Rosen <rosen@adalog.fr> a ï¿œcrit:
>> For output, rounding is specified in the standard. And BTW, the standard
>> does not specify IEEE (fortunately, it did not make the same mistake as
>> Java!).
> Which mistake ? (not to disagree, just to understand)
> 
What can you do if you have a non-IEEE machine (number crunchers like
Silicon-Graphics machine are not IEEE)? Either emulate IEEE in software,
but you are wasting speed and the money you invested in such machines,
or implement Java with the native arithmetic, ignoring the standard =>
total failure of the standard.

There is an interesting paper on the internet about why Java failed on
numerics. Sorry, I don't have the exact reference at hand, but it should
be easy to find.
-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-11  8:48           ` J-P. Rosen
@ 2010-06-11 12:00             ` Brian Drummond
  0 siblings, 0 replies; 32+ messages in thread
From: Brian Drummond @ 2010-06-11 12:00 UTC (permalink / raw)


On Fri, 11 Jun 2010 10:48:37 +0200, "J-P. Rosen" <rosen@adalog.fr> wrote:

>Yannick Duch�ne (Hibou57) a �crit :
>> Le Thu, 10 Jun 2010 15:27:38 +0200, J-P. Rosen <rosen@adalog.fr> a �crit:
>>> For output, rounding is specified in the standard. And BTW, the standard
>>> does not specify IEEE (fortunately, it did not make the same mistake as
>>> Java!).
>> Which mistake ? (not to disagree, just to understand)
...
>There is an interesting paper on the internet about why Java failed on
>numerics. Sorry, I don't have the exact reference at hand, but it should
>be easy to find.

At a wild guess, easy to find for anyone who's heard of Prof Kahan.

But just in case... I presume you mean
http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf

On the other hand, the abstract starts:
"Java�s floating-point arithmetic is blighted by five gratuitous mistakes:"

So perhaps the original question "which mistake?" still stands; 
nos 3) and 4) look particularly bad.

- Brian




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 22:32           ` Randy Brukardt
@ 2010-06-11 12:42             ` Colin Paul Gloster
  2010-06-11 18:59               ` Randy Brukardt
  0 siblings, 1 reply; 32+ messages in thread
From: Colin Paul Gloster @ 2010-06-11 12:42 UTC (permalink / raw)


On Thursday 10th June 2010, Randy Brukardt sent via Jacob Sparre
Andersen's netnews transfer protocol server:
|---------------------------------------------------------------------------|
|""Jeffrey R. Carter" <spam.jrcarter.not@spam.acm.org> wrote in message     |
|news:hur95a$3oh$1@tornado.tornevall.net...                                 |
|> Colin Paul Gloster wrote:                                                |
|>>                                                                         |
|>> Though there should be no difference, in reality compilers produce      |
|>> less slow machine code when looping down to zero instead of up from     |
|>> zero.                                                                   |
|>                                                                          |
|> The root of all evil.                                                    |
|                                                                           |
|Goody, we're playing Jeopardy! I assume that was "Programming" for 200. :-)|
|                                                                           |
|Q: What is premature optimization??                                        |
|                                                                           |
|                            Randy."                                        |
|---------------------------------------------------------------------------|

Jeffrey R. Carter and Randall L. Brukardt,

If any of you claims that you posted an unclear phrase which had not
been intended to be libelous which looks like you accused me of
inappropriately trying to apply premature optimization, then clarify
or be sued for libel. You had already known that I had made major
improvements in speed to simulations which I depend on in order to
stay alive this year (unfortunately the funding shall end in December
2010 no matter how well I do), and that speeding up just one per cent
results in a valuable improvement of hours.

Nasser M. Abbasi was not reverting to Ada as a complement to
Mathematica with the objective of producing slower software than
Mathematica.

Yours sincerely,
Colin Paul Gloster



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-11 12:42             ` Colin Paul Gloster
@ 2010-06-11 18:59               ` Randy Brukardt
  2010-06-14 19:19                 ` Colin Paul Gloster
  0 siblings, 1 reply; 32+ messages in thread
From: Randy Brukardt @ 2010-06-11 18:59 UTC (permalink / raw)


"Colin Paul Gloster" <Colin_Paul_Gloster@ACM.org> wrote in message 
news:alpine.LNX.2.00.1006111207170.3608@Bluewhite64.example.net...
...
> If any of you claims that you posted an unclear phrase which had not
> been intended to be libelous which looks like you accused me of
> inappropriately trying to apply premature optimization, then clarify
> or be sued for libel.

Don't be so sensitive!

Optimization is premature unless there is a demonstrated need for additional 
performance.

In any case, being guilty of premature optimization has almost no reflection 
on how good or bad of a programmer you are (something I am not in any 
position to judge). The best programmers are still guilty of it from time to 
time. I know I've been guilty of it multiple times, and it is useful to have 
outsiders point that out, in order that I don't repeat the same mistake on 
my next project. And it's very useful to repeat the mantra over and over, in 
order to reduce the temptation.

> You had already known that I had made major
> improvements in speed to simulations which I depend on in order to
> stay alive this year (unfortunately the funding shall end in December
> 2010 no matter how well I do), and that speeding up just one per cent
> results in a valuable improvement of hours.

Sure there are cases like that; your work application has a demonstrated 
need for more performance. Such situations are rare, however. I spent a lot 
of effort optimizing lookup times in our spam filter, only to find out that 
it wasn't a signifiant percentage of the filtering effort.

And you have to know that I have been writing optimizing Ada compilers for 
the last 30 years (well, 29 years and 9 months to be exact), so I know how 
to performance optimize when necessary. But...

> Nasser M. Abbasi was not reverting to Ada as a complement to
> Mathematica with the objective of producing slower software than
> Mathematica.

My understanding was that the OP was comparing the readability and 
ease-of-creation of Fortran and Ada. I saw no indication that he was 
concerned about the performance. And in many cases, the performance of the 
code isn't very relevant. (Remember the 90/10 rule!) In the absence of a 
demonstrated need for better performance, making the code less readable is a 
bad idea, no matter what effect it has on performance. That's exactly the 
definition of premature optimization, in my opinion.

                                      Randy.

P.S. I wouldn't waste time on suing someone. Only the lawyers make money in 
most lawsuits. 





^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-09 10:49 small example, using complex variables in Ada Nasser M. Abbasi
                   ` (2 preceding siblings ...)
  2010-06-10  7:23 ` Stephen Leake
@ 2010-06-14  9:33 ` Vincent LAFAGE
  2010-06-14 12:29   ` Nasser M. Abbasi
  3 siblings, 1 reply; 32+ messages in thread
From: Vincent LAFAGE @ 2010-06-14  9:33 UTC (permalink / raw)


Hi,

I would like to give some comments on your conclusion.
In fact, I have to disagree with this conclusion.

 > 1. In Ada, I did not have to change the index of m and k in the
 > summation to reflect the 1-off per the definition of DFT.
 > DFT starts from 0 to N-1. In Ada, using 'Range and defining the arrays
 > to go from 0 .. N-1 solved the problem.

It is a cliche that Fortran's index have to start at 1.
It was already possible in Fortran 77 to start indexes for where you 
want it to start.
look for instance at 
http://www.physics.nau.edu/~bowman/PHY520/F77tutor/10_arrays.html
       real b(0:19), weird(-162:237)

In your case, it would lead to
   COMPLEX, dimension (0:N-1) :: X
   REAL, dimension (0:N-1) :: data=(/1.0,2.0,3.0/)

In Fortran 90, you do not have the very convenient X'range
but you can use the following statement to keep generality
   DO k = lbound (X, 1), ubound (X, 1)

When speaking about Fortran, we should not forget to specify which one,
Fortran 90 being a completely different beast.
As far as we can compare, the writer of Fortran 90 have drawn a lot from 
Ada 83.

 > 2. In Ada, the compiler complained more times more about types being
 > mixed up. I placed float() around the places it complained about.

We can certainly complain about the implicit type promotion of Fortran.
Still modern compiler provides the same safe-guard against the implicit 
type promotion of Fortran.
For instance,
  $ gfortran-4.3 -Wall -Wsurprising -Wconversion dft.f90 -o dft
will reveal 11 surprising implicit conversion such as
  dft.f90:14.29:
   COMPLEX, parameter :: J =(0,1)
                              1
  Warning: Conversion from INTEGER(4) to REAL(4) at (1)

So "-Wall" is not the last word as far as warning are concerned.

 > 3. It actually took me less time to do the Ada function than the FORTRAN
 > one, even though I am equally not familiar with both at this time :)

A 17 Statement Line Of Code example is not really anything close to 
realistic example for scaling.
Not only the sample size is small, but what is more, it doesn't scale 
linearly, or in the same way.
Besides, you did not tell us how long it took in either case. But that 
would be telling... ;)

I am also an Ada enthusiast, but it does not prevent my being a Fortran 
enthusiast as well.

Best regards,
Vincent

Le 09/06/2010 12:49, Nasser M. Abbasi a �crit :
> I never used complex variables before in Ada, so for the last 3 hrs I
> was learning how to do it. I wrote a simple program, to find the DFT of
> an array of 3 elements {1,2,3} (DFT=discrete Fourier transform).
>
> The definition of DFT is one equation with summation, here it is, first
> equation you'll see:
>
> http://en.wikipedia.org/wiki/Discrete_Fourier_transform
>
> Since I have not programmed in Ada nor in FORTRAN for a looong time, I
> am very rusty, I program in Mathematica and sometimes in matlab these
> days, but I wanted to try Ada on complex numbers.
>
> I also wrote a FORTRAN equivalent of the small Ada function. Here is
> below the Ada code, and the FORTRAN code. Again, do not scream too much
> if it is not good code, I just learned this now, I am sure this can be
> improved a lot.
>
> And for comparing, I show the Matlab and the Mathematica output just to
> make sure.
>
>
> ====== START ADA ============
> --
> -- dtf.adb, compiled with GNAT 4.3.4 20090804 (release) 1
> -- under CYGWIN 1.7.5
> -- gnatmake dft.adb
> --
> -- ./dft.exe
> -- ( 6.00000E+00, 0.00000E+00)
> -- (-1.50000E+00, 8.66026E-01)
> -- (-1.50000E+00,-8.66025E-01)
> -- $
>
>
> with Ada.Text_IO; use Ada.Text_IO;
> with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types;
>
> with Ada.Numerics; use Ada.Numerics;
>
> with Ada.Numerics.Complex_Elementary_Functions;
> use Ada.Numerics.Complex_Elementary_Functions;
>
> with Ada.Complex_Text_IO; use Ada.Complex_Text_IO;
>
> procedure dft is
> N : positive := 3;
> J : constant complex :=(0.0,1.0); -- SQRT(-1)
> X : array(0 .. N-1) of Complex := (others=>(0.0,0.0));
> data : array(0 .. N-1) of float :=(1.0,2.0,3.0);
>
> begin
> FOR k in X'range LOOP
> FOR m in data'range LOOP
> X(k) := X(k) + data(m) * exp(- J*(2.0*Pi)/float(N) * float(m*k) );
> END LOOP;
> put(X(k)); new_line;
> END LOOP;
>
> end dft;
> ================== END ADA ==============
>
> ======= FORTRAN code ===========
> ! dtf.f90, compiled with GCC 4.3.4
> ! under CYGWIN 1.7.5
> ! gfortran -Wall dft.f90
> ! ./a.exe
> ! ( 6.0000000 , 0.0000000 )
> ! ( -1.4999999 , 0.86602557 )
> ! ( -1.5000005 ,-0.86602497 )
> !
>
> PROGRAM dft
>
> IMPLICIT NONE
>
> INTEGER, PARAMETER :: N = 3
> COMPLEX, parameter :: J =(0,1)
>
> REAL, parameter :: Pi = ACOS(-1.0)
> INTEGER :: k,m
> COMPLEX, dimension(N) :: X
> REAL, dimension(N) :: data=(/1.0,2.0,3.0/)
>
> DO k=1,N
> X(k)=(0,0)
> DO m=1,N
> X(k) = X(k) + data(m) * EXP(-1.0*J*2.0*Pi/N *(m-1)*(k-1) )
> END DO
> print *,X(k)
>
> END DO
>
> END PROGRAM dft
> ==================================
>
> ==== Matlab code ====
> EDU>> fft([1,2,3])'
>
> ans =
>
> 6.0000
> -1.5000 - 0.8660i
> -1.5000 + 0.8660i
> ===============================
>
> === Mathematica ====
> In[5]:= Chop[Fourier[{1, 2, 3}, FourierParameters -> {1, -1}]]
>
> Out[5]= {6., -1.5 + 0.8660254037844386*I, -1.5 - 0.8660254037844386*I}
> =========================
>
> Conclusion:
> I actually liked the Ada implementation more than FORTRAN because:
>
> 1. In Ada, I did not have to change the index of m and k in the
> summation to reflect the 1-off per the definition of DFT.
> DFT starts from 0 to N-1. In Ada, using 'Range and defining the arrays
> to go from 0 .. N-1 solved the problem.
>
> 2. In Ada, the compiler complained more times more about types being
> mixed up. I placed float() around the places it complained about.
>
> 3. It actually took me less time to do the Ada function than the FORTRAN
> one, even though I am equally not familiar with both at this time :)
>
> ok, this was a fun learning exercise
>
>
> --Nasser




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-14  9:33 ` Vincent LAFAGE
@ 2010-06-14 12:29   ` Nasser M. Abbasi
  2010-06-14 13:00     ` Vincent LAFAGE
  0 siblings, 1 reply; 32+ messages in thread
From: Nasser M. Abbasi @ 2010-06-14 12:29 UTC (permalink / raw)


On 6/14/2010 2:33 AM, Vincent LAFAGE wrote:

> For instance,
>    $ gfortran-4.3 -Wall -Wsurprising -Wconversion dft.f90 -o dft
> will reveal 11 surprising implicit conversion such as
>    dft.f90:14.29:
>     COMPLEX, parameter :: J =(0,1)
>                                1
>    Warning: Conversion from INTEGER(4) to REAL(4) at (1)
>
> So "-Wall" is not the last word as far as warning are concerned.
>

Thanks, I did not know about these flags. I am impressed now with FORTRAN.

The f90 compiler, with those flags added, became as annoying, opps, I 
mean as picky as the Ada compiler and complained about all the implicit 
conversions.

Also, with the use of  lbound and ubound in FORTRAN helped make the 
logic simpler by avoiding the 1-off problem.

To update, below is the current version of the example in Ada and 
FORTRAN. I also made a small page where I kept these for reference.

http://12000.org/my_notes/mma_matlab_control/KERNEL/node94.htm

I think now it seems to me, from this simple example, that Ada and 
FORTRAN can be equally good languages for scientific applications.

Thanks for everyone for the suggestions.

============= Ada ====================
--
-- dtf.adb, compiled with GNAT 4.3.4 20090804 (release) 1
-- under CYGWIN 1.7.5
-- $ gnatmake dft.adb
-- gcc -c dft.adb
-- gnatbind -x dft.ali
-- gnatlink dft.ali
-- $ ./dft.exe
--
-- ( 6.00000E+00, 0.00000E+00)
-- (-1.50000E+00, 8.66026E-01)
-- (-1.50000E+00,-8.66025E-01)

with Ada.Text_IO; use Ada.Text_IO;
with Ada.Numerics.Complex_Types; use  Ada.Numerics.Complex_Types;

with Ada.Numerics; use  Ada.Numerics;

with Ada.Numerics.Complex_Elementary_Functions;
use  Ada.Numerics.Complex_Elementary_Functions;

with Ada.Complex_Text_IO; use Ada.Complex_Text_IO;

procedure dft is
      N : constant := 3; -- named number, no conversion to Float needed
      X : array(0 .. N-1) of Complex  := (others=>(0.0,0.0));
      data : constant array(0 .. N-1) of float :=(1.0,2.0,3.0);
      Two_Pi_Over_N : constant := 2 * Pi / N;
       -- named number, outside the loop, like in ARM 3.3.2(9)
begin
      FOR k in X'range LOOP
          FOR m in data'range LOOP
              X(k) := X(k) + data(m)*exp(-J*Two_Pi_Over_N * float(m*k));
          END LOOP;
          put(X(k)); new_line;
      END LOOP;
end dft;

====================== Fortran ======================
! dtf.f90, compiled with GCC 4.3.4
! under CYGWIN 1.7.5
!  $ gfortran -Wall -Wsurprising -Wconversion dft.f90
!  $ ./a.exe
! (  6.0000000    ,  0.0000000    )
! ( -1.4999999    , 0.86602557    )
! ( -1.5000005    ,-0.86602497    )
!  $

PROGRAM dft

   IMPLICIT NONE

   INTEGER, parameter :: N = 3
   COMPLEX, parameter :: J =(0.0,1.0)
   REAL,    parameter :: Pi = ACOS(-1.0)
   INTEGER                   :: k,m
   COMPLEX, dimension(0:N-1) :: X
   REAL,    dimension(0:N-1) :: data=(/1.0,2.0,3.0/)
   REAL,    parameter        :: Two_Pi_Over_N = 2.0*Pi/real(N)

DO k = lbound(X, 1), ubound(X, 1)
    X(k)=(0.0,0.0)
    DO m = lbound(data, 1), ubound(data, 1)
       X(k) = X(k) + complex(data(m),0.0)                   &
              * EXP(-J*complex(Two_Pi_Over_N*real(m*k),0.0))
    END DO
    print *,X(k)
END DO

END PROGRAM dft


--Nasser



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-14 12:29   ` Nasser M. Abbasi
@ 2010-06-14 13:00     ` Vincent LAFAGE
  0 siblings, 0 replies; 32+ messages in thread
From: Vincent LAFAGE @ 2010-06-14 13:00 UTC (permalink / raw)


If we want not only compile-time warning but also run time check
  -fbounds-check

like in
    gfortran -Wall -Wsurprising -Wconversion -fbounds-check dft.f90 -o dft

It can be pretty useful, and close to some of the runtime checks of Ada.

So, if we remember some larger scale results I provided in a former 
thread, with Ada and Fortran being equally good for coding numerical 
application, Fortran 90 is still twice as fast with complex...

Vincent

PS: on a completely different level, we may use less UPPERCASE, as most 
of us are more used to read lower-case or Capitalized.
Particularly for reserved words.
It's less work for our poor programmer's brain.

The same goes for the languages' names as Fortran is no more in 
all-uppercase since Fortran 90, and ADA is the American Dental 
Association. ;)

Le 14/06/2010 14:29, Nasser M. Abbasi a �crit :
> On 6/14/2010 2:33 AM, Vincent LAFAGE wrote:
>
>> For instance,
>> $ gfortran-4.3 -Wall -Wsurprising -Wconversion dft.f90 -o dft
>> will reveal 11 surprising implicit conversion such as
>> dft.f90:14.29:
>> COMPLEX, parameter :: J =(0,1)
>> 1
>> Warning: Conversion from INTEGER(4) to REAL(4) at (1)
>>
>> So "-Wall" is not the last word as far as warning are concerned.
>>
>
> Thanks, I did not know about these flags. I am impressed now with FORTRAN.
>
> The f90 compiler, with those flags added, became as annoying, opps, I
> mean as picky as the Ada compiler and complained about all the implicit
> conversions.
>
> Also, with the use of lbound and ubound in FORTRAN helped make the logic
> simpler by avoiding the 1-off problem.
>
> To update, below is the current version of the example in Ada and
> FORTRAN. I also made a small page where I kept these for reference.
>
> http://12000.org/my_notes/mma_matlab_control/KERNEL/node94.htm
>
> I think now it seems to me, from this simple example, that Ada and
> FORTRAN can be equally good languages for scientific applications.
>
> Thanks for everyone for the suggestions.
>
> ============= Ada ====================
> --
> -- dtf.adb, compiled with GNAT 4.3.4 20090804 (release) 1
> -- under CYGWIN 1.7.5
> -- $ gnatmake dft.adb
> -- gcc -c dft.adb
> -- gnatbind -x dft.ali
> -- gnatlink dft.ali
> -- $ ./dft.exe
> --
> -- ( 6.00000E+00, 0.00000E+00)
> -- (-1.50000E+00, 8.66026E-01)
> -- (-1.50000E+00,-8.66025E-01)
>
> with Ada.Text_IO; use Ada.Text_IO;
> with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types;
>
> with Ada.Numerics; use Ada.Numerics;
>
> with Ada.Numerics.Complex_Elementary_Functions;
> use Ada.Numerics.Complex_Elementary_Functions;
>
> with Ada.Complex_Text_IO; use Ada.Complex_Text_IO;
>
> procedure dft is
> N : constant := 3; -- named number, no conversion to Float needed
> X : array(0 .. N-1) of Complex := (others=>(0.0,0.0));
> data : constant array(0 .. N-1) of float :=(1.0,2.0,3.0);
> Two_Pi_Over_N : constant := 2 * Pi / N;
> -- named number, outside the loop, like in ARM 3.3.2(9)
> begin
> FOR k in X'range LOOP
> FOR m in data'range LOOP
> X(k) := X(k) + data(m)*exp(-J*Two_Pi_Over_N * float(m*k));
> END LOOP;
> put(X(k)); new_line;
> END LOOP;
> end dft;
>
> ====================== Fortran ======================
> ! dtf.f90, compiled with GCC 4.3.4
> ! under CYGWIN 1.7.5
> ! $ gfortran -Wall -Wsurprising -Wconversion dft.f90
> ! $ ./a.exe
> ! ( 6.0000000 , 0.0000000 )
> ! ( -1.4999999 , 0.86602557 )
> ! ( -1.5000005 ,-0.86602497 )
> ! $
>
> PROGRAM dft
>
> IMPLICIT NONE
>
> INTEGER, parameter :: N = 3
> COMPLEX, parameter :: J =(0.0,1.0)
> REAL, parameter :: Pi = ACOS(-1.0)
> INTEGER :: k,m
> COMPLEX, dimension(0:N-1) :: X
> REAL, dimension(0:N-1) :: data=(/1.0,2.0,3.0/)
> REAL, parameter :: Two_Pi_Over_N = 2.0*Pi/real(N)
>
> DO k = lbound(X, 1), ubound(X, 1)
> X(k)=(0.0,0.0)
> DO m = lbound(data, 1), ubound(data, 1)
> X(k) = X(k) + complex(data(m),0.0) &
> * EXP(-J*complex(Two_Pi_Over_N*real(m*k),0.0))
> END DO
> print *,X(k)
> END DO
>
> END PROGRAM dft
>
>
> --Nasser




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-11 18:59               ` Randy Brukardt
@ 2010-06-14 19:19                 ` Colin Paul Gloster
  2010-06-14 19:48                   ` Nasser M. Abbasi
  0 siblings, 1 reply; 32+ messages in thread
From: Colin Paul Gloster @ 2010-06-14 19:19 UTC (permalink / raw)


On June 11th, 2010, Randy Brukardt sent:

|-----------------------------------------------------------------------------|
|""Colin Paul Gloster" <Colin_Paul_Gloster@ACM.org> wrote in message          |
|news:alpine.LNX.2.00.1006111207170.3608@Bluewhite64.example.net...           |
|...                                                                          |
|> If any of you claims that you posted an unclear phrase which had not       |
|> been intended to be libelous which looks like you accused me of            |
|> inappropriately trying to apply premature optimization, then clarify       |
|> or be sued for libel.                                                      |
|                                                                             |
|Don't be so sensitive!"                                                      |
|-----------------------------------------------------------------------------|

Okay, I accept that Randy was not being abusive. Mr. Carter is still
to explain himself.

|-----------------------------------------------------------------------------|
|"Optimization is premature unless there is a demonstrated need for additional|
|performance."                                                                |
|-----------------------------------------------------------------------------|

I understand what you mean. I might even agree somewhat in general,
but not in this particular case. If the program needs to be sped up,
then fiddling with the loops (not just the ones accounting for 90% of
the running time, ideally it should be possible to change the looping
policy across the entire program by changing a single line of code or
a compiler switch) can have a fair impact (admittedly pretty small in
the grand scheme of things, but still worthwhile). Changing from
looping down to zero to looping up from zero is not going to speed
things up (not counting changes in speed caused by for example a
pseudonumber generator affected by the change in the executable: I
have seen this happen); and it is liable to slow things down. Looping
down to zero would be slightly faster, so why not just do it normally?
After making much more dramatic changes to the code in order to speed
it up, if it is still too slow, then turning around loop iterations'
directions wastes manhours to obtain speed which should have been
obtained by default.

Not that looping down to zero is necessarily the best
solution. Fortress by default uses concurrent array indexing. Not that
Fortress succeeds in its all of its goals re parallelism, but a so far
unpublished paper of mine skims on that which you could read after it
is published, if you are interested.

Mr. Carter's policy for looping is hacking, not engineering.

|-----------------------------------------------------------------------------|
|"In any case, being guilty of premature optimization has almost no reflection|
|on how good or bad of a programmer you are (something I am not in any        |
|position to judge)."                                                         |
|-----------------------------------------------------------------------------|

Well I recognize a good language, so I mustn't be completely bad.

|-----------------------------------------------------------------------------|
|"[..]                                                                        |
|                                                                             |
|And you have to know that I have been writing optimizing Ada compilers for   |
|the last 30 years (well, 29 years and 9 months to be exact), so I know how   |
|to performance optimize when necessary. But..."                              |
|-----------------------------------------------------------------------------|

Infinity per cent times how long I have veen writing Ada
compilers. Many of the pseudoC++ programs I use have recently been
ported to Microsoft Windows, but the currently most important one
(critical pieces of which I am porting to Ada) still has not been
compiled on Windows the last I heard. So maybe I will be ready to
order an RR optimizing compiler for Windows this year, or maybe you
will get round to releasing another GNU/Linux one.

|-----------------------------------------------------------------------------|
|"> Nasser M. Abbasi was not reverting to Ada as a complement to              |
|> Mathematica with the objective of producing slower software than           |
|> Mathematica.                                                               |
|                                                                             |
|My understanding was that the OP was comparing the readability and           |
|ease-of-creation of Fortran and Ada. I saw no indication that he was         |
|concerned about the performance."                                            |
|-----------------------------------------------------------------------------|

Well Nasser incorporated neither REVERSE nor WHILE in
news:hv57ap$m0l$1@speranza.aioe.org so my contributions to this thread
did not matter.

|-----------------------------------------------------------------------------|
|" And in many cases, the performance of the                                  |
|code isn't very relevant."                                                   |
|-----------------------------------------------------------------------------|

True.

|-----------------------------------------------------------------------------|
|" (Remember the 90/10 rule!) [..]                                            |
|[..]"                                                                        |
|-----------------------------------------------------------------------------|

It is not always that simple. Aside from that, the 90% might be spread
across the code instead of in a single subprogram, which is one factor
as to why traditional UNIX(R)  prof  is only helpful in particular
circumstances.

|-----------------------------------------------------------------------------|
|"P.S. I wouldn't waste time on suing someone. Only the lawyers make money in |
|most lawsuits. "                                                             |
|-----------------------------------------------------------------------------|

Oh I will be suing Pisa so-called "University" for ruining my life
when it misled me about what I would be doing there and forbade me
from speaking out against one of the biggest, buggiest, copy-and-paste
fests I ever saw. Unfortunately, scientific journals do not allow
already public knowledge so the aforementioned paper (which does not
focus on Fortress, but instead contains details re lies re supposedly
optimal SystemC(R) code) must be published before I sue Pisa so-called
"University".

As for making money, who will be the lawyer is a nice person and
helped me while I was short on cash (something which cannot be
truthfully said about participants of this newsgroup: a topic for a
section to name and shame in the paper (those of you who tried to help
me how you could: don't worry!, you are without blame)) so I have no
problem with letting the lawyer profit from putting those culprits in
gaol. At least there they will not find it so easy to promote shoddy
code in safety-critical devices and ruin other people's lives.

Sincerely,
Colin Paul Gloster



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-14 19:19                 ` Colin Paul Gloster
@ 2010-06-14 19:48                   ` Nasser M. Abbasi
  0 siblings, 0 replies; 32+ messages in thread
From: Nasser M. Abbasi @ 2010-06-14 19:48 UTC (permalink / raw)


On 6/14/2010 12:19 PM, Colin Paul Gloster wrote:

>
> |-----------------------------------------------------------------------------|
> |">  Nasser M. Abbasi was not reverting to Ada as a complement to              |
> |>  Mathematica with the objective of producing slower software than           |
> |>  Mathematica.                                                               |
> |                                                                             |
> |My understanding was that the OP was comparing the readability and           |
> |ease-of-creation of Fortran and Ada. I saw no indication that he was         |
> |concerned about the performance."                                            |
> |-----------------------------------------------------------------------------|
>
> Well Nasser incorporated neither REVERSE nor WHILE in
> news:hv57ap$m0l$1@speranza.aioe.org so my contributions to this thread
> did not matter.
>

I just wanted to say that I found your suggestions for code changes to 
be very insightful and important.

But because the point of this small example was for me to learn how to 
use complex numbers in Ada and compare it to Fortran, and not worry too 
much at this time about optimization, I did not modify the code as you 
suggested.

In addition, if I changeed the Ada code, I would have to change the 
Fortran code to keep it similarly structured as the Ada code, and I did 
not want to go down that path.

That is the only reason, and for no other.

regards,
--Nasser



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-10 15:48   ` Colin Paul Gloster
  2010-06-10 14:54     ` Ludovic Brenta
@ 2010-06-17  7:44     ` Gautier write-only
  2010-06-17 10:33       ` Colin Paul Gloster
  2010-06-17 14:39       ` Yannick Duchêne (Hibou57)
  1 sibling, 2 replies; 32+ messages in thread
From: Gautier write-only @ 2010-06-17  7:44 UTC (permalink / raw)


On Jun 10, 5:48 pm, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org>
wrote:

> Additionally, loop unrolling should be considered.

Just a note for those who are not aware of and who'd be tempted to
unroll loops by hand: compilers are able to unroll loops themselves.
For instance GNAT has a -funroll-loops for a long time (and also -
fpeel-loops and -funswitch-loops).
_________________________________________________________
Gautier's Ada programming -- http://sf.net/users/gdemont/
NB: For a direct answer, e-mail address on the following web site:
http://www.fechtenafz.ethz.ch/wm_email.htm



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-17  7:44     ` Gautier write-only
@ 2010-06-17 10:33       ` Colin Paul Gloster
  2010-06-17 14:39       ` Yannick Duchêne (Hibou57)
  1 sibling, 0 replies; 32+ messages in thread
From: Colin Paul Gloster @ 2010-06-17 10:33 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 1186 bytes --]

On Thu, 17 Jun 2010, Gautier sent:
|--------------------------------------------------------------------|
|"On Jun 10, 5:48 pm, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org>|
|wrote:                                                              |
|                                                                    |
|> Additionally, loop unrolling should be considered.                |
|                                                                    |
|Just a note for those who are not aware of and who'd be tempted to  |
|unroll loops by hand: compilers are able to unroll loops themselves.|
|For instance GNAT has a -funroll-loops for a long time (and also -  |
|fpeel-loops and -funswitch-loops)."                                 |
|--------------------------------------------------------------------|

It is possible to obtain better performance by both manually unrolling
and having a compiler unroll for you at the same, instead of by
relying on just a compiler or just manual unrolling. See for example
"Computer Architecture: A Quantitative Approach" (in which manual
unrolling was called "symbolic loop unrolling").

Sincerely,
Colin Paul Gloster

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-17  7:44     ` Gautier write-only
  2010-06-17 10:33       ` Colin Paul Gloster
@ 2010-06-17 14:39       ` Yannick Duchêne (Hibou57)
  2010-06-17 16:36         ` Colin Paul Gloster
  1 sibling, 1 reply; 32+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-06-17 14:39 UTC (permalink / raw)


Le Thu, 17 Jun 2010 09:44:27 +0200, Gautier write-only  
<gautier_niouzes@hotmail.com> a écrit:
> Just a note for those who are not aware of and who'd be tempted to
> unroll loops by hand: compilers are able to unroll loops themselves.
> For instance GNAT has a -funroll-loops for a long time (and also -
> fpeel-loops and -funswitch-loops).
Either by hand or by compiler optimizer, loop unroll does not assure  
better performance, and had even been noticed to give less better  
performance.

-- 
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
--  i.e. forget about previous premises which leads to conclusion
--  and start with new conclusion as premise.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: small example, using complex variables in Ada
  2010-06-17 14:39       ` Yannick Duchêne (Hibou57)
@ 2010-06-17 16:36         ` Colin Paul Gloster
  0 siblings, 0 replies; 32+ messages in thread
From: Colin Paul Gloster @ 2010-06-17 16:36 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 935 bytes --]

On Thu, 17 Jun 2010, Yannick Duchêne (Hibou57) wrote:
|---------------------------------------------------------------------------|
|"Le Thu, 17 Jun 2010 09:44:27 +0200, Gautier write-only                    |
|<gautier_niouzes@hotmail.com> a écrit:                                     |
|> Just a note for those who are not aware of and who'd be tempted to       |
|> unroll loops by hand: compilers are able to unroll loops themselves.     |
|> For instance GNAT has a -funroll-loops for a long time (and also -       |
|> fpeel-loops and -funswitch-loops).                                       |
|Either by hand or by compiler optimizer, loop unroll does not assure better|
|performance, and had even been noticed to give less better performance."   |
|---------------------------------------------------------------------------|

True, and you could say that about many techniques which sometimes
achieve optimzation.

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2010-06-17 16:36 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-09 10:49 small example, using complex variables in Ada Nasser M. Abbasi
2010-06-09 11:26 ` Ludovic Brenta
2010-06-09 23:50   ` Jerry
2010-06-10  1:03     ` Jeffrey R. Carter
2010-06-10 15:48   ` Colin Paul Gloster
2010-06-10 14:54     ` Ludovic Brenta
2010-06-10 16:21       ` Colin Paul Gloster
2010-06-10 17:37         ` Adam Beneschan
2010-06-10 17:57         ` Jeffrey R. Carter
2010-06-10 22:32           ` Randy Brukardt
2010-06-11 12:42             ` Colin Paul Gloster
2010-06-11 18:59               ` Randy Brukardt
2010-06-14 19:19                 ` Colin Paul Gloster
2010-06-14 19:48                   ` Nasser M. Abbasi
2010-06-17  7:44     ` Gautier write-only
2010-06-17 10:33       ` Colin Paul Gloster
2010-06-17 14:39       ` Yannick Duchêne (Hibou57)
2010-06-17 16:36         ` Colin Paul Gloster
2010-06-09 12:43 ` Niklas Holsti
2010-06-10  7:23 ` Stephen Leake
2010-06-10  9:12   ` J-P. Rosen
2010-06-10 11:03     ` Yannick Duchêne (Hibou57)
2010-06-10 13:27       ` J-P. Rosen
2010-06-10 21:15         ` Yannick Duchêne (Hibou57)
2010-06-11  7:22           ` Dmitry A. Kazakov
2010-06-11  8:48           ` J-P. Rosen
2010-06-11 12:00             ` Brian Drummond
2010-06-10  9:34   ` Nasser M. Abbasi
2010-06-10 20:12     ` Simon Wright
2010-06-14  9:33 ` Vincent LAFAGE
2010-06-14 12:29   ` Nasser M. Abbasi
2010-06-14 13:00     ` Vincent LAFAGE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox