New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 516 - compile error qd_real and Sparse * Sparse
Summary: compile error qd_real and Sparse * Sparse
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.1
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-27 11:30 UTC by Ralf Denzer
Modified: 2012-09-27 11:47 UTC (History)
1 user (show)



Attachments

Description Ralf Denzer 2012-09-27 11:30:03 UTC
Hello, 

this looks similar as Bug 515, i.e. a missing explicit scalar conversion.

My test code is  (gcc 4.7.1)

#include <iostream>
#include "qd/qd_real.h"
#include "Eigen3_1_1/Eigen/Dense"
#include "Eigen3_1_1/Eigen/Sparse"

//typedef double FLOAT;
typedef qd_real FLOAT;

typedef Eigen::SparseMatrix<FLOAT> SpMat;

int main(int argc, char **argv)
{
    const int m = 3;
    SpMat A(m,m);
    A.insert(0,0) = 1.0;
    A.insert(1,1) = 2.0;
    A.insert(2,2) = 3.0;
    A.makeCompressed(); 
    
    SpMat B(m,m);
    B.insert(0,0) = 1.0;
    B.insert(1,1) = 2.0;
    B.insert(2,2) = 3.0;
    B.makeCompressed();
    
    SpMat C(m,m);
    
    C = A * B;
    
    std::cout << C << std::endl;

    return 0;
}

The line C = A * B; triggers compiler errors in 

/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseMatrix.h:895:34: error: ambiguous overload for ‘operator=’ in ‘((Eigen::SparseMatrix<qd_real>*)this)->Eigen::SparseMatrix<qd_real>::m_data.Eigen::internal::CompressedStorage<_Scalar, _Index>::value<qd_real, int>(((std::size_t)p)) = 0’

Please check also the line 912 in the same file. The code looks similar.

and 

/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/AmbiVector.h:299:9: error: ambiguous overload for ‘operator=’ in ‘((Eigen::internal::AmbiVector<qd_real, int>::Iterator*)this)->Eigen::internal::AmbiVector<qd_real, int>::Iterator::m_cachedValue = 0’

In the same file please see also line 311 it's the same code.

Bye and thanks 

Ralf (sorry for bugging you with this qd_real story) 

The full compiler message is:

/home/denzer/projects/eigen_qd_real_test/debug_build> make
Scanning dependencies of target eigen_qd_real_test
[100%] Building CXX object CMakeFiles/eigen_qd_real_test.dir/main.o
In file included from /home/denzer/local/include/Eigen3_1_1/Eigen/SparseCore:40:0,
                 from /home/denzer/local/include/Eigen3_1_1/Eigen/Sparse:17,
                 from /home/denzer/projects/eigen_qd_real_test/main.cpp:92:
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseMatrix.h: In instantiation of ‘Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Scalar& Eigen::SparseMatrix<_Scalar, _Flags, _Index>::insertUncompressed(Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Index, Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Index) [with _Scalar = qd_real; int _Options = 0; _Index = int; Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Scalar = qd_real; Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Index = int]’:
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseMatrix.h:222:40:   required from ‘Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Scalar& Eigen::SparseMatrix<_Scalar, _Flags, _Index>::insert(Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Index, Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Index) [with _Scalar = qd_real; int _Options = 0; _Index = int; Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Scalar = qd_real; Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Index = int]’
/home/denzer/projects/eigen_qd_real_test/main.cpp:104:17:   required from here
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseMatrix.h:895:34: error: ambiguous overload for ‘operator=’ in ‘((Eigen::SparseMatrix<qd_real>*)this)->Eigen::SparseMatrix<qd_real>::m_data.Eigen::internal::CompressedStorage<_Scalar, _Index>::value<qd_real, int>(((std::size_t)p)) = 0’
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseMatrix.h:895:34: note: candidates are:
In file included from /home/denzer/local/include/qd/qd_real.h:290:0,
                 from /home/denzer/projects/eigen_qd_real_test/main.cpp:90:
