-3

I'm executing next code in google test

TEST(LinearALgebra, SVD) {
    Eigen::Matrix3d m;

    m << -0.0793311, 0.999997, -1.17221e-07,
         1.74, 0.00249557, 0.000445095,
         9.88131e-324, 0.000191222, -0.000284459;

    Eigen::Matrix3d m_inv = m.inverse();

    //or

    auto svd = m.jacobiSvd(Eigen::ComputeFullU | Eigen::ComputeFullV);
}

It failed in BinaryFunctors.h in scalar_product_op::result_type (line 86) The same operation in simpe main application, python numpy or opencv works correct without failure.

Mike
  • 43
  • 1
  • 5
  • 2
    _It failed_ and you think that's all you should tell? –  Sep 09 '17 at 14:21
  • 1
    I don't get an error with the code you posted. Please provide a [MCVE](https://stackoverflow.com/help/mcve) – Paul H. Sep 09 '17 at 14:35
  • Sorry guys. Some explanations: the same code is running in simple console main application & in google test. In application all works well. But the same code in google test returns this error. – Mike Sep 10 '17 at 08:57
  • 1
    Your question is still lacking a full description of the error. It is even unclear whether it is a runtime error or a compilation one. – ggael Sep 11 '17 at 09:29

1 Answers1

0

So, the problem was with subnormal number 9.88131e-324. It leads to floating point exception. Changing it to zero solved problem.

Mike
  • 43
  • 1
  • 5