Commit 53104e6f authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

decreased the number of tests in Core_Eigen, decreased the maximum matrix size…

decreased the number of tests in Core_Eigen, decreased the maximum matrix size in Core_SVD; now those tests take less time to complete
parent 4a634696
...@@ -79,10 +79,12 @@ protected: ...@@ -79,10 +79,12 @@ protected:
bool check_full(int type); // compex test for symmetric matrix bool check_full(int type); // compex test for symmetric matrix
virtual void run (int) = 0; // main testing method virtual void run (int) = 0; // main testing method
private: protected:
float eps_val_32, eps_vec_32; float eps_val_32, eps_vec_32;
float eps_val_64, eps_vec_64; float eps_val_64, eps_vec_64;
int ntests;
bool check_pair_count(const cv::Mat& src, const cv::Mat& evalues, int low_index = -1, int high_index = -1); bool check_pair_count(const cv::Mat& src, const cv::Mat& evalues, int low_index = -1, int high_index = -1);
bool check_pair_count(const cv::Mat& src, const cv::Mat& evalues, const cv::Mat& evectors, int low_index = -1, int high_index = -1); bool check_pair_count(const cv::Mat& src, const cv::Mat& evalues, const cv::Mat& evectors, int low_index = -1, int high_index = -1);
bool check_pairs_order(const cv::Mat& eigen_values); // checking order of eigen values & vectors (it should be none up) bool check_pairs_order(const cv::Mat& eigen_values); // checking order of eigen values & vectors (it should be none up)
...@@ -140,8 +142,7 @@ Core_EigenTest_Scalar_64::~Core_EigenTest_Scalar_64() {} ...@@ -140,8 +142,7 @@ Core_EigenTest_Scalar_64::~Core_EigenTest_Scalar_64() {}
void Core_EigenTest_Scalar_32::run(int) void Core_EigenTest_Scalar_32::run(int)
{ {
const size_t MATRIX_COUNT = 500; for (int i = 0; i < ntests; ++i)
for (size_t i = 0; i < MATRIX_COUNT; ++i)
{ {
float value = cv::randu<float>(); float value = cv::randu<float>();
cv::Mat src(1, 1, CV_32FC1, Scalar::all((float)value)); cv::Mat src(1, 1, CV_32FC1, Scalar::all((float)value));
...@@ -151,8 +152,7 @@ void Core_EigenTest_Scalar_32::run(int) ...@@ -151,8 +152,7 @@ void Core_EigenTest_Scalar_32::run(int)
void Core_EigenTest_Scalar_64::run(int) void Core_EigenTest_Scalar_64::run(int)
{ {
const size_t MATRIX_COUNT = 500; for (int i = 0; i < ntests; ++i)
for (size_t i = 0; i < MATRIX_COUNT; ++i)
{ {
float value = cv::randu<float>(); float value = cv::randu<float>();
cv::Mat src(1, 1, CV_64FC1, Scalar::all((double)value)); cv::Mat src(1, 1, CV_64FC1, Scalar::all((double)value));
...@@ -163,7 +163,9 @@ void Core_EigenTest_Scalar_64::run(int) ...@@ -163,7 +163,9 @@ void Core_EigenTest_Scalar_64::run(int)
void Core_EigenTest_32::run(int) { check_full(CV_32FC1); } void Core_EigenTest_32::run(int) { check_full(CV_32FC1); }
void Core_EigenTest_64::run(int) { check_full(CV_64FC1); } void Core_EigenTest_64::run(int) { check_full(CV_64FC1); }
Core_EigenTest::Core_EigenTest() : eps_val_32(1e-3f), eps_vec_32(1e-2f), eps_val_64(1e-4f), eps_vec_64(1e-3f) {} Core_EigenTest::Core_EigenTest()
: eps_val_32(1e-3f), eps_vec_32(1e-2f),
eps_val_64(1e-4f), eps_vec_64(1e-3f), ntests(100) {}
Core_EigenTest::~Core_EigenTest() {} Core_EigenTest::~Core_EigenTest() {}
bool Core_EigenTest::check_pair_count(const cv::Mat& src, const cv::Mat& evalues, int low_index, int high_index) bool Core_EigenTest::check_pair_count(const cv::Mat& src, const cv::Mat& evalues, int low_index, int high_index)
...@@ -382,14 +384,13 @@ bool Core_EigenTest::test_values(const cv::Mat& src) ...@@ -382,14 +384,13 @@ bool Core_EigenTest::test_values(const cv::Mat& src)
bool Core_EigenTest::check_full(int type) bool Core_EigenTest::check_full(int type)
{ {
const int MATRIX_COUNT = 500;
const int MAX_DEGREE = 7; const int MAX_DEGREE = 7;
srand((unsigned int)time(0)); srand((unsigned int)time(0));
for (int i = 1; i <= MATRIX_COUNT; ++i) for (int i = 0; i < ntests; ++i)
{ {
int src_size = (int)(std::pow(2.0, (rand()%MAX_DEGREE+1)*1.0)); int src_size = (int)(std::pow(2.0, (rand()%MAX_DEGREE)+1.));
cv::Mat src(src_size, src_size, type); cv::Mat src(src_size, src_size, type);
......
...@@ -1802,6 +1802,7 @@ Core_MatrixTest( 1, 4, false, false, 1 ), ...@@ -1802,6 +1802,7 @@ Core_MatrixTest( 1, 4, false, false, 1 ),
flags(0), have_u(false), have_v(false), symmetric(false), compact(false), vector_w(false) flags(0), have_u(false), have_v(false), symmetric(false), compact(false), vector_w(false)
{ {
test_case_count = 100; test_case_count = 100;
max_log_array_size = 8;
test_array[TEMP].push_back(NULL); test_array[TEMP].push_back(NULL);
test_array[TEMP].push_back(NULL); test_array[TEMP].push_back(NULL);
test_array[TEMP].push_back(NULL); test_array[TEMP].push_back(NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment