On Oct 7, 2009, at 9:05 PM, Dag Sverre Seljebotn wrote:

> It's was the middle of the night in Norway when you posted that :-)
>
> Anyway, I'm 1

Did you forget a sign there?

> on ~x meaning x.conjugate(), because I always vote for making  
> Cython more like Python and less like C.

It's currently an error for complex values in Python.

> I can do the stuff necessarry for conjugate(), or give you hints,  
> which do you want? I won't be able to do it for another day.
>
> Dag Sverre Seljebotn
> -----Original Message-----
> From: Lisandro Dalcin <dalc...@gmail.com>
> Date: Thursday, Oct 8, 2009 1:53 am
> Subject: Re: [Cython] C++ complex support
> To: cython-...@codespeak.netreply-to: cython-dev@codespeak.net
>
> On Wed, Oct 7, 2009 at 6:59 PM, Robert Bradshaw
>> <rober...@math.washington.edu> wrote:
>>>
>>> Don't reopen the ticket, make a new one for C++ complex support.
>>>
>>
>> Done: http://trac.cython.org/cython_trac/ticket/398
>>
>>>> For the case of C,  C99 complexes will be automatically used  
>>>> ONLY if
>>>> _Complex_I is defined... of if the user explicitly pass
>>>> "-DPYX_CCOMPLEX=1" at C-compile time (or a Cython-included C header
>>>> #define PYX_CCOMPLEX=1), or if the directive "ccomplex=True".
>>>>
>>>> I'm still in doubt about how to handle 'ccomplex=True'... Should it
>>>> just enable by default using "#define PYX_CCOMPLEX=1", or actually
>>>> impact in code generation (as currently does)...
>>>
>>> I would be OK with it just changing the flag, with the code
>>> generation remaining unchanged.
>>>
>>
>> OK, this is work TBD in my patch...
>>
>>>> Ah! I forgot... I do not know how to implement z.conjugate(); the
>>>> C/C99/C++ support is there though... BTW, GCC seems to accept  
>>>> "~z" for
>>>> complex conjugation (no idea if it is C99-standard or a
>>>> GCC-extension)... Perhaps Cython should accept this (non-Python)
>>>> syntax? I think it is nice.
>>>
>>> I know is sage we map ~z to 1/z (it is the __invert__ operator after
>>> all). Python doesn't define an __invert__ for their native complex
>>> type. I could go either way.
>>>
>>
>> IMHO, my brain can parse "~z" as z.conjugate(), but would have a hard
>> time realizing ~z is "1/z"... Anyway, you are the BDLF, it's up to
>> you... Or the champion who actually implement support for
>> z.conjugate()... Hey, Dag. Are you there? ;-)
>>
>>
>>
>> -- 
>> Lisandro Dalcín
>> ---------------
>> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
>> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
>> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
>> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
>> Tel/Fax: +54-(0)342-451.1594
>> _______________________________________________
>> Cython-dev mailing list
>> Cython-dev@codespeak.net
>> http://codespeak.net/mailman/listinfo/cython-dev
>>
>
> _______________________________________________
> Cython-dev mailing list
> Cython-dev@codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev

_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to