[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help: how to do ?



"Robert S. Hill" wrote:
> I added the following method to Pavel's test program:
> 
> a1=findgen(1,3)
> a2=findgen(n,3)
> a3 = make_array(n,val=1) # a1
> a4 = a2 + a3

For what it's worth, I find that, at least on my system, replicate
works about 10-20% faster than make_array, as in the following:

a1 = findgen(1,3)
a2 = findgen(n,3)
a3 = a2 + (replicate(1,n) # a1)

Cheers,
eddie

----- ---- --- ---  ---- --- --  --- --- --  -- - -  -  -
|\               A G Edward Haskell              
|\    Center for Coastal Physical Oceanography    
|\   Old Dominion University, Norfolk VA  23529   
|\     Voice 757.683.4816    Fax 757.683.5550     
|\          e-mail  haskell*ccpo.odu.edu          
----- ---- --- ----  --- --- ---  --- -- --  -- - -  -   -