comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: vector C++ version of IDL where statement?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: vector C++ version of IDL where statement? [message #30725] Wed, 15 May 2002 16:40 Go to previous message
Sean Dettrick is currently offline  Sean Dettrick
Messages: 12
Registered: April 2002
Junior Member
Thanks James. It's hairy-looking syntax to me, but after poring over my
C++ book I'm beginning to get the point.
Cheers,
Sean

James Kuyper wrote:
>
> Sean Dettrick wrote:
>
>> Hi,
>> this is a hybrid C++/IDL newsgroup question, but I shall risk your
>> wrath:
>>
>> Does anybody know how to do an IDL WHERE statement in C++ ??
>>
>> e.g.
>> IDL> x=findgen(100)
>> IDL> w=where(x gt 50)
>> IDL> x(w)=50
>>
>> how do you convert to C++?
>
> // You'll need these:
> #include <algorithm>
> #include <functional>
>
> // Once you've set up 'x', then it's simple:
> std::replace_if(x.begin(), x.end(),
> std::bind2nd(std::greater, 50), 50);
[Message index]
 
Read Message
Read Message
Previous Topic: vector C++ version of IDL where statement?
Next Topic: Re: fast image display

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:29:37 PDT 2025

Total time taken to generate the page: 0.00170 seconds