[eigen] compiles (Re: specializing void MatrixBase<Derived>::makeHouseholder)

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


Dear Christoph,


Am 12.09.2016 um 11:06 schrieb Christoph Hertzberg:


Ideally, we should only specialize a sub-part of the function for different types (which we can do by delegating the function to a helper-struct).

Using a helper function which is not a member of MatrixBase I managed to compile it:

Changes in Householder.C:

template<typename Scalar, typename RealScalar, typename EssentialPart>
void handle_householder_zero( Scalar& tau, RealScalar& beta, EssentialPart& essential , const RealScalar& tol, const Scalar& c0)
{
    tau=0;
    beta = 0;
    essential.setZero();	
}

[ ...]

  if(tailSqNorm <= tol && numext::abs2(numext::imag(c0))<=tol)
  {
    //tau = RealScalar(0);
    //beta = numext::real(c0);
    //essential.setZero();
	handle_householder_zero( tau, beta, essential, tol, c0 );
  }

And in my code

template<typename EssentialPart>
void handle_householder_zero( TpFloat& tau, TpRFloat& beta, EssentialPart& essential, const TpRFloat&  tol, const TpFloat& c0 )
{
    tau=0;
    beta = 0;
    essential.setZero();	
    std::cerr << "tol: " << tau << " c0: " << c0 << std::endl;
}

calls my specialization.
So, I can now start looking for a solution.

Thanks for your help,
Peter



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