Re: [eigen] Problem compiling dense matrix mult with complex<custom-real-scalar> |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Problem compiling dense matrix mult with complex<custom-real-scalar>
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 26 May 2010 19:14:22 -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=f54f9DJGdEBMDinrNHYm0Y6xeS832IK/WlIfZGjcLKA=; b=RVNxWp9Y2ZnGnLKjiKM9byuXop4WBH+SUCadjELN+MCC1WTI8U0pp0YGNkHF5M+KC/ UzH8sw7YfJGqgy5RE5jsslnVcz+3jdPUwO/M+AWzDmCkFoM+fWUBgGqLkJAelSjgN4yY wpjCpvDKGgh9mfhNwL6mg48x8AghkPEzuhSAE=
- 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=gUxz7aGoQ03/Ya+w1VIZy8auvmDRX3aMhbk5GKyfFbk08iIWzI9EfJdo+yQPteJCYd txgZFoEwNw4KtuaMc70rjEZa2hdM1PbTnvMxKtUHDP01GGXZlnrmhuo0yqKNetCAuZNx eRsnTwZqUC4X43TogLhR5MFT371mvxFwnlEDI=
Thanks, pushed. But I edited the commit message a bit.
Benoit
2010/5/26 Manoj Rajagopalan <rmanoj@xxxxxxxxx>:
>
> This works. Attaching patch as per your instructions.
>
> Thanks!
> Manoj
>
>
>
> On Wednesday 26 May 2010 11:59:24 am Benoit Jacob wrote:
>> Go to the line of code pointed to by your error: ProductBase.h:107
>>
>> it is:
>>
>> inline void evalTo(Dest& dst) const { dst.setZero();
>> scaleAndAddTo(dst,1); }
>>
>> and it complains it can't find a method accepting a int arg here.
>> Instead it wants a Scalar arg. So can you try this:
>>
>> inline void evalTo(Dest& dst) const { dst.setZero();
>> scaleAndAddTo(dst, Scalar(1)); }
>>
>> and if that fixes your problem, send me the patch and i'll push it for
>> you. (see link in previous mail)
>>
>> Benoit
>>
>> 2010/5/26 Manoj Rajagopalan <rmanoj@xxxxxxxxx>:
>> > Hi eigen developers,
>> >
>> > I am able to extend eigen for use with a real-scalar class named
>> > dd_real. But I get compilation errors when using std::complex<dd_real>
>> > value-type for dense-matrix multiplication (no problems with addition)..
>> > The error seems to be due to no declaration/definition of
>> > ProductBase<>::scaleAndAddTo() for matrices of complex<dd_real>.
>> >
>> > I tested the + and * operators for complex<dd_real> scalars and they
>> > work. Is there something I am missing? I have implemented
>> > NumTraits<dd_real> and I believe NumTraits<complex<dd_real> > is
>> > auto-inferred.
>> >
>> > The gcc 4.2.4 error log is appended.
>> >
>> > Thanks,
>> > Manoj
>> >
>> >
>> >
>> > g++ -I/usr/local/include/eigen3 -I/home/rmanoj/Software/src
>> > -ftemplate-depth-100 qd-gemv.cpp -o qd-gemv -lqd
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/ProductBase.h: In member
>> > function ‘void Eigen::ProductBase<Derived, Lhs, Rhs>::evalTo(Dest&) const
>> > [with Dest = Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0, 33331,
>> > 33331>, Derived =
>> > Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>, 33331, 33331,
>> > 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0,
>> > 33331, 33331>, 5>, Lhs = Eigen::Matrix<std::complex<dd_real>, 33331,
>> > 33331, 0, 33331, 33331>, Rhs = Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>]’:
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/ProductBase.h:244:
>> > instantiated from ‘Derived& Eigen::MatrixBase<Derived>::lazyAssign(const
>> > Eigen::ProductBase<ProductDerived, Lhs, Rhs>&) [with ProductDerived =
>> > Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>, 33331, 33331,
>> > 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0,
>> > 33331, 33331>, 5>, Lhs = Eigen::Matrix<std::complex<dd_real>, 33331,
>> > 33331, 0, 33331, 33331>, Rhs = Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>, Derived =
>> > Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0, 33331, 33331>]’
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/DenseStorageBase.h:306:
>> > instantiated from ‘Derived&
>> > Eigen::DenseStorageBase<Derived>::lazyAssign(const
>> > Eigen::DenseBase<OtherDerived>&) [with OtherDerived =
>> > Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>, 33331, 33331,
>> > 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0,
>> > 33331, 33331>, 5>, Derived = Eigen::Matrix<std::complex<dd_real>, 33331,
>> > 33331, 0, 33331, 33331>]’
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/Assign.h:492: instantiated
>> > from ‘static Derived& Eigen::ei_assign_selector<Derived, OtherDerived,
>> > false, false>::run(Derived&, const OtherDerived&) [with Derived =
>> > Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0, 33331, 33331>,
>> > OtherDerived = Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>, 5>]’
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/DenseStorageBase.h:473:
>> > instantiated from ‘Derived&
>> > Eigen::DenseStorageBase<Derived>::_set_noalias(const
>> > Eigen::DenseBase<OtherDerived>&) [with OtherDerived =
>> > Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>, 33331, 33331,
>> > 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0,
>> > 33331, 33331>, 5>, Derived = Eigen::Matrix<std::complex<dd_real>, 33331,
>> > 33331, 0, 33331, 33331>]’
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/Matrix.h:284: instantiated
>> > from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows,
>> > _MaxCols>::Matrix(const Eigen::MatrixBase<OtherDerived>&) [with
>> > OtherDerived = Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>, 5>, _Scalar = std::complex<dd_real>, int
>> > _Rows = 33331, int _Cols = 33331, int _Options = 0, int _MaxRows = 33331,
>> > int _MaxCols = 33331]’
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/DenseBase.h:453: instantiated
>> > from ‘const typename Eigen::ei_eval<T, typename
>> > Eigen::ei_traits<T>::StorageKind>::type Eigen::DenseBase<Derived>::eval()
>> > const [with Derived =
>> > Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>, 33331, 33331,
>> > 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0,
>> > 33331, 33331>, 5>]’
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/DenseStorageBase.h:457:
>> > instantiated from ‘void
>> > Eigen::DenseStorageBase<Derived>::_set_selector(const OtherDerived&,
>> > const Eigen::ei_meta_true&) [with OtherDerived =
>> > Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>, 33331, 33331,
>> > 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0,
>> > 33331, 33331>, 5>, Derived = Eigen::Matrix<std::complex<dd_real>, 33331,
>> > 33331, 0, 33331, 33331>]’
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/DenseStorageBase.h:452:
>> > instantiated from ‘Derived& Eigen::DenseStorageBase<Derived>::_set(const
>> > Eigen::DenseBase<OtherDerived>&) [with OtherDerived =
>> > Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>, 33331, 33331,
>> > 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0,
>> > 33331, 33331>, 5>, Derived = Eigen::Matrix<std::complex<dd_real>, 33331,
>> > 33331, 0, 33331, 33331>]’
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/Matrix.h:180: instantiated
>> > from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>&
>> > Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows,
>> > _MaxCols>::operator=(const Eigen::MatrixBase<OtherDerived>&) [with
>> > OtherDerived = Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>, 5>, _Scalar = std::complex<dd_real>, int
>> > _Rows = 33331, int _Cols = 33331, int _Options = 0, int _MaxRows = 33331,
>> > int _MaxCols = 33331]’
>> >
>> > qd-gemv.cpp:96: instantiated from here (this line is 'C=A*B;' where
>> > all are 5x5 matrices of complex<dd_real>)
>> >
>> > /usr/local/include/eigen3/Eigen/src/Core/ProductBase.h:107: error: no
>> > matching function for call to
>> > ‘Eigen::ProductBase<Eigen::GeneralProduct<Eigen::Matrix<std::complex<dd_r
>> >eal>, 33331, 33331, 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>, 5>, Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>, Eigen::Matrix<std::complex<dd_real>,
>> > 33331, 33331, 0, 33331, 33331>
>> >
>> >>::scaleAndAddTo(Eigen::Matrix<std::complex<dd_real>, 33331, 33331, 0,
>> >>:: 33331, 33331>&, int) const’
>> >
>> > make: *** [qd-gemv] Error 1
>
>