Declaration of Vector and Matrix gives an error which changes the meaning of those properties #215
-
After installing In file included from /home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:10:
/home/neel/volesti/test/../include/sos/barriers/LHSCB.h:16:31: error: declaration of ‘typedef Vector<T> LHSCB<IPMDouble>::Vector’ changes meaning of ‘Vector’ [-fpermissive]
16 | typedef Vector<IPMDouble> Vector;
| ^~~~~~
In file included from /home/neel/volesti/test/../include/sos/barriers/LHSCB.h:12,
from /home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:10:
../include/sos/utils.h:75:7: note: ‘Vector’ declared here as ‘using Vector = class Eigen::Matrix<Type, -1, 1>’
75 | using Vector = Eigen::Matrix<T, Eigen::Dynamic, 1>;
| ^~~~~~
In file included from /home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:10:
/home/neel/volesti/test/../include/sos/barriers/LHSCB.h:17:31: error: declaration of ‘typedef Matrix<T> LHSCB<IPMDouble>::Matrix’ changes meaning of ‘Matrix’ [-fpermissive]
17 | typedef Matrix<IPMDouble> Matrix;
| ^~~~~~
In file included from /home/neel/volesti/test/../include/sos/barriers/LHSCB.h:12,
from /home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:10:
../include/sos/utils.h:72:7: note: ‘Matrix’ declared here as ‘using Matrix = class Eigen::Matrix<Type, -1, -1>’
72 | using Matrix = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;
| ^~~~~~
/home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:17:11: error: declaration of ‘using LHSCB = class LHSCB<IPMDouble>’ changes meaning of ‘LHSCB’ [-fpermissive]
17 | using LHSCB = LHSCB<IPMDouble>;
| ^~~~~
In file included from /home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:10:
/home/neel/volesti/test/../include/sos/barriers/LHSCB.h:15:7: note: ‘LHSCB’ declared here as ‘class LHSCB<IPMDouble>’
15 | class LHSCB {
| ^~~~~
/home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:19:31: error: declaration of ‘typedef Vector<T> ZeroSpaceBarrier<IPMDouble>::Vector’ changes meaning of ‘Vector’ [-fpermissive]
19 | typedef Vector<IPMDouble> Vector;
| ^~~~~~
In file included from /home/neel/volesti/test/../include/sos/barriers/LHSCB.h:12,
from /home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:10:
../include/sos/utils.h:75:7: note: ‘Vector’ declared here as ‘using Vector = class Eigen::Matrix<Type, -1, 1>’
75 | using Vector = Eigen::Matrix<T, Eigen::Dynamic, 1>;
| ^~~~~~
/home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:20:31: error: declaration of ‘typedef Matrix<T> ZeroSpaceBarrier<IPMDouble>::Matrix’ changes meaning of ‘Matrix’ [-fpermissive]
20 | typedef Matrix<IPMDouble> Matrix;
| ^~~~~~
In file included from /home/neel/volesti/test/../include/sos/barriers/LHSCB.h:12,
from /home/neel/volesti/test/../include/sos/barriers/ZeroSpaceBarrier.h:10:
../include/sos/utils.h:72:7: note: ‘Matrix’ declared here as ‘using Matrix = class Eigen::Matrix<Type, -1, -1>’
72 | using Matrix = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;
| ^~~~~~
make[3]: *** [CMakeFiles/ZeroSpaceBarrier.h.chk.dir/build.make:57: CMakeFiles/ZeroSpaceBarrier.h.chk] Error 1
make[2]: *** [CMakeFiles/Makefile2:400: CMakeFiles/ZeroSpaceBarrier.h.chk.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:3061: CMakeFiles/chkdeps.dir/rule] Error 2
make: *** [Makefile:129: chkdeps] Error 2 What can be the possible solution to this error, after solving this error i will manage to compile all header files independently. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is an error due to conflicting names given to different types. You can use Similarly, for other conflicting types, like |
Beta Was this translation helpful? Give feedback.
This is an error due to conflicting names given to different types. You can use
MT
andVT
as used everywhere else in the codebase.MT for Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>
VT for Eigen::Matrix<T, Eigen::Dynamic, 1>
Similarly, for other conflicting types, like
typedef Matrix<IPMDouble> Matrix
can be removed and so on.