View Issue Details

IDProjectCategoryView StatusLast Update
0024193CommunityOCCT:Modeling Algorithmspublic2013-12-19 13:58
ReporterMauro Mariotti Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2010 
Product Version6.6.0 
Target Version6.7.0Fixed in Version6.7.0 
Summary0024193: Useless iterations in IntStart_SearchOnBoundaries_1.gxx
DescriptionSee www.opencascade.org/org/forum/thread_25313/

Please look at the following code (release 6.6.0, file ros\inc\IntStart_SearchOnBoundaries_1.gxx around line 200, function BoundedArc()).

A function Func and its derivative is evaluated at six parameter values along a curve.
If the "continue" is executed, the parameter value (ur) is NOT incremented and the same value is evaluated again (up to six times) !

  //-------------------------------------------------------------- REJECTIONS le 15 oct 98
  Standard_Boolean Rejection=Standard_True;
  Standard_Real maxdr,maxr,minr,ur,dur;
  minr=RealLast();
  maxr=-minr;
  maxdr=-minr;
  dur=(Pfin-Pdeb)*0.2;
  for(i=1,ur=Pdeb;i<=6;i++) {
    Standard_Real F,D;
    if(Func.Values(ur,F,D)) {
      Standard_Real lminr,lmaxr;
      if(D<0.0) D=-D;
      D*=dur+dur;
      if(D>maxdr) maxdr=D;
      lminr=F-D;
      lmaxr=F+D;
      if(lminr<minr) minr=lminr;
      if(lmaxr>maxr) maxr=lmaxr;
      if(minr<0.0 && maxr>0.0) {
    Rejection=Standard_False;
    continue;
      }
    }
    ur+=dur;
  }

The intent seems just to set the Rejection variable. The others are used just locally.
I suggest to replace "continue" with "break"
Steps To ReproduceI have seen it while debugging
TagsNo tags attached.
Test case numberNot needed

Activities

ifv

2013-10-17 14:14

developer   ~0026118

CR24193 is ready for testing

Inplementation of Mariotti's proposal to avoid useless iterations

ifv

2013-10-17 14:15

developer   ~0026120

CR24193 is ready for testing

Inplementation of Mariotti's proposal to avoid useless iterations

mkv

2013-10-18 11:25

tester   ~0026132

Dear BugMaster,

Branch CR24193 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: becd6f88b55e34b3f5f7e663d806181feb4769a7

Number of compiler warnings:

occt component :
Linux: 370 (370 on master)
Windows: 6 (6 on master)

products component :
Linux: 1909 (191 on master)
Windows: 287 (287 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 353384208 / 353462608
Total CPU difference: 49098.10000000084 / 43493.85000000097

Testing on Windows:
Total MEMORY difference: 406921864 / 407092388
Total CPU difference: 28907.859375 / 30173.609375

There are not differences in images found by testdiff.

Related Changesets

occt: master 78fdb3d3

2013-10-16 07:44:18

ifv


Committer: bugmaster Details Diff
0024193: Useless iterations in IntStart_SearchOnBoundaries.gxx Affected Issues
0024193
mod - src/IntStart/IntStart_SearchOnBoundaries.gxx Diff File

Issue History

Date Modified Username Field Change
2013-09-19 14:17 Mauro Mariotti New Issue
2013-09-19 14:17 Mauro Mariotti Assigned To => ifv
2013-10-17 14:11 ifv Status new => assigned
2013-10-17 14:14 ifv Note Added: 0026118
2013-10-17 14:14 ifv Status assigned => resolved
2013-10-17 14:15 ifv Note Added: 0026120
2013-10-17 14:15 ifv Status resolved => reviewed
2013-10-17 15:12 mkv Assigned To ifv => mkv
2013-10-18 11:25 mkv Note Added: 0026132
2013-10-18 11:32 mkv Test case number => Not needed
2013-10-18 11:32 mkv Assigned To mkv => bugmaster
2013-10-18 11:32 mkv Status reviewed => tested
2013-10-22 09:53 abv Product Version => 6.6.0
2013-10-22 09:53 abv Target Version => 6.7.0
2013-10-25 14:42 bugmaster Changeset attached => occt master 78fdb3d3
2013-10-25 14:42 bugmaster Status tested => verified
2013-10-25 14:42 bugmaster Resolution open => fixed
2013-12-19 13:51 bugmaster Status verified => closed
2013-12-19 13:58 bugmaster Fixed in Version => 6.7.0