Re: [eigen] More sparse operator issues

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


Thank you.
Sameer


On Fri, Jun 25, 2010 at 1:25 AM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
> fixed.
>
> gael
>
> On Fri, Jun 25, 2010 at 12:39 AM, Sameer Agarwal
> <sameeragarwal@xxxxxxxxxx> wrote:
>> Hi Guys,
>>
>> The following code
>>
>> #include "../eigen/Eigen/Core"
>> #include "../eigen/Eigen/Sparse"
>>
>> int main() {
>>  Eigen::SparseMatrix<double, Eigen::ColMajor> m(5,5);
>>  Eigen::SparseVector<double> x(5,1);
>>  Eigen::SparseVector<double> y = (m*x)/2;
>> }
>>
>> fails with
>>
>> ../eigen/Eigen/src/Sparse/SparseTranspose.h: In constructor
>> ‘Eigen::TransposeImpl<MatrixType,
>> Eigen::Sparse>::InnerIterator::InnerIterator(const
>> Eigen::TransposeImpl<MatrixType, Eigen::Sparse>&, typename
>> Eigen::ei_traits<Eigen::Transpose<Derived> >::Index) [with MatrixType
>> = Eigen::CwiseUnaryOp<Eigen::ei_scalar_quotient1_op<double>,
>> Eigen::SparseProduct<const Eigen::SparseMatrix<double, 0, int>&, const
>> Eigen::SparseVector<double, 0, int>&> >]’:
>> ../eigen/Eigen/src/Sparse/SparseMatrixBase.h:238:   instantiated from
>> ‘Derived& Eigen::SparseMatrixBase<Derived>::operator=(const
>> Eigen::SparseMatrixBase<OtherDerived>&) [with OtherDerived =
>> Eigen::Transpose<Eigen::CwiseUnaryOp<Eigen::ei_scalar_quotient1_op<double>,
>> Eigen::SparseProduct<const Eigen::SparseMatrix<double, 0, int>&, const
>> Eigen::SparseVector<double, 0, int>&> > >, Derived =
>> Eigen::SparseVector<double, 0, int>]’
>> ../eigen/Eigen/src/Sparse/SparseVector.h:243:   instantiated from
>> ‘Eigen::SparseVector<_Scalar, _Flags, _Index>&
>> Eigen::SparseVector<_Scalar, _Flags, _Index>::operator=(const
>> Eigen::SparseMatrixBase<OtherDerived>&) [with OtherDerived =
>> Eigen::CwiseUnaryOp<Eigen::ei_scalar_quotient1_op<double>,
>> Eigen::SparseProduct<const Eigen::SparseMatrix<double, 0, int>&, const
>> Eigen::SparseVector<double, 0, int>&> >, _Scalar = double, int
>> _Options = 0, _Index = int]’
>> ../eigen/Eigen/src/Sparse/SparseVector.h:210:   instantiated from
>> ‘Eigen::SparseVector<_Scalar, _Flags, _Index>::SparseVector(const
>> Eigen::SparseMatrixBase<OtherDerived>&) [with OtherDerived =
>> Eigen::CwiseUnaryOp<Eigen::ei_scalar_quotient1_op<double>,
>> Eigen::SparseProduct<const Eigen::SparseMatrix<double, 0, int>&, const
>> Eigen::SparseVector<double, 0, int>&> >, _Scalar = double, int
>> _Options = 0, _Index = int]’
>> test_sparse.cc:7:   instantiated from here
>> ../eigen/Eigen/src/Sparse/SparseTranspose.h:60: error: no matching
>> function for call to
>> ‘Eigen::CwiseUnaryOpImpl<Eigen::ei_scalar_quotient1_op<double>,
>> Eigen::SparseProduct<const Eigen::SparseMatrix<double, 0, int>&, const
>> Eigen::SparseVector<double, 0, int>&>,
>> Eigen::Sparse>::InnerIterator::InnerIterator(const
>> Eigen::SparseMatrix<double, 6, int>&, int&)’
>> ../eigen/Eigen/src/Sparse/SparseCwiseUnaryOp.h:63: note: candidates
>> are: Eigen::CwiseUnaryOpImpl<UnaryOp, MatrixType,
>> Eigen::Sparse>::InnerIterator::InnerIterator(const
>> Eigen::CwiseUnaryOpImpl<UnaryOp, MatrixType, Eigen::Sparse>&, typename
>> MatrixType::Index) [with UnaryOp =
>> Eigen::ei_scalar_quotient1_op<double>, MatrixType =
>> Eigen::SparseProduct<const Eigen::SparseMatrix<double, 0, int>&, const
>> Eigen::SparseVector<double, 0, int>&>]
>> ../eigen/Eigen/src/Sparse/SparseCwiseUnaryOp.h:56: note:
>>  Eigen::CwiseUnaryOpImpl<Eigen::ei_scalar_quotient1_op<double>,
>> Eigen::SparseProduct<const Eigen::SparseMatrix<double, 0, int>&, const
>> Eigen::SparseVector<double, 0, int>&>,
>> Eigen::Sparse>::InnerIterator::InnerIterator(const
>> Eigen::CwiseUnaryOpImpl<Eigen::ei_scalar_quotient1_op<double>,
>> Eigen::SparseProduct<const Eigen::SparseMatrix<double, 0, int>&, const
>> Eigen::SparseVector<double, 0, int>&>, Eigen::Sparse>::InnerIterator&
>>
>> whereas the following works
>>
>> #include "../eigen/Eigen/Core"
>> #include "../eigen/Eigen/Sparse"
>>
>> int main() {
>>  Eigen::SparseMatrix<double, Eigen::ColMajor> m(5,5);
>>  Eigen::SparseVector<double> x(5,1);
>>  Eigen::SparseVector<double> y = m*(x/2);
>> }
>>
>> Thanks,
>> Sameer
>>
>>
>>
>
>
>



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