In Eigen, it appears the assertion that checks for matrix sizes for matrix multiplication is disabled by default when using a release mode of the cmake. Is there anyway to keep this assertion when using the release mode ?
I have a matrix product m1*m2 in my code where the m1.cols() != m2.rows(). Both matrix are of dynamic size. When I set(CMAKE_BUILD_TYPE Debug) Eigen will check the size of the matrices and throws an error. When I set(CMAKE_BUILD_TYPE Release) the size check gets disabled and the evaluation m1*m2 goes through, accessing out of bounds memory and the result is almost random.