ENH: further refinement to edge methods

- more hash-like methods.
  Eg, insert/erase via lists, clear(), empty(),...

- minVertex(), maxVertex() to return the smallest/largest label used

- improved documentation, more clarification about where/how negative
  point labels are treated.
This commit is contained in:
Mark Olesen
2017-04-29 12:14:46 +02:00
parent 7edd801c72
commit 1d9b311b82
4 changed files with 353 additions and 110 deletions

View File

@ -31,6 +31,7 @@ Description
#include "argList.H"
#include "edgeList.H"
#include "edgeHashes.H"
using namespace Foam;
@ -79,6 +80,28 @@ int main(int argc, char *argv[])
printInfo(e4);
}
e4.start() = e4.end() = -1;
Info<< "insert from list\n";
labelHashSet newIndices({2, -1, 2, 1, 4, 1, 2, 3});
e4.insert(newIndices.toc());
printInfo(e4);
e4.start() = e4.end() = -1;
Info<< "insert from list\n";
e4.insert({0, 5, 2, -1, 2, 1, 4, 1, 2, 3});
printInfo(e4);
FixedList<label, 8> otherIndices{12, 2, -1, 1, 4, 1, 2, 3};
e4.start() = e4.end() = -1;
Info<< "insert from list: " << otherIndices << nl;
e4.insert(otherIndices);
printInfo(e4);
e4.start() = e4.end();
Info<< "erase from list: " << otherIndices << nl;
Info<< "removed " << e4.erase(otherIndices) << " values" << nl;
printInfo(e4);
for (label i : {-1, 0, 1, 3})
{
bool ok = e4.erase(i);