[julia-users] Re: PriorityQueue for fast large network simulation

2016-07-12 Thread Jeffrey Sarnoff
> > Is it possible to set up a priority queue with integer keys instead? > Yes. julia> pq=Collections.PriorityQueue() Base.Collections.PriorityQueue{Any,Any,Base.Order.ForwardOrdering} with 0 entries julia> pq[1]=10;pq[2]=5;pq[3]=20; julia> pq Base.Collections.PriorityQueue{Any,Any,Base.Orde

[julia-users] Re: PriorityQueue for fast large network simulation

2016-07-12 Thread David P. Sanders
For efficiency, you probably want a typed version: julia> Base.Collections.PriorityQueue(Int, Int) Base.Collections.PriorityQueue{Int64,Int64,Base.Order.ForwardOrdering} with 0 entries El martes, 12 de julio de 2016, 7:34:43 (UTC-4), Jeffrey Sarnoff escribió: > > Is it possible to set up a prior

Re: [julia-users] Re: PriorityQueue for fast large network simulation

2016-07-12 Thread Rainer J. Engelken
Is it possible to set up a priority queue with integer keys instead? > Yes. > julia> pq=Collections.PriorityQueue() > Base.Collections.PriorityQueue{Any,Any,Base.Order.ForwardOrdering} with 0 > entries > > julia> pq[1]=10;pq[2]=5;pq[3]=20; > Sorry, I wasn't clear. What I meant to say: Profiling i

Re: [julia-users] Re: PriorityQueue for fast large network simulation

2016-07-12 Thread Rainer J. Engelken
> > For efficiency, you probably want a typed version: > > julia> Base.Collections.PriorityQueue(Int, Int) > Base.Collections.PriorityQueue{Int64,Int64,Base.Order.ForwardOrdering} > with 0 entries > I used Uint32 as keys to save memory. (phi = Collections.PriorityQueue(UInt32,Float64) ). Are Int64

Re: [julia-users] Re: PriorityQueue for fast large network simulation

2016-07-12 Thread Jeffrey Sarnoff
Broadly speaking, UInt32 is faster than UInt64, Int32 is faster than Int64 and Julia tends to use the signed ints when it means integer values. Your application may be happier with the use of ako (possibly augmented) tree instead of a priority queue. You get very fast index or weight or priorit

Re: [julia-users] Re: PriorityQueue for fast large network simulation

2016-07-12 Thread Jeffrey Sarnoff
Keno's AbstractTrees is very helpful in understanding tree-think. On Tuesday, July 12, 2016 at 1:17:25 PM UTC-4, Jeffrey Sarnoff wrote: > > Broadly speaking, UInt32 is faster than UInt64, Int32 is faster than Int64 > and Julia tends to use the signed in

Re: [julia-users] Re: PriorityQueue for fast large network simulation

2016-07-12 Thread Rainer J. Engelken
2016-07-12 19:17 GMT+02:00 Jeffrey Sarnoff : > Broadly speaking, UInt32 is faster than UInt64, Int32 is faster than Int64 > and Julia tends to use the signed ints when it means integer values. > Thanks, I didn't know that. Is there a way to make the dictionary underlying the PriorityQueue also use