On Jan 10, 1:35 am, Donovan Parks <donovan.pa...@gmail.com> wrote:
Andy: I agree one needs to be careful when looking for
equality between doubles. For reasons not interesting enough
to list here, I'm not worried about this issue here.
Peter: What is the rule for when a == b? In a strictly weak
ordering if a == b am I free to return true or false?
Only false. The ordering must be such that !(a<b) && !(b<a)
defines an equivalence relationship.
Hello,
Andy and James: thanks for the help. I can clearly see that I don't
have a strictly weak ordering.
Given that I need to sort the list as specified above, is there any
STL (doesn't seem so) or Boost (not as family with this library set,
although I use parts of it) sorting algorithm that relaxes this
requirement or will I need to grab myself a sorting algorithm and
modify it for my needs. Clearly one can properly sort a list without
this requirement (i.e., where equality is treated as a special case).
I'm a big fan of not reinventing the wheel, but perhaps it is
necessary in this case.
First: Don't toppost - I've rearranged the post. Now back to topic:
so just do that and use a standard sorting routine.