;----------------------------------------------------------------- ; primfak.pro ; ; written by Andreas Reigber ;------------------------------------------------------------------ ; calculates the primefactors of a number. ; I used this to estimate the time of a FFT (proportional to ; the sum of the primefactors of the array length). ;------------------------------------------------------------------ ; This software has been released under the terms of the GNU Public ; license. See http://www.gnu.org/copyleft/gpl.html for details. ;------------------------------------------------------------------ pro primfak,zzz zahl=zzz dif = 2.0 sum = 0 print,format='(A,$)',strcompress(zahl) print,format='(A,$)',' = ' loop: test = zahl/dif if fix(test)-test eq 0 then begin print,format='(A,$)',strcompress(fix(dif)) sum=sum + dif zahl=zahl/dif if zahl ne 1 then print,format='(A,$)',' *' endif else dif = dif + 1 if zahl eq 1 then begin print,'' print,'FFT Dauer ca.',strcompress(zzz*floor(sum)) return endif goto,loop end