|
-
December 21st, 2010, 10:04 AM
#20
Re: float as a key in std::map
 Originally Posted by monarch_dodra
Both have their advantages and disadvantages.
The advantage of using coordinates is that it results in a unique ordering. The disadvantage to it is that the order of your nodes can change drastically if one of them is moved even just a little bit.
The advantage of using vector length is that it uses an actual mathematical/physical value, which is the Euclidean Norm (although almost any 3D norm will do). An advantage to doing this is that for starters, it makes sense by looking at a graph which nodes are order before what other nodes, and the ordering is more robust to tiny changes in point positions.
I don't think this would work, as infinitely many points on "the sphere" will have the same key. So in the end the "find" will be indeterminate.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|