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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: vector C++ version of IDL where statement? [message #30725] Wed, 15 May 2002 16:40
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);
Re: vector C++ version of IDL where statement? [message #30729 is a reply to message #30725] Wed, 15 May 2002 16:04 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
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);
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 15:36:32 PDT 2025

Total time taken to generate the page: 0.00533 seconds