/home/denzer/local/include/qd/qd_inline.h:815:17: note: qd_real& qd_real::operator=(double)
/home/denzer/local/include/qd/qd_inline.h:822:17: note: qd_real& qd_real::operator=(const dd_real&)
In file included from /home/denzer/projects/eigen_qd_real_test/main.cpp:90:0:
/home/denzer/local/include/qd/qd_real.h:114:12: note: qd_real& qd_real::operator=(const char*)
/home/denzer/local/include/qd/qd_real.h:32:15: note: qd_real& qd_real::operator=(const qd_real&)
/home/denzer/local/include/qd/qd_real.h:32:15: note: qd_real& qd_real::operator=(qd_real&&)
In file included from /home/denzer/local/include/Eigen3_1_1/Eigen/SparseCore:39:0,
                 from /home/denzer/local/include/Eigen3_1_1/Eigen/Sparse:17,
                 from /home/denzer/projects/eigen_qd_real_test/main.cpp:92:
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/AmbiVector.h: In instantiation of ‘Eigen::internal::AmbiVector<_Scalar, _Index>::Iterator::Iterator(const Eigen::internal::AmbiVector<_Scalar, _Index>&, Eigen::internal::AmbiVector<_Scalar, _Index>::Iterator::RealScalar) [with _Scalar = qd_real; _Index = int; Eigen::internal::AmbiVector<_Scalar, _Index> = Eigen::internal::AmbiVector<qd_real, int>; Eigen::internal::AmbiVector<_Scalar, _Index>::Iterator::RealScalar = qd_real]’:
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseSparseProductWithPruning.h:70:77:   required from ‘void Eigen::internal::sparse_sparse_product_with_pruning_impl(const Lhs&, const Rhs&, ResultType&, typename ResultType::RealScalar) [with Lhs = Eigen::SparseMatrix<qd_real>; Rhs = Eigen::SparseMatrix<qd_real>; ResultType = Eigen::SparseMatrix<qd_real>; typename ResultType::RealScalar = qd_real]’
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseSparseProductWithPruning.h:91:5:   required from ‘static void Eigen::internal::sparse_sparse_product_with_pruning_selector<Lhs, Rhs, ResultType, 0, 0, 0>::run(const Lhs&, const Rhs&, ResultType&, Eigen::internal::sparse_sparse_product_with_pruning_selector<Lhs, Rhs, ResultType, 0, 0, 0>::RealScalar) [with Lhs = Eigen::SparseMatrix<qd_real>; Rhs = Eigen::SparseMatrix<qd_real>; ResultType = Eigen::SparseMatrix<qd_real>; Eigen::internal::sparse_sparse_product_with_pruning_selector<Lhs, Rhs, ResultType, 0, 0, 0>::RealScalar = qd_real]’
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseProduct.h:119:9:   required from ‘void Eigen::SparseSparseProduct<Lhs, Rhs>::evalTo(Dest&) const [with Dest = Eigen::SparseMatrix<qd_real>; LhsNested = const Eigen::SparseMatrix<qd_real>&; RhsNested = const Eigen::SparseMatrix<qd_real>&]’
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseProduct.h:161:3:   required from ‘Derived& Eigen::SparseMatrixBase<Derived>::operator=(const Eigen::SparseSparseProduct<Lhs, Rhs>&) [with Lhs = const Eigen::SparseMatrix<qd_real>&; Rhs = const Eigen::SparseMatrix<qd_real>&; Derived = Eigen::SparseMatrix<qd_real>]’
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseMatrix.h:612:37:   required from ‘Eigen::SparseMatrix<_Scalar, _Flags, _Index>& Eigen::SparseMatrix<_Scalar, _Flags, _Index>::operator=(const Eigen::SparseSparseProduct<Lhs, Rhs>&) [with Lhs = const Eigen::SparseMatrix<qd_real>&; Rhs = const Eigen::SparseMatrix<qd_real>&; _Scalar = qd_real; int _Options = 0; _Index = int; Eigen::SparseMatrix<_Scalar, _Flags, _Index> = Eigen::SparseMatrix<qd_real>]’
/home/denzer/projects/eigen_qd_real_test/main.cpp:117:13:   required from here
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/AmbiVector.h:299:9: error: ambiguous overload for ‘operator=’ in ‘((Eigen::internal::AmbiVector<qd_real, int>::Iterator*)this)->Eigen::internal::AmbiVector<qd_real, int>::Iterator::m_cachedValue = 0’
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/AmbiVector.h:299:9: note: candidates are:
In file included from /home/denzer/local/include/qd/qd_real.h:290:0,
                 from /home/denzer/projects/eigen_qd_real_test/main.cpp:90:
