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 #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);
[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: Mon Dec 01 16:03:44 PST 2025

Total time taken to generate the page: 1.28768 seconds