Re: [eigen] Pseudo-inverse |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Pseudo-inverse
- From: brian avants <stnava@xxxxxxxxx>
- Date: Tue, 28 Sep 2010 15:07:39 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=tb0LNHAAKQYsEZNMTPD1dNkAiHacJkshuR8btouBOgs=; b=pIDKfjqo/9F3gIx/GfbGiLyClYyB/9rSSFfxC+qheRGQfm2/dc/XmM03CAd4Hd8prQ 0+7feleMPtezgW40uFp15oSiGSecKDwAVzVwlD3slYs8sQUDUleH1hhkd8aVNcvIKwLY KID8rEw2hreTUxbv0dJFCibpIuTFAQroc4noQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=sZQ/i09+i1ifaO5diWdDUGNniE9PbJncSmM3W+8CsaWMrPzjKgYhj5TNUOEIbqZevo CSqx2FBcSj78Pl7uJLB4jkao9OAuoqxchhKgFlAU7cXXh46vgmXUIau4j4e1ZnW15h/z JxUWC1+4Mqd5Z1ntnZ/zInhVtLT6nyVYL11IU=
you can add this to the svd header function.
void pinv( MatrixType& pinvmat)
{
ei_assert(m_isInitialized && "SVD is not initialized.");
double pinvtoler=1.e-6;
SingularValuesType m_sigma_inv=m_sigma;
for ( long i=0; i<m_workMatrix.cols(); ++i)
{
if ( m_sigma(i) > pinvtoler ) // FIXME -- check tolerances against
matlab pinv
m_sigma_inv(i)=1.0/m_sigma(i);
else m_sigma_inv(i)=0;
}
pinvmat= (m_matV*m_sigma_inv.asDiagonal()*m_matU.transpose());
}
On Tue, Sep 28, 2010 at 3:03 PM, <hamelin.philippe@xxxxxxx> wrote:
> Hello,
>
> is there any pseudo-inverse implementation in the current Eigen3 dev branch?
>
> Thank you,
>
> ------------------------------------
> Philippe Hamelin, ing. jr, M. Ing
> Chercheur / Researcher
>
> T: 450-652-8499 x2198
> F: 450-652-1316
>
> Expertise robotique et civil
> Institut de recherche d'Hydro-Québec (IREQ)
> 1740, boul. Lionel-Boulet
> Varennes (QC) J3X 1S1, Canada
>
--
ß®∫∆π