Re: [eigen] Pseudo-inverse

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


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
>



-- 
ß®∫∆π



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