> -----Oorspronkelijk bericht-----
> Van: [email protected] [mailto:programming-
> [email protected]] Namens Henry Rich
> Verzonden: dinsdag 28 december 2010 18:42
> Aan: Programming forum
> Onderwerp: Re: [Jprogramming] Convolution using FFT WAS: Proposal for
> special code voor dyadic f/.@:(g/)
> 
> OK, all these suggestions are now in
> 
> http://www.jsoftware.com/jwiki/Essays/FFT
> 
> Henry Rich
> 

Some observations.

   'X Y'=. 8192 8193 <@(?...@$)"(0) 1000
   rank'iconvolve~ X';'iconvolve~ Y'
+----+-----+----+----+
|rank|tm*sz|time|size|
+----+-----+----+----+
| 0  |1.00 |1.00|1.00|
+----+-----+----+----+
| 1  |5.22 |2.61|2.00|
+----+-----+----+----+
        NB. jump in performance at 2^n

   'X Y' =. 2 400 ?...@$ 1000x
   datatype&> X;Y;(X +/ obta * Y);X iconvolve Y
extended
extended
extended
integer 
        NB. no extended output

   'X Y' =. 2 8192 ?...@$ 1000
   rank'X +/ obta * Y';'X iconvolve Y'
+----+-----+----+----+
|rank|tm*sz|time|size|
+----+-----+----+----+
| 0  |1.00 |6.49|1.00|
+----+-----+----+----+
| 1  |1.36 |1.00|8.83|
+----+-----+----+----+
        NB. fast, not lean

   'X Y' =. 2 8193 ?...@$ 1000
   rank'X +/ obta * Y';'X iconvolve Y'
+----+-----+----+-----+
|rank|tm*sz|time|size |
+----+-----+----+-----+
| 0  |1.00 |2.69| 1.00|
+----+-----+----+-----+
| 1  |6.56 |1.00|17.65|
+----+-----+----+-----+
        NB. overall less efficient

   'X Y' =. 8000 9000 <@(?...@$)"(0) 1000
   rank'X +/ obta * Y';'X iconvolve Y'
+----+-----+----+-----+
|rank|tm*sz|time|size |
+----+-----+----+-----+
| 0  | 1.00|2.58| 1.00|
+----+-----+----+-----+
| 1  |13.26|1.00|34.15|
+----+-----+----+-----+
        NB. especially for arbitrary input

   'X Y' =. 2 16384 ?...@$ 1000
   rank'X +/ obta * Y';'X iconvolve Y'
+----+-----+----+----+
|rank|tm*sz|time|size|
+----+-----+----+----+
| 1  |1.41 |9.40|1.00|
+----+-----+----+----+
| 0  |1.00 |1.00|6.65|
+----+-----+----+----+
        NB. finally more efficient

   'X Y' =. 16000 17000 <@(?...@$)"(0) 1000
   rank'X +/ obta * Y';'X iconvolve Y'
+----+-----+----+-----+
|rank|tm*sz|time|size |
+----+-----+----+-----+
| 0  |1.00 |4.13| 1.00|
+----+-----+----+-----+
| 1  |5.14 |1.00|21.21|
+----+-----+----+-----+
        NB. However ...

If f/.@:(g/) would be replaced by special code like obta, figures would be
even (slightly?) more in favor of obta.


R.E. Boss

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to