calib3d: avoid clang weird behavior#11057
Conversation
| double complex1 = 4 * p4 / 3 + t; | ||
| #if defined(__clang__) | ||
| complex<double> complex2 = 2 * q4; | ||
| complex2 = complex<double>(complex2.real() / sqrt_2m.real(), 0); |
There was a problem hiding this comment.
Can sqrt_2m have non-zero imagination? (from sqrt call of negative number)
Perhaps we need full formula for complex numbers division (and optimize it for zero complex2.imag()).
There was a problem hiding this comment.
Thank you for nice comment.
All the test case from gtest doesn't fail to 0, but AFAIK, there's no guarantee on this point.
Let me think of that point.
There was a problem hiding this comment.
As far as I understood, this function solveQuartic is calculating real roots from quartic equation.
Mathematically, there is a possibility that imaginary part becomes non-zero, (probably caused by wrong correspondence)
Should I add assertion before the sqrt or shall I keep as it is ?
ba36982 to
7ee5a72
Compare
|
@alalek , if you don't mind, can I modify the commit by my self ? |
* add ifdef to apply on specific situation
|
Sure. |
ff93008 to
7fd53f6
Compare
|
Thank you ! |
resolves #11056