fixed #2108 (thanks to Vincent for the report and proposed solution)
This commit is contained in:
@@ -75,6 +75,7 @@ protected:
|
||||
bool TestVec();
|
||||
bool TestMatxMultiplication();
|
||||
bool TestSubMatAccess();
|
||||
bool TestSVD();
|
||||
bool operations1();
|
||||
|
||||
void checkDiff(const Mat& m1, const Mat& m2, const string& s)
|
||||
@@ -934,6 +935,29 @@ bool CV_OperationsTest::operations1()
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CV_OperationsTest::TestSVD()
|
||||
{
|
||||
try
|
||||
{
|
||||
Mat A = (Mat_<double>(3,4) << 1, 2, -1, 4, 2, 4, 3, 5, -1, -2, 6, 7);
|
||||
Mat x;
|
||||
SVD::solveZ(A,x);
|
||||
if( norm(A*x, CV_C) > FLT_EPSILON )
|
||||
throw test_excep();
|
||||
|
||||
SVD svd(A, SVD::FULL_UV);
|
||||
if( norm(A*svd.vt.row(3).t(), CV_C) > FLT_EPSILON )
|
||||
throw test_excep();
|
||||
}
|
||||
catch(const test_excep&)
|
||||
{
|
||||
ts->set_failed_test_info(cvtest::TS::FAIL_MISMATCH);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void CV_OperationsTest::run( int /* start_from */)
|
||||
{
|
||||
if (!TestMat())
|
||||
@@ -959,6 +983,9 @@ void CV_OperationsTest::run( int /* start_from */)
|
||||
|
||||
if (!TestSubMatAccess())
|
||||
return;
|
||||
|
||||
if (!TestSVD())
|
||||
return;
|
||||
|
||||
if (!operations1())
|
||||
return;
|
||||
|
Reference in New Issue
Block a user