Re: [eigen] nulify row of SparseMatrix |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] nulify row of SparseMatrix
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 27 Nov 2012 15:56:33 +0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=w9TlYKN/WyfUs13lCwY0PTaB5/NC8Yp9bJAGCGGExOU=; b=vzamcPZTKlvyRmCbr2uMgI9xo11BMZfiRGUNbJOTF1gdNGYbKBPAWGtWiaEgCZxFgp QeJ/xrf6o6wPfjBQ/GFmvcJzmOr6fIl/tBE2I8YHUnhkodVkCJnUV+CFmcvgcWDWtWxd EPOv+osOynVFfGxpGTA43fT5uk89BIRIsAC2//xp6hm7eB4MtFP0uYucdJ4yK8zm0cEz 6hoEd3tjoO8DbvK/Ie2VOVRwQbyswIV0ZjzsUmhgsngX/4+z/Pp8GdRjb1T+DmEtUtvW y+FrLYCJbdWwmQ9Ahhg/iRPxdF9A5V9oKUpdcc6DOlC+aklAlko6f18xKDszBSqHPoIv iSXg==
Hi,
you can do it indirectly like this:
SparseVector<double> sp_zero(m);
SparseMatrix<double> mat(m,n);
.....
mat.col(j) = sp_zero;
cheers,
gael
On Fri, Nov 23, 2012 at 1:56 AM, Angelos Mantzaflaris
<filiatra@xxxxxxxxx> wrote:
> Hello,
>
> I have a SparseMatrix and I need to set a row to zero, or set a column to
> zero, i.e. remove all coefficients at a certain row/column.
>
> Does this exist? If not, what is the best way to do it ?
>
> thank you in advance
> Angelos
>
>