ENH: additional Map/HashTable constructors and ListOp functions

- construct Map/HashTable from key/value lists.

- invertToMap() : like invert() but returns a Map<label>,
  which is useful for sparse numbering

- inplaceRenumber() : taking a Map<label> for the mapper

ENH: construct/reset CStringList for list of C-strings
This commit is contained in:
Mark Olesen
2024-02-21 09:34:58 +01:00
parent f7cdd3ef63
commit 4f43f0302d
37 changed files with 363 additions and 298 deletions

View File

@ -124,11 +124,11 @@ int main(int argc, char *argv[])
<< "toc: " << flatOutput(table0.toc()) << nl;
HashTable<label, label, Hash<label>> table2
({
{3, 10},
{5, 12},
{7, 16}
});
(
// From key/value pairs
labelList({3, 5, 7}),
labelList({10, 12, 16})
);
Info<< "table2: " << table2 << nl
<< "toc: " << flatOutput(table2.toc()) << nl;