This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Eigen::SparseLU compilation warning

Tags: sparcelu, complex numbers, compilation warnings sparcelu, complex numbers, compilation warnings sparcelu, complex numbers, compilation warnings
(comma "," separated)
michaelmedvinsky
Registered Member
Posts
2
Karma
0

Eigen::SparseLU compilation warning

Sat Mar 12, 2016 1:42 am
This question is same as I've posted here, but nobody answered yet, so I hope here is the more reasonable place to ask.

I'm trying to work with Eigen (latest version) and get some troubles.
Please explain me what am I doing wrong or how to remove the following compilation warning (compiled with Visual Studio C++)


Code: Select all
  typedef std::complex<double> Complex;
    typedef Eigen::SparseMatrix<Complex> SpMat;
    typedef Eigen::VectorXcd SpVec;
    typedef Eigen::SparseLU<SpMat> SolverT;

   SpMat m_Matrix;
   SpVec m_Rhs;

    SolverT LU(m_Matrix);
    VectorXcd x = LU.solve(m_Rhs);


the last line produces several warnings similar to the following (all in sparselu.h)

warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data
with
[
Derived=Eigen::Matrix<std::complex<double>,-1,1,0,-1,1>
]

Changing the matrix type to

Code: Select all
    typedef Eigen::SparseMatrix<Complex,Eigen::ColMajor, __int64> SpMat;


doesn't help and complaint again, but with different warnings, e.g.
sparselu.h(462) : warning C4244 : 'argument' : conversion from '__int64' to 'int', possible loss of data
sparselu.h(416) : note : while compiling class template member function 'void Eigen::SparseLU<SpMat,Eigen::COLAMDOrdering<__int64>>::analyzePattern(const Eigen::SparseMatrix<Complex,0,__int64> &)'
sparselu.h(115) : note : see reference to function template instantiation 'void Eigen::SparseLU<SpMat,Eigen::COLAMDOrdering<__int64>>::analyzePattern(const Eigen::SparseMatrix<Complex,0,__int64> &)' being compiled
note : see reference to class template instantiation 'Eigen::SparseLU<SpMat,Eigen::COLAMDOrdering<__int64>>' being compiled
sparselu_panel_bmod.h(209) : warning C4244 : 'argument' : conversion from '__int64' to 'const int', possible loss of data
sparselu_panel_bmod.h(59) : note : while compiling class template member function 'void Eigen::internal::SparseLUImpl<std::complex<double>,__int64>::panel_bmod(const Index,const Index,const Index,const Index,Eigen::Matrix<std::complex<double>,-1,1,0,-1,1> &,Eigen::Matrix<std::complex<double>,-1,1,0,-1,1> &,Eigen::Matrix<__int64,-1,1,0,-1,1> &,Eigen::Matrix<__int64,-1,1,0,-1,1> &,Eigen::internal::LU_GlobalLU_t<Eigen::Matrix<__int64,-1,1,0,-1,1>,Eigen::Matrix<std::complex<double>,-1,1,0,-1,1>> &)'
with
[
Index = __int64
]
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
What do you mean by "latest"? 3.2.8? 3.3-beta1? devel branch?

Anyway, I cannot see such warnings in our msvc builds. Which version of msvc are you using?
michaelmedvinsky
Registered Member
Posts
2
Karma
0
Thanks for your answer,

Microsoft Visual Studio Community 2015 version 14.0.242720.00 Update 1
Visual C++ 2015 00322-20000-00000-AA565


The Eigen version is 3.2.8 more precisely eigen-eigen-07105f7124f9.
I didn't install anything just copied the Eigen subdirectory to the project (visual studio for some reason didn't recognize it when I put the original location in path to the Additional including directories)

any ideas?
perhaps some invalid project properties that I could use?


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft