[julia-users] Re: General question on indexing

2015-11-14 Thread hustf
I believe this work-in-progress type may be adapted? I wanted to make this faster by using tuples or immutable fixed vectors to store the data or whatnot, but I guess I'm currently stuck. Help wanted. Compared to looping unnecessarily over a full matrix, this speeds things up by around 35%. im

[julia-users] Re: General question on indexing

2015-11-15 Thread Seth
Hustf, I don't know why my reply didn't show up here yesterday, but I wanted to thank you for the code. I'm looking at how to make that work. Thanks for your response. On Saturday, November 14, 2015 at 2:18:45 PM UTC-8, hustf wrote: > > I believe this work-in-progress type may be adapted? I want

[julia-users] Re: General question on indexing

2015-11-16 Thread hustf
Seth, I appreciate that. As a novice programmer I appreciate to have exchanges with you guys who are making this. I'm using commercial software every day that hasn't made progress since the nineties. I worked through something like fifteen types for the adjacency matrix (and, by the way, tuple

[julia-users] Re: General question on indexing

2015-11-16 Thread Seth
I wish I walked faster with @simd - for some reason I'm getting the same performance as described here: https://groups.google.com/d/msg/julia-users/DycY6jwDcWs/yYXHsWF9AwAJ One of the key objectives for LightGraphs is to be as fast as possible, so while Julia itself is pretty darn good, we want

[julia-users] Re: General question on indexing

2015-11-16 Thread hustf
Seth, thanks for that, and yes we can move over there, but I need some time to study it before I contribute in the context. I've been looking at GraphLayout - spring.jl, and thinking along the same lines about speed. I'm delaying a commit because the package has a coherent coding style but which

Re: [julia-users] Re: General question on indexing

2015-11-15 Thread Tim Holy
This may also be a case where writing an iterator that just visits the elements with i >= j might be what you want. You can study the implementation of CartesianIndex in Base for inspiration. --Tim On Saturday, November 14, 2015 02:18:45 PM hustf wrote: > I believe this work-in-progress type ma

Re: [julia-users] Re: General question on indexing

2015-11-15 Thread Seth
Thank you, Tim - I'll definitely check it out. Right now I can't seem to find an efficient way of doing it, but there are a few tricks in Iterators.jl that might work. On Sunday, November 15, 2015 at 1:33:29 PM UTC-8, Tim Holy wrote: > > This may also be a case where writing an iterator that jus

Re: [julia-users] Re: General question on indexing

2015-11-15 Thread Tim Holy
Haven't tested timing carefully, but something like the following should be pretty decent: julia> immutable LowerTriangularIterator{A<:AbstractMatrix} data::A end julia> Base.start(iter::LowerTriangularIterator) = (1,1) start (generic function with 49 methods) julia> Base.done

Re: [julia-users] Re: General question on indexing

2015-11-15 Thread Seth
That's very cool and close to what I need. Thanks. I'm using adjacency lists (vectors of vectors) but I'm sure I can adapt this code. On Sunday, November 15, 2015 at 6:12:19 PM UTC-8, Tim Holy wrote: > > Haven't tested timing carefully, but something like the following should > be > pretty dece