I don't know what data the vectors depict, but if they are like floating
point numbers and you want to do distances etc (like geodata), and need
high performance on various strange matchings you should consider something
like R-trees

http://en.wikipedia.org/wiki/R-tree

(or check if there is some GIS-related stuff i clojure using this or
similar algoritms already)

Or if you have other needs, maybe create two datastructures in parallell
(maybe they could sorted or some other kind of indexing good for your
needs) and make lookups on either one depending on the question. If time is
more important than memory it could be a good idea to bloat the structure a
little.

/Linus


2011/12/3 Stephen Compall <stephen.comp...@gmail.com>

> On Sat, 2011-12-03 at 13:14 -0800, Base wrote:
> > I need to identify entries in this map where *either* the first or the
> > second value in the key matches a predicate.
>
> Unfortunately, you can only have one notion of key equality per map, so
> you need to either introduce some linear-search component (as your
> nested-maps example does), or add another map.  One or the other is
> faster depending on how many values you have.
>
> --
> Stephen Compall
> ^aCollection allSatisfy: [:each|aCondition]: less is better
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to