In article <[EMAIL PROTECTED]>,
bukzor <[EMAIL PROTECTED]> wrote:
>On Jan 4, 2:15 pm, Steven D'Aprano <[EMAIL PROTECTED]
>cybersource.com.au> wrote:
>> On Fri, 04 Jan 2008 09:29:50 -0800, bukzor wrote:
>> > Why cant you implement < for complex numbers? Maybe I'm being naive, but
>> > isn't this th
Sion Arrowsmith:
> Because ... how to be polite about this? No, I can't. std::set is
> crap. The implementation is a sorted sequence
What about using hash_map instead? You can use it with GCC too (but
you have to use a trick if you want to use string keys).
Bye,
bearophile
--
http://mail.python.
On Jan 4, 2:15 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Fri, 04 Jan 2008 09:29:50 -0800, bukzor wrote:
> > Why cant you implement < for complex numbers? Maybe I'm being naive, but
> > isn't this the normal definition?
> > a + bi < c + di iff sqrt(a**2 + b**2) < sqr
On Jan 4, 6:08 pm, Sion Arrowsmith <[EMAIL PROTECTED]>
wrote:
> Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>
> >BTW if you're using C++, why not simply use std::set?
>
> Because ... how to be polite about this? No, I can't. std::set is
> crap. The implementation is a sorted sequence -- if you're luc
On Jan 4, 10:15 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Fri, 04 Jan 2008 09:29:50 -0800, bukzor wrote:
> > Why cant you implement < for complex numbers? Maybe I'm being naive, but
> > isn't this the normal definition?
> > a + bi < c + di iff sqrt(a**2 + b**2) < sq
On Fri, 04 Jan 2008 09:29:50 -0800, bukzor wrote:
> Why cant you implement < for complex numbers? Maybe I'm being naive, but
> isn't this the normal definition?
> a + bi < c + di iff sqrt(a**2 + b**2) < sqrt(c**2, d**2)
No, it is not. Ordered comparisons are not defined for complex numbers.
> bukzor <[EMAIL PROTECTED]> (B) wrote:
>B> Why cant you implement < for complex numbers? Maybe I'm being naive,
>B> but isn't this the normal definition?
>B> a + bi < c + di iff sqrt(a**2 + b**2) < sqrt(c**2, d**2)
There doesn't exist a `normal' definition of < for the complex numbers. F
bukzor schrieb:
> On Jan 4, 9:08 am, Sion Arrowsmith <[EMAIL PROTECTED]>
> wrote:
>> Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>>
>>> BTW if you're using C++, why not simply use std::set?
>> Because ... how to be polite about this? No, I can't. std::set is
>> crap. The implementation is a sorted se
On Jan 4, 5:08 pm, Sion Arrowsmith <[EMAIL PROTECTED]>
wrote:
[...]
> But the real killer is that requirement for a std::set is that
> T::operator< exists. Which means, for instance, that you can't
> have a set of complex numbers
This is really OT but IIRC, std::set is actually
std::set< T, st
On Jan 4, 9:08 am, Sion Arrowsmith <[EMAIL PROTECTED]>
wrote:
> Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>
> >BTW if you're using C++, why not simply use std::set?
>
> Because ... how to be polite about this? No, I can't. std::set is
> crap. The implementation is a sorted sequence -- if you're luc
Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>BTW if you're using C++, why not simply use std::set?
Because ... how to be polite about this? No, I can't. std::set is
crap. The implementation is a sorted sequence -- if you're lucky,
this is a heap or a C array, and you've got O(log n) performance.
But
Achim Domma <[EMAIL PROTECTED]> writes:
> I'm interested in details about how sets are implemented in python.
> They seem to be quite fast and I found some remarks who state, that
> the implementation is highly optimized. I need to implemented sets
> in C/C++ and need a starting point on how to do
On Jan 4, 2008 9:54 AM, Achim Domma <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm interested in details about how sets are implemented in python.
> They seem to be quite fast and I found some remarks who state, that
> the implementation is highly optimized. I need to implemented sets in
> C/C++ and nee
13 matches
Mail list logo