Re: [eigen] XLC Port: Part II - External definition of a template member function of a template class causing the problems? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] XLC Port: Part II - External definition of a template member function of a template class causing the problems?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Sat, 30 Jan 2010 08:56:14 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=v/XslTvjykMHbWYRo0XtlstL2kFyIHbTd6sUCTHj1nI=; b=mwN2/OipEn2Pk4DJiZcoutaMLVCeTRN8gP7ZMXwM7nosi5jYeTWuAxE5x7zNc0YGKl R+cXuSPRB23ni/pwDi7viZf3tB5+jFhGF4w84m6jHb5rK9C8CIzfTT3uGaA4+NCBofrz S6lfZqVF9i4fwCljIwp25DBG4802Scg+NqwIQ=
- 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=dmTPuqreHLepJDc/a4EpvqGM2UbDTxr/Mxw0GxgnWTSal7e68sGkP5QyKaJvzEGDpD 6CCFizMRnEk5VnJjoOe9PBmkg/r36tp3NNqh7kWnrEU1b06MNB4yKhRQ4DcGZJeoXALe TXdqj5bpt3ypmoz/K5A5cohtr/o/BQdEf59Vg=
2010/1/27 Aron Ahmadia <aja2111@xxxxxxxxxxxx>:
> Hi all,
>
> I'm still looking at the port, and I've managed to narrow down the
> problem. For those of you who've been following along at home, XLC
> has been throwing this error when trying to compile the Eigen files:
> [0]
> "eigen/Eigen/src/Core/SelfAdjointView.h", line 147.81: 1540-0716 (S)
> The template argument "Eigen::SelfAdjointView" does not match the
> template parameter "class T".
> "eigen/Eigen/src/Core/SelfAdjointView.h", line 134.112: 1540-0716 (S)
> The template argument "Eigen::SelfAdjointView" does not match the
> template parameter "class T".
>
> Suspiciously, there's no trace of SelfAdjointView being used as a
> template parameter argument anywhere in there, or any trace of a
> parameter named 'class T'.
>
> So I decided to create a new test file, slowly adding in the Eigen
> header files from Core until I got compiler errors. Here's the
> current file: http://pastebin.com/m267235e7
>
> If you'll notice, SelfAdjointView.h is being successfully included
> here. What causes the breakage is SelfadjointProduct.h. This
> actually isn't that surprising, since a function that declared in
> SelfAdjointView.h is later defined in SelfadjointProduct.h (By the
> way, should this be renamed to SelfAdjointProduct.h to fit the rest of
> the naming scheme better?)
>
> Here is the declaration and the definition:
>
> template<typename DerivedU>
> SelfAdjointView& rankUpdate(const MatrixBase<DerivedU>& u, Scalar alpha)
>
>
> template<typename MatrixType, unsigned int UpLo>
> template<typename DerivedU>
> SelfAdjointView<MatrixType,UpLo>& SelfAdjointView<MatrixType,UpLo>
> ::rankUpdate(const MatrixBase<DerivedU>& u, Scalar alpha)
> {
> typedef ei_blas_traits<DerivedU> UBlasTraits;
> typedef typename UBlasTraits::DirectLinearAccessType ActualUType;
> typedef typename ei_cleantype<ActualUType>::type _ActualUType;
> const ActualUType actualU = UBlasTraits::extract(u.derived());
>
> Scalar actualAlpha = alpha * UBlasTraits::extractScalarFactor(u.derived());
>
> enum { IsRowMajor = (ei_traits<MatrixType>::Flags&RowMajorBit) ? 1 : 0 };
>
> ei_selfadjoint_product<Scalar,
> _ActualUType::Flags&RowMajorBit ? RowMajor : ColMajor,
> ei_traits<MatrixType>::Flags&RowMajorBit ? RowMajor : ColMajor,
> !UBlasTraits::NeedToConjugate, UpLo>
> ::run(_expression().cols(), actualU.cols(), &actualU.coeff(0,0),
> actualU.stride(),
> const_cast<Scalar*>(_expression().data()),
> _expression().stride(), actualAlpha);
>
> return *this;
> }
>
> So according to this page here:
> http://www.comeaucomputing.com/techtalk/templates
>
> You're not allowed to do the above because SelfAdjointView is the
> 'primary template argument'. Unfortunately, the code refuses to
> compile if the template arguments are removed.
I'm sorry, I still don't understand what is not allowed with the code
that you pasted here?
Benoit