Need help to fix a bug [closed]

asked 2015-09-08 11:48:44 -0500

updated 2017-08-22 08:26:20 -0500

hi all,

i am trying to fix a bug on minEnclosingTriangle.

I changed min_enclosing_triangle.cpp line 730 as

bool sideCValid = (validationFlag == VALIDATION_SIDES_FLUSH) || (isPointOnLineSegment(midpointSideC, sideCStartVertex, sideCEndVertex));

to test result of this change i compare return values of both current and changed minEnclosingTriangle by bugtest_minEnclosingTriangle.cpp

can someone help me by running bugtest_minEnclosingTriangle.cpp

1) i am working with code:block and wonder results of other compiler.

2) i have a problem when running bugtest_minEnclosingTriangle.cpp. at last test points my changed code fails. but when i make this change to source of the library and rebuild it works good ( i think i must do something related configuration of my compiler )

attached pictures about results :

1 both successful

image description

2 my change is successful

image description

3 my change is failed

image description

thanks in advance

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2017-08-22 08:27:07.012509

Comments

Tested with VS 2013 - everything fine, including last group of test points (your change works without a problem in both Debug and Release modes).

LorenaGdL gravatar imageLorenaGdL ( 2015-09-08 12:23:51 -0500 )edit

@LorenaGdL thank you. there is another test in mainB could you try it please. (renaming main to mainA, mainB to main)

and about first test is there any difference to my results like

area1 : 13146.7
area2 : 13146.7
area1 : 1.79769e+308
cv::minEnclosingTriangle FAILED!!
area2 : 18883.4
area1 : 1.79769e+308
cv::minEnclosingTriangle FAILED!!
area2 : 19168.5
area1 : 1.79769e+308
cv::minEnclosingTriangle FAILED!!
area2 : 38145.9
area1 : 1.79769e+308
cv::minEnclosingTriangle FAILED!!
area2 : 13154.4
area1 : 1.79769e+308
cv::minEnclosingTriangle FAILED!!
area2 : 73896.4
area1 : 1.79769e+308
cv::minEnclosingTriangle FAILED!!
sturkmen gravatar imagesturkmen ( 2015-09-08 12:39:07 -0500 )edit

@sturkmen: first test show same results as yours (except from above said, last group of points are successfully enclosed by your function). In first test, cv function does well only in first and last groups, your function does well in all groups. Second test (sorry, I missed it before) the results show that your function does equally or better (same or less triangle area), but also show some groups of points that can't be enclosed either with cv function or your function. Let me know if you need some numbers or screenshots. Btw, I run mainB with different RNG seeds.

LorenaGdL gravatar imageLorenaGdL ( 2015-09-08 13:12:31 -0500 )edit

@LorenaGdL you did greate and explained well.thank you very much.

sturkmen gravatar imagesturkmen ( 2015-09-08 13:21:00 -0500 )edit

@LorenaGdL thanks again. now it is fixed!

sturkmen gravatar imagesturkmen ( 2017-08-22 08:25:14 -0500 )edit