ossama-othman / MaRC

MaRC - Map Reprojections and Conversions
GNU Lesser General Public License v2.1
1 stars 0 forks source link

MaRC::{Matrix,Vector}::operator==() does not properly support floating point types. #32

Open ossama-othman opened 7 years ago

ossama-othman commented 7 years ago

The MaRC::Matrix and MaRC::Vector equality operator, i.e. operator==() for both classes does not correctly support floating point types. They both default to the trivial exact check for equality between each matrix/vector element, instead of checking if the value of each floating point element is almost equal. Rather than use std::equal_to(), MaRC::almost_equal() and MaRC::almost_zero() should be use for floating point typed matrices and vectors. Overloads of the latter two for MaRC::Matrix and MaRC::Vector would be appropriate.