[eigen] Clarification on the documentation for SparseSelfAdjointView::RankUpdate |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: [eigen] Clarification on the documentation for SparseSelfAdjointView::RankUpdate*From*: Douglas Bates <bates@xxxxxxxxxxxxx>*Date*: Thu, 16 Jun 2011 16:41:07 -0500*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:date:x-google-sender-auth :message-id:subject:from:to:content-type; bh=S6/JDMA6U4aOxOkwdfzLK2xudzp84dwEMC0WgGOpqKU=; b=GOnPCElgIxG7i0EEcsWkIV+P9+1NoFH89iraSM2sOayA/Yb/wqACtJXJWejurIwa/D vgvSc/uL6/PnWKTWTmhNwBrTti5XI8aL1fju1LNQzGM76hF5lhcAnpvVdM3rDpJ3p6MG sbRrk7FsV+plcAousUZGJcRi7iQjisa82j684=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=gzdmIkpS3PcyeVmCvlcYXz5W261YOVua9Vd5rTR5XvWVq91sl1Zr+TY4bw4/kZiXVP 7emo6O/GwldV3oHI8YijdQGsOBPgXRUfHUpLxABwgHfvGIV+LMapIijtUpy4MyF6/Cpn TXPC/AESs/SN9zEycyAEqPKTbUjLdvImwu6Fc=

The documentation for this method states /** Perform a symmetric rank K update of the selfadjoint matrix \c *this: * \f$ this = this + \alpha ( u u^* ) \f$ where \a u is a vector or matrix. * * \returns a reference to \c *this * * Note that it is faster to set alpha=0 than initializing the matrix to zero * and then keep the default value alpha=1. * * To perform \f$ this = this + \alpha ( u^* u ) \f$ you can simply * call this function with u.adjoint(). */ The second-last paragraph is what has confused me. I want to evaluate the Lower triangle of Z.adjoint() * ZLam so I am doing it as SparseMatrix<double> ZtZ; ZtZ.selfadjointView<Lower>().rankUpdate(Z.adjoint(), 0.).rankUpdate(Z.adjoint()); Is that what is meant - that I should do the ..rankUpdate(Zlam.adjoint(), 0) then do the rankUpdate(Zlam.adjoint())? A second question, if I may: What would be an effective way of evaluating, as a sparse matrix, (I + Z'Z)? I think I would want to initialize the result to the identity then apply the rankUpdate method but I want to be sure that I don't accidentally create a dense, square matrix along the way.

**Follow-Ups**:**Re: [eigen] Clarification on the documentation for SparseSelfAdjointView::RankUpdate***From:*Gael Guennebaud

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] A question for MSVC experts** - Next by Date:
**[eigen] A template puzzler, or, templated custom scalar types** - Previous by thread:
**Re: [eigen] A question for MSVC experts** - Next by thread:
**Re: [eigen] Clarification on the documentation for SparseSelfAdjointView::RankUpdate**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |