Registered Member
|
Hi, i'm an eigen noob. And i get the following errors when i test an eigen sample program,as follow:
#include <iostream> #include <Eigen/Dense> #include <Eigen/Sparse> using namespace Eigen; using namespace std; int main() { MatrixXf m = MatrixXf::Random(3,3); m = (m + MatrixXf::Constant(3,3,1.2)) * 50; cout << "m =" << endl << m << endl; VectorXf v(3); v << 1, 2, 3; cout << "m * v =" << endl << m * v << endl; Matrix<double, 1, Dynamic> mat(1,3); for (int i = 0; i < 3; ++i) { mat(i) = 1.0 * i; } cout<<"mat="<<endl<<mat<<endl; Matrix<double, 1, Dynamic> mat1(1,3); mat1 = mat; cout<<"mat1="<<endl<<mat1<<endl; } if i comment on the line #include <Eigen/Sparse>, it will run okay; otherwise, it has the following errors. Additionally, my development platform is msvc2008 professional, intel c++ compiler (v10.1.021) on window 7 and using vc++ compiler, none errors occur!!! ================================================================================ build info: 1>------ Rebuild All started: Project: test_01, Configuration: Debug Win32 ------ 1>Deleting intermediate files and output files for project 'test_01', configuration 'Debug|Win32'. 1>Compiling with Intel(R) C++ 10.1.021 [IA-32]... (Intel C++ Environment) 1>main_test.cpp 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: incomplete type is not allowed 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/Core/util/XprHelper.h(194): error: incomplete type is not allowed 1> template<typename T, typename StorageKind = typename traits<T>::StorageKind> struct eval; 1> ^ 1> detected during: 1> processing of template argument list for "Eigen::internal::eval" based on template argument <<error-type>> at line 307 1> processing of template argument list for "Eigen::internal::nested" based on template arguments <<error-type>, 1> at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/Core/util/XprHelper.h(307): error: incomplete type is not allowed 1> template<typename T, int n=1, typename PlainObject = typename eval<T>::type> struct nested 1> ^ 1> detected during processing of template argument list for "Eigen::internal::nested" based on template arguments <<error-type>, 1> at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/Core/util/XprHelper.h(316): error: incomplete type is not allowed 1> ScalarReadCost = NumTraits<typename traits<T>::Scalar>::ReadCost, 1> ^ 1> detected during instantiation of class "Eigen::internal::nested<T, n, PlainObject> [with T=<error-type>, n=1, PlainObject=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/Core/util/XprHelper.h(318): error: incomplete type is not allowed 1> CoeffReadCost = traits<T>::CoeffReadCost, 1> ^ 1> detected during instantiation of class "Eigen::internal::nested<T, n, PlainObject> [with T=<error-type>, n=1, PlainObject=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/Core/util/XprHelper.h(326): error: incomplete type is not allowed 1> ( (int(traits<T>::Flags) & EvalBeforeNestingBit) || 1> ^ 1> detected during instantiation of class "Eigen::internal::nested<T, n, PlainObject> [with T=<error-type>, n=1, PlainObject=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/Core/util/XprHelper.h(270): error: incomplete type is not allowed 1> bool(traits<T>::Flags & NestByRefBit), 1> ^ 1> detected during: 1> instantiation of class "Eigen::internal::ref_selector<T> [with T=<error-type>]" at line 330 1> instantiation of class "Eigen::internal::nested<T, n, PlainObject> [with T=<error-type>, n=1, PlainObject=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: incomplete type is not allowed 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: incomplete type is not allowed 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: incomplete type is not allowed 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: incomplete type is not allowed 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: incomplete type is not allowed 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator) 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: incomplete type is not allowed 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/Core/EigenBase.h(44): error: incomplete type is not allowed 1> typedef typename internal::traits<Derived>::StorageKind StorageKind; 1> ^ 1> detected during: 1> instantiation of class "Eigen::EigenBase<Derived> [with Derived=<error-type>]" at line 39 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h" 1> instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/Core/EigenBase.h(45): error: incomplete type is not allowed 1> typedef typename internal::traits<Derived>::Index Index; 1> ^ 1> detected during: 1> instantiation of class "Eigen::EigenBase<Derived> [with Derived=<error-type>]" at line 39 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h" 1> instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(43): error: incomplete type is not allowed 1> typedef typename internal::traits<Derived>::Scalar Scalar; 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(45): error: incomplete type is not allowed 1> typedef typename internal::traits<Derived>::StorageKind StorageKind; 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(46): error: incomplete type is not allowed 1> typedef typename internal::traits<Derived>::Index Index; 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(63): error: incomplete type is not allowed 1> RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime, 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(69): error: incomplete type is not allowed 1> ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime, 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(76): error: incomplete type is not allowed 1> SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime, 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(77): error: incomplete type is not allowed 1> internal::traits<Derived>::ColsAtCompileTime>::ret), 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(94): error: incomplete type is not allowed 1> Flags = internal::traits<Derived>::Flags, 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(99): error: incomplete type is not allowed 1> CoeffReadCost = internal::traits<Derived>::CoeffReadCost, 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/../plugins/CommonCwiseUnaryOps.h(58): error: incomplete type is not allowed 1> inline const CwiseUnaryOp<internal::scalar_opposite_op<typename internal::traits<Derived>::Scalar>, const Derived> 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/../plugins/CommonCwiseUnaryOps.h(75): error: incomplete type is not allowed 1> inline const CwiseUnaryOp<internal::scalar_quotient1_op<typename internal::traits<Derived>::Scalar>, const Derived> 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/../plugins/CommonCwiseUnaryOps.h(106): error: incomplete type is not allowed 1> typename internal::cast_return_type<Derived,const CwiseUnaryOp<internal::scalar_cast_op<typename internal::traits<Derived>::Scalar, NewType>, const Derived> >::type 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/../plugins/CommonCwiseUnaryOps.h(106): error: incomplete type is not allowed 1> typename internal::cast_return_type<Derived,const CwiseUnaryOp<internal::scalar_cast_op<typename internal::traits<Derived>::Scalar, NewType>, const Derived> >::type 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/../plugins/MatrixCwiseBinaryOps.h(36): error: incomplete type is not allowed 1> EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived) 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/../plugins/MatrixCwiseBinaryOps.h(36): error: incomplete type is not allowed 1> EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE(Derived,OtherDerived) 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(345): error: incomplete type is not allowed 1> EIGEN_STRONG_INLINE const EIGEN_SPARSE_CWISE_PRODUCT_RETURN_TYPE 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(345): error: incomplete type is not allowed 1> EIGEN_STRONG_INLINE const EIGEN_SPARSE_CWISE_PRODUCT_RETURN_TYPE 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseUtil.h(102): error: incomplete type is not allowed 1> template<typename Lhs, typename Rhs, int InnerSize = internal::traits<Lhs>::ColsAtCompileTime> struct SparseDenseProductReturnType; 1> ^ 1> detected during: 1> processing of template argument list for "Eigen::SparseDenseProductReturnType" based on template arguments <<error-type>, OtherDerived> at line 372 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h" 1> instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseUtil.h(102): error: incomplete type is not allowed 1> template<typename Lhs, typename Rhs, int InnerSize = internal::traits<Lhs>::ColsAtCompileTime> struct SparseDenseProductReturnType; 1> ^ 1> detected during: 1> processing of template argument list for "Eigen::SparseDenseProductReturnType" based on template arguments <<error-type>, OtherDerived> at line 372 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h" 1> instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseMatrixBase.h(455): error: incomplete type is not allowed 1> inline const typename internal::eval<Derived>::type eval() const 1> ^ 1> detected during instantiation of class "Eigen::SparseMatrixBase<Derived> [with Derived=<error-type>]" at line 34 of "D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h" 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: invalid base class 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>D:\_open-src-lib\eigen-3.1.0-20120206\Eigen/src/SparseCore/SparseTranspose.h(34): error: invalid base class 1> EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType>) 1> ^ 1> 1>compilation aborted for .\main_test.cpp (code 2) 1>Build log was saved at "file://D:\_PolyMesh\_Eigen 3-test\test_01\test_01\Debug\BuildLog.htm" 1>test_01 - 46 error(s), 0 warning(s) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== Can anyone give me some help? tks |
Administrator
|
Moved to Eigen forum.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Moderator
|
since I cannot reproduce, can you tell me whether changing the line 34 of Eigen/src/SparseCore/SparseTranspose.h to:
EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose<MatrixType> ) fixes the issues? (note the additional space) thanks. |
Registered Member
|
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], q.ignora, watchstar