Boost logo

Boost Users :

From: Hurd, Matthew (hurdm_at_[hidden])
Date: 2004-02-18 20:40:39


> Russell Hind
> Subject: [Boost-users] Mathematical expressions with containers
>
> Currently I'm doing more and more mathematical calculations on
> containers, and wondered if there is any library out there that allows
> containers to be placed in expressions without having to use
> transform/for_each etc.
>
> e.g.
>
> std::vector<std::complex<double> > V1;
> std::vector<std::complex<double> > V2;
> double C1, C2;
>
> ...
>
> std::vector<std::complex<double> > Result;
>
> Result = C1 + V2 / (V1 * C2);
>
> while would be equivalent to (assuming Result has been resized)
>
> (I'm currently using a mixture of transforms and spirit::phoenix
> (because lambda doesn't work with my compiler))
>
> transform(V1.begin(), V1.end(), V2.begin(),
> Result.begin(),
> C1 + phoenix::arg2 / (phoenix::arg1 * C2));
>
> Or something to this effect that will aid with this.
>
> Cheers
>
> Russell

Seems to my quick glance you are asking for some vector operations.
Have you looked at boost's ublas?

Regards,

Matt Hurd.

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net