Boost logo

Boost :

From: Neal Becker (ndbecker2_at_[hidden])
Date: 2005-10-07 11:49:32


John Maddock wrote:

>> Uh, where is it?
>
> It was posted to the boost-users list. Implementation is utterly trivial
> anyway.
>
>> There are a number of useful things to go with complex. Here is
>> another.
>>
>> It is common to need the scalar type that corresponds to a numeric
>> type, whether that type is complex or scalar. For example, the type
>> returned by abs. Implementation is pretty trivial:
>
> Interesting, and good point.
>
> OK, is there any objection to is_complex being added, what about Neal's
> trait (and what to call it if it is added, "scalar" maybe?).
>

I propose a collection of complex utilities. This would include:

1) is_complex
2) scalar
3) A collection of iterator adapters:
  3.1) Transform complex sequence to scalar (yield alternating real/imag
parts)
  3.2) Inverse of 3.1
  3.3) Pick off real part of complex
  3.4) Pick off imag part of complex
  3.5) zip 2 scalar sequences into complex sequence

I have code based on boost iterator adapter for all the above.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk