MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0024859Open CASCADE[OCCT] OCCT:Codingpublic2014-04-18 17:142016-04-20 15:48
Reporterabv 
Assigned Toabv 
PrioritynormalSeverityfeature 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.7.1 
Target Version[OCCT] 7.0.0Fixed in Version[OCCT] 7.0.0 
Summary0024859: Replace SortTools by STL equivalents
DescriptionPackage SortTools implements several standard sort algorithms as generic classes. In context of effort to get rid of CDL (0024487), as well as for conversion of instances of TCollection classes to NCollection templates (0024750), it is desirable to convert these to normal C++ classes.

Actually we do not need to keep these algorithms in OCCT since these are provided by standard C++ library coming with all modern compilers. This replacement will be possible for NCollection classes as soon as improvement 0024831 is implemented. When TCollection classes are converted to templates, it will be easy to use STL algorithms in all cases.

Here is preliminary analysis of use of classes from SortTools:

1. StraightInsertionSort: has two instances in SortTools, used only for Reals in two places:
   - Adaptor3d_CurveOnSurface.cxx: this use is eliminated in context of 0024742
   - AppDef_Variational.cxx (on local array)

   It can be replaced by std::stable_sort()

2. ShellSort: has two instances in SortTools, used only for Reals in two places:
   - AppDef_Variational.cxx
   - BRepMesh_FastDiscretFace.cxx (on local array)


   It can be replaced by std::sort()

3. HeapSort: has two instances in SortTools (not used) and two instances in BRepMesh

   It can be replaced by either std::make_heap()/sort_heap() or by std::sort()

4. QuickSort: has several instaniations, used in ~ 10 places

   It can be replaced by std::sort()

It is desirable to check how performance is affected by switching to use of STL algorithms.
TagsNo tags attached.
Test case number
Attached Files

- Relationships
parent of 0024831closedapn Make iterators of NCollection classes STL-compatible 
related to 0024447closedbugmaster Includes of ixx and jxx files should be replaced by their content 
child of 0024487closedabv Getting rid of generic CDL classes 
child of 0024750closedabv Replace instantiations of TCollection generic classes by NCollection templates 

-  Notes
(0029230)
abv (manager)
2014-05-07 16:16

Note that NCollection package has classes Comparator and QuickSort which are also to be replaced (unless they have some unique features).
(0029579)
dbp (developer)
2014-05-28 16:04

Dear abv,

OCCT sort tools were replaced on STL algorithms (using C++ comments).
(0029639)
abv (manager)
2014-06-03 07:43

Fix completed and pushed to CR24859
(0041873)
git (administrator)
2015-06-02 22:32

Branch CR24859_4 has been created by abv.

SHA-1: 459cbeb6ae1cc3c13ec12a085adeb3b3c6aca81f


Detailed log of new commits:

Author: abv
Date: Mon Jun 2 09:55:19 2014 +0400

    0024859: Replace SortTools by STL equivalents
    
    Package SortTools and its derived classes are removed; STL sort algorithms are used instead.
    Comparator objects are mostly reimplemented as local classes.

Author: abv
Date: Mon Jun 2 09:08:25 2014 +0300

    0024750: Replace instantiations of TCollection generic classes by NCollection templates -- manual changes
    
    Forward declaration of TCollection instances as classes are replaced by inclusion of corresponding header.
    Cyclic dependencies between declaration of collection class and its item are resolved by forward declaring a class in collection header.

Author: abv
Date: Sat May 30 15:55:13 2015 +0300

    Automatic upgrade of code by command "occt_upgrade -tcollection"
(0043259)
abv (manager)
2015-07-22 07:42

Integrated to master
(0043260)
git (administrator)
2015-07-22 07:42

Branch CR24859_4 has been deleted by abv.

SHA-1: 459cbeb6ae1cc3c13ec12a085adeb3b3c6aca81f
(0043572)
git (administrator)
2015-07-27 14:18

Branch CR24859 has been deleted by kgv.

SHA-1: 374443708cb611d059dd766d34af13ba9aa48821

- Related Changesets
occt: master e35db416
Timestamp: 2015-06-30 07:47:45
Author: abv
Committer: abv
Details ] Diff ]
0024859: Replace SortTools by STL equivalents

Package SortTools and its derived classes are removed; STL sort algorithms are used instead.
Comparator objects are mostly reimplemented as local classes.
mod - adm/UDLIST Diff ] File ]
mod - src/AppDef/AppDef_Variational.cxx Diff ] File ]
mod - src/BRepMesh/BRepMesh_FastDiscret.cxx Diff ] File ]
mod - src/BRepMesh/BRepMesh_FastDiscret.hxx Diff ] File ]
mod - src/BRepMesh/BRepMesh_FastDiscretFace.cxx Diff ] File ]
mod - src/Hermit/Hermit.cxx Diff ] File ]
mod - src/IntTools/IntTools.cdl Diff ] File ]
mod - src/IntTools/IntTools.cxx Diff ] File ]
rm - src/IntTools/IntTools_Compare.cdl Diff ] File ]
rm - src/IntTools/IntTools_Compare.cxx Diff ] File ]
rm - src/IntTools/IntTools_CompareRange.cdl Diff ] File ]
rm - src/IntTools/IntTools_CompareRange.cxx Diff ] File ]
mod - src/IntTools/IntTools_EdgeFace.cxx Diff ] File ]
mod - src/math/FILES Diff ] File ]
mod - src/math/math.cdl Diff ] File ]
rm - src/math/math_CompareOfValueAndWeight.cdl Diff ] File ]
rm - src/math/math_CompareOfValueAndWeight.cxx Diff ] File ]
mod - src/math/math_ComputeGaussPointsAndWeights.cxx Diff ] File ]
mod - src/math/math_ComputeKronrodPointsAndWeights.cxx Diff ] File ]
rm - src/math/math_ValueAndWeight.cdl Diff ] File ]
rm - src/math/math_ValueAndWeight.cxx Diff ] File ]
add - src/math/math_ValueAndWeight.hxx Diff ] File ]
mod - src/Resource/Resource.cdl Diff ] File ]
mod - src/Resource/Resource_Manager.cxx Diff ] File ]
mod - src/SelectMgr/FILES Diff ] File ]
mod - src/SelectMgr/SelectMgr.cdl Diff ] File ]
rm - src/SelectMgr/SelectMgr_CompareResults.hxx Diff ] File ]
mod - src/SelectMgr/SelectMgr_ViewerSelector.cxx Diff ] File ]
rm - src/SortTools/SortTools.cdl Diff ] File ]
rm - src/SortTools/SortTools_HeapSort.cdl Diff ] File ]
rm - src/SortTools/SortTools_HeapSort.gxx Diff ] File ]
rm - src/SortTools/SortTools_QuickSort.cdl Diff ] File ]
rm - src/SortTools/SortTools_QuickSort.gxx Diff ] File ]
rm - src/SortTools/SortTools_ShellSort.cdl Diff ] File ]
rm - src/SortTools/SortTools_ShellSort.gxx Diff ] File ]
rm - src/SortTools/SortTools_StraightInsertionSort.cdl Diff ] File ]
rm - src/SortTools/SortTools_StraightInsertionSort.gxx Diff ] File ]
mod - src/TCollection/FILES Diff ] File ]
mod - src/TCollection/TCollection.cdl Diff ] File ]
rm - src/TCollection/TCollection_CMPLRS.edl Diff ] File ]
rm - src/TCollection/TCollection_Compare.cdl Diff ] File ]
rm - src/TCollection/TCollection_Compare.gxx Diff ] File ]
rm - src/TCollection/TCollection_CompareOfInteger.cdl Diff ] File ]
rm - src/TCollection/TCollection_CompareOfInteger.cxx Diff ] File ]
rm - src/TCollection/TCollection_CompareOfReal.cdl Diff ] File ]
rm - src/TCollection/TCollection_CompareOfReal.cxx Diff ] File ]
mod - src/TKernel/PACKAGES Diff ] File ]

- Issue History
Date Modified Username Field Change
2014-04-18 17:14 abv New Issue
2014-04-18 17:14 abv Assigned To => kgv
2014-04-18 17:15 abv Relationship added child of 0024487
2014-04-18 17:15 abv Relationship added child of 0024750
2014-04-18 17:16 abv Relationship added parent of 0024831
2014-04-18 17:16 abv Severity minor => feature
2014-04-18 17:16 abv Description Updated View Revisions
2014-04-18 19:00 abv Assigned To kgv => dbp
2014-04-18 19:00 abv Status new => assigned
2014-05-07 16:16 abv Note Added: 0029230
2014-05-28 16:04 dbp Note Added: 0029579
2014-05-28 16:04 dbp Assigned To dbp => abv
2014-05-28 16:04 dbp Status assigned => feedback
2014-06-03 07:39 abv Relationship added related to 0024447
2014-06-03 07:43 abv Note Added: 0029639
2014-06-03 07:43 abv Status feedback => resolved
2014-09-11 10:49 abv Target Version 6.8.0 => 7.0.0
2015-06-02 22:32 git Note Added: 0041873
2015-07-22 07:42 abv Note Added: 0043259
2015-07-22 07:42 abv Assigned To abv => bugmaster
2015-07-22 07:42 abv Status resolved => reviewed
2015-07-22 07:42 git Note Added: 0043260
2015-07-23 11:55 abv Changeset attached => occt master e35db416
2015-07-23 11:55 abv Assigned To bugmaster => abv
2015-07-23 11:55 abv Status reviewed => verified
2015-07-23 11:55 abv Resolution open => fixed
2015-07-27 14:18 git Note Added: 0043572
2016-04-20 15:44 aiv Fixed in Version => 7.0.0
2016-04-20 15:48 aiv Status verified => closed


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker