Re: [eigen] Bug with "vec.cwise() + scalar"?

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


I cannot try it now, but at least this features requires the array
module, so please try adding:

#include <Eigen/Array>

cheers,
gael

On Sat, Apr 18, 2009 at 11:00 AM, Ricard Marxer Piñón
<email@xxxxxxxxxxxxxxxx> wrote:
> Hi,
>
> Find attached a little test which fails to compile with Eigen 2.0.1 (and
> SVN):
>
> ../eigen2/Eigen/src/Core/CwiseUnaryOp.h: In instantiation of
> ‘Eigen::CwiseUnaryOp<Eigen::ei_scalar_add_op<float>, Eigen::Matrix<float, 4,
> 1, 0, 4, 1> >’:
> test_vector_add.cpp:13:   instantiated from here
> ../eigen2/Eigen/src/Core/CwiseUnaryOp.h:97: error:
> ‘Eigen::CwiseUnaryOp<UnaryOp, MatrixType>::m_functor’ has incomplete type
> ../eigen2/Eigen/src/Core/util/ForwardDeclarations.h:89: error: declaration
> of ‘const struct Eigen::ei_scalar_add_op<float>’
> ../eigen2/Eigen/src/Core/CwiseUnaryOp.h: In member function ‘const typename
> Eigen::ei_traits<Eigen::CwiseUnaryOp<UnaryOp, MatrixType> >::Scalar
> Eigen::CwiseUnaryOp<UnaryOp, MatrixType>::coeff(int, int) const [with
> UnaryOp = Eigen::ei_scalar_add_op<float>, MatrixType = Eigen::Matrix<float,
> 4, 1, 0, 4, 1>]’:
> ../eigen2/Eigen/src/Core/Coeffs.h:331:   instantiated from ‘void
> Eigen::MatrixBase<Derived>::copyCoeff(int, int, const
> Eigen::MatrixBase<OtherDerived>&) [with OtherDerived =
> Eigen::CwiseUnaryOp<Eigen::ei_scalar_add_op<float>, Eigen::Matrix<float, 4,
> 1, 0, 4, 1> >, Derived = Eigen::Matrix<float, 4, 1, 0, 4, 1>]’
> ../eigen2/Eigen/src/Core/Assign.h:117:   instantiated from ‘static void
> Eigen::ei_assign_novec_CompleteUnrolling<Derived1, Derived2, Index,
> Stop>::run(Derived1&, const Derived2&) [with Derived1 = Eigen::Matrix<float,
> 4, 1, 0, 4, 1>, Derived2 =
> Eigen::CwiseUnaryOp<Eigen::ei_scalar_add_op<float>, Eigen::Matrix<float, 4,
> 1, 0, 4, 1> >, int Index = 0, int Stop = 4]’
> ../eigen2/Eigen/src/Core/Assign.h:233:   instantiated from ‘static void
> Eigen::ei_assign_impl<Derived1, Derived2, 3, 2>::run(Derived1&, const
> Derived2&) [with Derived1 = Eigen::Matrix<float, 4, 1, 0, 4, 1>, Derived2 =
> Eigen::CwiseUnaryOp<Eigen::ei_scalar_add_op<float>, Eigen::Matrix<float, 4,
> 1, 0, 4, 1> >]’
> ../eigen2/Eigen/src/Core/Assign.h:407:   instantiated from ‘Derived&
> Eigen::MatrixBase<Derived>::lazyAssign(const
> Eigen::MatrixBase<OtherDerived>&) [with OtherDerived =
> Eigen::CwiseUnaryOp<Eigen::ei_scalar_add_op<float>, Eigen::Matrix<float, 4,
> 1, 0, 4, 1> >, Derived = Eigen::Matrix<float, 4, 1, 0, 4, 1>]’
> ../eigen2/Eigen/src/Core/Assign.h:422:   instantiated from ‘static Derived&
> Eigen::ei_assign_selector<Derived, OtherDerived, false,
> false>::run(Derived&, const OtherDerived&) [with Derived =
> Eigen::Matrix<float, 4, 1, 0, 4, 1>, OtherDerived =
> Eigen::CwiseUnaryOp<Eigen::ei_scalar_add_op<float>, Eigen::Matrix<float, 4,
> 1, 0, 4, 1> >]’
> ../eigen2/Eigen/src/Core/Matrix.h:532:   instantiated from
> ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>&
> Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows,
> _MaxCols>::_set_noalias(const Eigen::MatrixBase<OtherDerived>&) [with
> OtherDerived = Eigen::CwiseUnaryOp<Eigen::ei_scalar_add_op<float>,
> Eigen::Matrix<float, 4, 1, 0, 4, 1> >, _Scalar = float, int _Rows = 4, int
> _Cols = 1, int _Options = 0, int _MaxRows = 4, int _MaxCols = 1]’
> ../eigen2/Eigen/src/Core/Matrix.h:410:   instantiated from
> ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows,
> _MaxCols>::Matrix(const Eigen::MatrixBase<OtherDerived>&) [with OtherDerived
> = Eigen::CwiseUnaryOp<Eigen::ei_scalar_add_op<float>, Eigen::Matrix<float,
> 4, 1, 0, 4, 1> >, _Scalar = float, int _Rows = 4, int _Cols = 1, int
> _Options = 0, int _MaxRows = 4, int _MaxCols = 1]’
> test_vector_add.cpp:13:   instantiated from here
> ../eigen2/Eigen/src/Core/CwiseUnaryOp.h:75: error: using invalid field
> ‘Eigen::CwiseUnaryOp<UnaryOp, MatrixType>::m_functor’
>
>
> I don't know if it is a bug or it's not the way it is supposed to be used..
>
> I wish I had found this before 2.0.1 release, but I have been a bit occupied
> with other things (new job).
> Anyway, as soon as I get some free time I'm back to doing the small and
> simple stuff I can for Eigen.
>
> --
> ricard
> http://www.ricardmarxer.com
> http://www.caligraft.com



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