Skip to content

Commit

Permalink
replace old tests, because of random generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Nützi (UBUNTU) committed Nov 12, 2017
1 parent bc76d59 commit bd756c2
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 87 deletions.
2 changes: 1 addition & 1 deletion additional
Submodule additional updated 114 files
250 changes: 172 additions & 78 deletions tests/python/PlotTestResults.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/src/main_convexHullTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ void convexHullTest(std::string name, const TMatrix& v, bool dumpPoints = true)
dumpPointsMatrixBinary(getPointsDumpPath(name, ".bin"), v);
dumpPointsMatrix(getPointsDumpPath(name, ".txt"), v);
}
std::cout << "\n\nStart ConvexHull test " << name << "" << std::endl;
std::cout << "\n\nStart convexHull test " << name << "" << std::endl;
START_TIMER(start)
ConvexHull2D c(v);
c.compute();
STOP_TIMER_SEC(count, start)
std::cout << "Timings: " << count << " sec for " << v.cols() << " points" << std::endl;
std::cout << "End ConvexHull test " << name << "" << std::endl;
std::cout << "End convexHull test " << name << "" << std::endl;
if (!c.verifyHull())
{
std::cerr << "ConvexHull test " << name << " not ok!" << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion tests/src/main_diameterOOBBTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void diameterTest(std::string name,
auto oobb = ApproxMVBB::approximateMVBBDiam(v, epsilon, optLoops);
STOP_TIMER_SEC(count, start)
std::cout << "Timings: " << count << " sec for " << v.cols() << " points" << std::endl;
std::cout << "End approximateMVBBDiam test " + name << std::endl;
std::cout << "End diameterOOBB test " + name << std::endl;

oobb.expand(1e-10);
if (!checkPointsInOOBB(v, oobb))
Expand Down
2 changes: 1 addition & 1 deletion tests/src/main_diameterTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void diameterTest(std::string name, const TMatrix& v, PREC epsilon = 0.001)
auto pp = estimateDiameter<3>(v, epsilon);
STOP_TIMER_SEC(count, start)
std::cout << "Timings: " << count << " sec for " << v.cols() << " points" << std::endl;
std::cout << "End estimateDiam test " + name << std::endl;
std::cout << "End diameterTest " + name << std::endl;

Matrix3Dyn diam(3, 2);
diam.col(0) = pp.first;
Expand Down
2 changes: 1 addition & 1 deletion tests/src/main_minAreaRectangleTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void minRectTest(std::string name, const TMatrix& v)

STOP_TIMER_SEC(count, start)
std::cout << "Timings: " << count << " sec for " << v.cols() << " points" << std::endl;
std::cout << "End MinAreaRectangle Test " + name + "" << std::endl;
std::cout << "End minAreaRectangleTest " + name + "" << std::endl;
auto rect = c.getMinRectangle();

Matrix2Dyn p(2, 6);
Expand Down
6 changes: 3 additions & 3 deletions tests/src/main_mvbbTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ void mvbbTest(std::string name,
dumpPointsMatrix(getPointsDumpPath(name, ".txt"), v);
}

std::cout << "\n\nStart mVBBTest " + name + "" << std::endl;
std::cout << "\n\nStart mvbbTest " + name + "" << std::endl;
START_TIMER(start)
auto oobb = ApproxMVBB::approximateMVBB(v, eps, nPoints, gridSize, mvbbDiamOptLoops, gridSearchOptLoops);
STOP_TIMER_SEC(count, start)
std::cout << "Timings: " << count << " sec for " << v.cols() << " points" << std::endl;
std::cout << "End MVBBTest " + name << std::endl;
std::cout << "End mvbbTest " + name << std::endl;

// oobb.expandToMinExtentRelative(0.1);

Expand Down Expand Up @@ -234,7 +234,7 @@ MY_TEST(MVBBTest, Lucy)
MY_TEST(MVBBTest, PointClouds)
{
MY_TEST_RANDOM_STUFF(MVBBTest, PointClouds);
for (unsigned int k = 0; k < 1; k++)
for (unsigned int k = 0; k < 10; k++)
{
auto v = getPointsFromFile3D(getFileInPath("PointCloud_" + std::to_string(k) + ".txt"));
Matrix3Dyn t(3, v.size());
Expand Down

0 comments on commit bd756c2

Please sign in to comment.