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

Warning coming from .inverse()

Tags: None
(comma "," separated)
lucaquaglia
Registered Member
Posts
1
Karma
0

Warning coming from .inverse()

Thu Jul 23, 2015 4:18 pm
Dear Eigen users,

Recently, while using this great library, I have stumbled on a very minor issue.
Here is a C++ snippet of code which produces a warning that I think comes from a small incompatibility between two sections of the library (I have used dynamic matrixes because that is the original setting this warning appeared in):
-----
Matrix<double, 3, 3> source;
source << 1, 2, 3, 3, 1, 2, 2, 3, 1;

Matrix<double, Dynamic, Dynamic> data = source;

Matrix<double, Dynamic, Dynamic> result = data.inverse();
----
The warning is the following (well, there are several warnings but all of the same kind):

Eigen/src/LU/PartialPivLU.h:405:31: Implicit conversion loses integer precision: 'const Index' (aka 'const long') to 'int'

It seems that upon instantiation of the (dynamic) matrix objects, the type for the indexes is taken as "long" but within the routine to compute the inverse matrix (smartly using LU decomposition) the type for the indexes is taken as "int".

Is this a problem? For practical purposes not. On my system the size of an "int" is very large INT_MAX = 2147483647, so down casting from "long" to "int" would not risk causing any issues. But it will cause an issue for systems with INT_MAX = 32767 and dealing with extremely large matrixes.

Have you ever encountered this warning? If yes, have you managed to eliminate it?

It is just a minor warning, not at all fatal and without any practical consequences.
But if someone would like to look into it, that would be cool!

Thank you, LucaQ
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Warning coming from .inverse()

Fri Jul 24, 2015 8:24 am
All these int versus std::ptrdiff_t issues has been resolved in the devel branch (future 3.3)


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]