A list that is sorted upon construction or when explicitly requested with the sort() method. More...
Public Member Functions | |
SortableList () | |
Null constructor, sort later (eg, after assignment or transfer) More... | |
SortableList (const UList< T > &) | |
Construct from UList, sorting immediately. More... | |
SortableList (const Xfer< List< T > > &) | |
Construct from transferred List, sorting immediately. More... | |
SortableList (const label size) | |
Construct given size. Sort later on. More... | |
SortableList (const label size, const T &) | |
Construct given size and initial value. Sort later on. More... | |
SortableList (const SortableList< T > &) | |
Construct as copy. More... | |
const labelList & | indices () const |
Return the list of sorted indices. Updated every sort. More... | |
labelList & | indices () |
Return non-const access to the sorted indices. Updated every sort. More... | |
void | clear () |
Clear the list and the indices. More... | |
List< T > & | shrink () |
Clear the indices and return a reference to the underlying List. More... | |
void | sort () |
(stable) sort the list (if changed after construction time) More... | |
void | reverseSort () |
Reverse (stable) sort the list. More... | |
Xfer< List< T > > | xfer () |
Transfer contents to the Xfer container as a plain List. More... | |
void | operator= (const T &) |
Assignment of all entries to the given value. More... | |
void | operator= (const UList< T > &) |
Assignment from UList operator. Takes linear time. More... | |
void | operator= (const SortableList< T > &) |
Assignment operator. Takes linear time. More... | |
Private Attributes | |
labelList | indices_ |
Original indices. More... | |
A list that is sorted upon construction or when explicitly requested with the sort() method.
Uses the Foam::stableSort() algorithm.
SortableList | ( | ) |
Null constructor, sort later (eg, after assignment or transfer)
Definition at line 31 of file SortableList.C.
|
explicit |
Construct from UList, sorting immediately.
|
explicit |
Construct from transferred List, sorting immediately.
|
explicit |
Construct given size. Sort later on.
The indices remain empty until the list is sorted
Definition at line 54 of file SortableList.C.
SortableList | ( | const label | size, |
const T & | |||
) |
Construct given size and initial value. Sort later on.
The indices remain empty until the list is sorted
SortableList | ( | const SortableList< T > & | ) |
Construct as copy.
|
inline |
Return the list of sorted indices. Updated every sort.
Definition at line 90 of file SortableList.H.
References SortableList::indices_.
Referenced by primitiveMesh::calcEdges(), displacementInterpolationMotionSolver::calcInterpolation(), triSurface::calcPatches(), triSurface::calcSortedEdgeFaces(), primitiveMesh::checkPointNearness(), primitiveMesh::checkUpperTriangular(), sampledSets::combineSampledSets(), commSchedule::commSchedule(), geomCellLooper::cut(), immersedBoundaryFvPatch::findCellCells(), searchableBox::findNearestOnEdge(), polyDualMesh::getFaceOrder(), polyMeshAdder::getFaceOrder(), getRegionFaceOrder(), triangleFuncs::intersect(), main(), Foam::matchPoints(), KinematicCloud< CloudType >::penetration(), boundaryMesh::readTriSurface(), extendedUpwindCellToFaceStencil::selectOppositeFaces(), faceCollapser::setRefinement(), ParSortableList< Type >::sort(), hierarchGeomDecomp::sortComponent(), and PatchTools::sortedEdgeFaces().
|
inline |
Return non-const access to the sorted indices. Updated every sort.
Definition at line 96 of file SortableList.H.
References SortableList::indices_.
void clear | ( | ) |
Clear the list and the indices.
Definition at line 79 of file SortableList.C.
References List::clear().
Foam::List< T > & shrink | ( | ) |
Clear the indices and return a reference to the underlying List.
Definition at line 87 of file SortableList.C.
References List::clear().
Referenced by List< substance >::transfer().
void sort | ( | ) |
(stable) sort the list (if changed after construction time)
also resizes the indices as required
Definition at line 95 of file SortableList.C.
References forAll, Foam::sortedOrder(), and List::transfer().
Referenced by primitiveMesh::calcEdges(), displacementInterpolationMotionSolver::calcInterpolation(), triSurface::calcPatches(), triSurface::calcSortedEdgeFaces(), primitiveMesh::checkUpperTriangular(), geomCellLooper::cut(), searchableBox::findNearestOnEdge(), polyDualMesh::getFaceOrder(), polyMeshAdder::getFaceOrder(), getRegionFaceOrder(), triangleFuncs::intersect(), KinematicCloud< CloudType >::penetration(), boundaryMesh::readTriSurface(), extendedUpwindCellToFaceStencil::selectOppositeFaces(), faceCollapser::setRefinement(), hierarchGeomDecomp::sortComponent(), and PatchTools::sortedEdgeFaces().
void reverseSort | ( | ) |
Reverse (stable) sort the list.
Definition at line 110 of file SortableList.C.
References forAll, Foam::sortedOrder(), and List::transfer().
Referenced by main().
|
inline |
Transfer contents to the Xfer container as a plain List.
Definition at line 125 of file SortableList.C.
|
inline |
Assignment of all entries to the given value.
|
inline |
Assignment operator. Takes linear time.
|
private |
Original indices.
Definition at line 59 of file SortableList.H.
Referenced by SortableList::indices().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.