Re: [eigen] find command or equivalent |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] find command or equivalent
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 8 Sep 2010 08:40:21 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=KRY/FBJyVVoFfB4OPomBtx1KXFP8S6ltJyR7ks3rquY=; b=id0sBinCOxLTjr985duq3BxAgfrfP9wV5KKIIDr5E8VWVQf3DDtoW7OGBss6yU8+Wu xW8Q1mb9iHL2G5J53sYoo96XPWcQl9tJwXWQBn7n5JdRsvHlZZgBO/FQoLDbA6Qhi1OZ WAFJ/V0iXZhl2bC8MN79nUgTEbsJtlDE2+tw4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=H0U3EcV6XFsFqePwIY6tPgd6B1wNFMkrdyfcg2kh2hyBGC9h9u07QPgSySL2cZNGTp eTMYTmeq2MQI6aSH1PSYPbwbhACnlM8vQlty3aWGYskctlZFu24AoGqrUzvC45oRNX7H 7x0aOrdk+Dm2pA5+vtARkBHUOxphFngjO2wxU=
hi,
with eigen2 the following should do the job:
A = (A.cwise()<0.0001).select(0,A);
gael
On Wed, Sep 8, 2010 at 6:05 AM, Suresh Kumar
<suresh.amritapuri@xxxxxxxxx> wrote:
> hi
> I am using eigen2 in ubuntu 10.04. How to do this in eigen2?
> thanks
> suresh
>
> On Tue, Sep 7, 2010 at 7:27 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> wrote:
>>
>> 2010/9/7 Suresh Kumar <suresh.amritapuri@xxxxxxxxx>:
>> > Hi Gael,
>> > I get an error message like that when I used what you had suggested...
>> > class Eigen::Matrix3f’ has no member named ‘array’
>> > so what is the next step?
>> > thanks
>> > suresh
>>
>> Are you using eigen2 ? Gael's suggestion was for eigen3 (the
>> development branch).
>>
>> Benoit
>>
>> >
>> > On Fri, Sep 3, 2010 at 12:19 AM, Gael Guennebaud
>> > <gael.guennebaud@xxxxxxxxx>
>> > wrote:
>> >>
>> >> you can do:
>> >>
>> >> A = (A.array()<0.0001).select(0,A);
>> >>
>> >> where the "select" method mimics the c++ ?: operator.
>> >>
>> >> gael
>> >>
>> >>
>> >> On Fri, Sep 3, 2010 at 6:40 AM, Suresh Kumar
>> >> <suresh.amritapuri@xxxxxxxxx> wrote:
>> >> > Hi
>> >> > I want to replace all elements of a matrix, which are less than a
>> >> > threshold
>> >> > by zero. How to do it without writing a nested for loop?
>> >> > I am looking for something like this in matlab. A(A < 0.001) = 0
>> >> > where A
>> >> > is
>> >> > a matrix.
>> >> > Thanks
>> >> > suresh
>
> R Suresh Kumar,
> http://www.ee.ucr.edu/~sramachandranna
> --
> Dhyaana–moolam Guror murtih
> Puja-moolam Guroh padam
> Mantra – moolam Guror vakyam
> Moksha – moolam Guroh krpa.
>