/home/denzer/local/include/qd/qd_inline.h:815:17: note: qd_real& qd_real::operator=(double)
/home/denzer/local/include/qd/qd_inline.h:822:17: note: qd_real& qd_real::operator=(const dd_real&)
In file included from /home/denzer/projects/eigen_qd_real_test/main.cpp:90:0:
/home/denzer/local/include/qd/qd_real.h:114:12: note: qd_real& qd_real::operator=(const char*)
/home/denzer/local/include/qd/qd_real.h:32:15: note: qd_real& qd_real::operator=(const qd_real&)
/home/denzer/local/include/qd/qd_real.h:32:15: note: qd_real& qd_real::operator=(qd_real&&)
In file included from /home/denzer/local/include/Eigen3_1_1/Eigen/SparseCore:39:0,
                 from /home/denzer/local/include/Eigen3_1_1/Eigen/Sparse:17,
                 from /home/denzer/projects/eigen_qd_real_test/main.cpp:92:
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/AmbiVector.h:311:11: error: ambiguous overload for ‘operator=’ in ‘((Eigen::internal::AmbiVector<qd_real, int>::Iterator*)this)->Eigen::internal::AmbiVector<qd_real, int>::Iterator::m_cachedValue = 0’
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/AmbiVector.h:311:11: note: candidates are:
In file included from /home/denzer/local/include/qd/qd_real.h:290:0,
                 from /home/denzer/projects/eigen_qd_real_test/main.cpp:90:
/home/denzer/local/include/qd/qd_inline.h:815:17: note: qd_real& qd_real::operator=(double)
/home/denzer/local/include/qd/qd_inline.h:822:17: note: qd_real& qd_real::operator=(const dd_real&)
In file included from /home/denzer/projects/eigen_qd_real_test/main.cpp:90:0:
/home/denzer/local/include/qd/qd_real.h:114:12: note: qd_real& qd_real::operator=(const char*)
/home/denzer/local/include/qd/qd_real.h:32:15: note: qd_real& qd_real::operator=(const qd_real&)
/home/denzer/local/include/qd/qd_real.h:32:15: note: qd_real& qd_real::operator=(qd_real&&)
In file included from /home/denzer/local/include/Eigen3_1_1/Eigen/SparseCore:40:0,
                 from /home/denzer/local/include/Eigen3_1_1/Eigen/Sparse:17,
                 from /home/denzer/projects/eigen_qd_real_test/main.cpp:92:
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseMatrix.h: In member function ‘Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Scalar& Eigen::SparseMatrix<_Scalar, _Flags, _Index>::insertUncompressed(Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Index, Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Index) [with _Scalar = qd_real; int _Options = 0; _Index = int; Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Scalar = qd_real; Eigen::SparseMatrix<_Scalar, _Flags, _Index>::Index = int]’:
/home/denzer/local/include/Eigen3_1_1/Eigen/src/SparseCore/SparseMatrix.h:896:5: warning: control reaches end of non-void function [-Wreturn-type]
make[2]: *** [CMakeFiles/eigen_qd_real_test.dir/main.o] Error 1
make[1]: *** [CMakeFiles/eigen_qd_real_test.dir/all] Error 2
make: *** [all] Error 2
*** Failed ***

Note You need to log in before you can comment on or make changes to this bug.