Re: [eigen] sparse colwise |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] sparse colwise
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 28 Jun 2010 13:46:49 +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=yhJIfbg2aVz4GlhhvBpzhPxNxgY4OZ/iUHR0VXbY8xo=; b=iOHHYor7F1MqwaJWV6IlXCZLVX2NJYFFbkxuZv/Jf9mmpkX+/mqEWP4oT1DazTx3zv 7tPCy4RXQBE2/gezp3Xtdvs1z0dJuX+ybwbbdKN6YKTqggOkTSE/PvHYwIJS7kRDahAW z16VHKM3pNlIgm2Bt3XO9GjC+0SCm+XonImiQ=
- 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=O1UtRJZaTNdMs2VCGtk7eRmZdBCXmAd24JwfUL5wy21U7wisktyG3YN3JNK3unUFt8 h2Dt+hbZZtZjF52Uy2u0fuNPXZZzNAjgGjI6fPJzEXK8sBML/xYvabKM3F+QK/BO6SD2 siyd+i9+e994N/aoX4GWeDIFze5Cpspv58XbM=
for your information, with -O2, gcc removes the multiplications by one :)
gael
On Fri, Jun 25, 2010 at 5:54 PM, Sameer Agarwal
<sameeragarwal@xxxxxxxxxx> wrote:
> I was hoping to avoid the multiplication.
> Sameer
>
>
> On Fri, Jun 25, 2010 at 8:41 AM, Gael Guennebaud
> <gael.guennebaud@xxxxxxxxx> wrote:
>> Hi,
>>
>> it's not a bug, but a lack of features.The sparse module does not
>> support the full dense API. Column-wise and row-wise operations do not
>> seem to be of high priority, but I agree that can be convenient.
>>
>> Note that you can still do:
>>
>> RowVectorXd::Ones(5) * m2
>>
>> Hopefully, the compiler should be smart enough to remove the products
>> by 1 (well, maybe it is not allowed to do so by default....)
>>
>> gael
>>
>> On Fri, Jun 25, 2010 at 5:14 PM, Sameer Agarwal
>> <sameeragarwal@xxxxxxxxxx> wrote:
>>> Hi Guys,
>>>
>>> On the development branch,
>>>
>>> #include "Eigen/Core"
>>> #include "Eigen/Sparse"
>>>
>>> using namespace Eigen;
>>> int main() {
>>> Matrix<double, Dynamic, Dynamic, ColMajor> m1(5,5);
>>> SparseMatrix<double, ColMajor> m2(5,5);
>>> m1.colwise().sum();
>>> m2.colwise().sum() // Fails to compile
>>> }
>>>
>>> fails to compile with
>>>
>>> 'class Eigen::SparseMatrix<double, 0, int>' has no member named 'colwise'
>>>
>>> am I missing something here?
>>> Sameer
>>>
>>>
>>>
>>
>>
>>
>
>
>