- May 31, 2017
-
-
Andrew Heather authored
-
- May 15, 2017
-
-
Mark OLESEN authored
Consistency updates See merge request !111
-
mattijs authored
-
mattijs authored
-
Mark OLESEN authored
- Previously matched name against the object->name() method but saved with iter.key(). Now use iter.key() more consistently. STYLE: consistent parameter names (doxygen)
-
Mark OLESEN authored
- This makes the following safe: auto iter = ptrTable.find(unknownKey); ptrTable.erase(iter); - Unmask HashPtrTable::erase(const Key& key) method
-
- May 14, 2017
-
-
Mark OLESEN authored
ENH: ensure std::distance works with hashtable iterators
-
Mark OLESEN authored
- std::initializer_list has its own size() method, so no need to use std::distance. STYLE/BUG: use separate iterator de-reference and increment in List - avoids unnecessary copying of iterators, and avoids any potentially odd behaviour with the combination with incrementing. ENH: support construct from iterator pair for DynamicList, SortableList
-
Mark OLESEN authored
- inherit from std::iterator to obtain the full STL typedefs, meaning that std::distance works and the following is now possible: labelRange range(100, 1500); scalarList list(range.begin(), range.end()); -- Note that this does not work (mismatched data-types): scalarList list = identity(12345); But this does, since the *iter promotes label to scalar: labelList ident = identity(12345); scalarList list(ident.begin(), ident.end()); It is however more than slightly wasteful to create a labelList just for initializing a scalarList. An alternative could be a a labelRange for the same purpose. labelRange ident = labelRange::identity(12345); scalarList list(ident.begin(), ident.end()); Or this scalarList list ( labelRange::null.begin(), labelRange::identity(12345).end() );
-
- May 12, 2017
-
-
Mark OLESEN authored
- provides const/non-const access to the underlying list, but the iterator access itself is const. - provide linked-list iterator 'found()' method for symmetry with hash-table iterators. Use nullptr for more clarity.
-
- May 11, 2017
-
-
Mark OLESEN authored
- lookup(): with a default value (const access) For example, Map<label> something; value = something.lookup(key, -1); being equivalent to the following: Map<label> something; value = -1; // bad value if (something.found(key)) { value = something[key]; } except that lookup also makes it convenient to handle const references. Eg, const labelList& ids = someHash.lookup(key, labelList()); - For consistency, provide a two parameter HashTable '()' operator. The lookup() method is, however, normally preferable when const-only access is to be ensured. - retain(): the counterpart to erase(), it only retains entries corresponding to the listed keys. For example, HashTable<someType> largeCache; wordHashSet preserve = ...; largeCache.retain(preserve); being roughly equivalent to the following two-stage process, but with reduced overhead and typing, and fewer potential mistakes. HashTable<someType> largeCache; wordHashSet preserve = ...; { wordHashSet cull(largeCache.toc()); // all keys cull.erase(preserve); // except those to preserve largeCache.erase(cull); // } The HashSet &= operator and retain() are functionally equivalent, but retain() also works with dissimilar value types.
-
- May 10, 2017
-
-
Mark OLESEN authored
- less clutter and typing to use the default template parameter when the key is 'word' anyhow. - use EdgeMap instead of the longhand HashTable version where appropriate
-
Mark OLESEN authored
-
- May 08, 2017
-
-
mattijs authored
-
mattijs authored
-
Mark OLESEN authored
Feature consistency face access See merge request !109
-
mattijs authored
-
mattijs authored
-
Mark OLESEN authored
- can avoid allocating/reallocating SubList STYLE: don't need NamedEnum for ensightCells, ensightFaces lookup
-
- May 07, 2017
-
-
Mark OLESEN authored
-
Mark OLESEN authored
- ensure that each have found() and which() methods - add faceTraits for handling compile-time differences between 'normal' and tri-faces - provide line::unitVec method (complimentary to edge::unitVec)
-
- May 05, 2017
-
-
Mark OLESEN authored
-
Mark OLESEN authored
-
Mark OLESEN authored
-
- May 04, 2017
-
-
mattijs authored
-
mattijs authored
-
Andrew Heather authored
improved container classes See merge request !108
-
Mark OLESEN authored
- remove this unused method
-
Andrew Heather authored
BUG: wall/patch distance and inverseDistanceDiffusivity - updated dimensions and use meshWave as a default method for backwards compatibility. Fixes #462
-
Mark OLESEN authored
- avoids unneeded promotion of types. Easier to switch regex engines in the future.
-
Mark OLESEN authored
- provide key_iterator/const_key_iterator for all hashes, reuse directly for HashSet as iterator/const_iterator, respectively. - additional keys() method for HashTable that returns a wrapped to a pair of begin/end const_iterators with additional size/empty information that allows these to be used directly by anything else expecting things with begin/end/size. Unfortunately does not yet work with std::distance(). Example, for (auto& k : labelHashTable.keys()) { ... }
-
Mark OLESEN authored
-
Mark OLESEN authored
-
Mark OLESEN authored
-
Mark OLESEN authored
- add increment/decrement, repositioning. Simplify const_iterator. - this makes is much easier to use labelRange for constructing ranges of sub-lists. For symmetry with setSize() it has a setStart() instead of simply assigning to start() directly. This would also provide the future possibility to imbue the labelRange with a particular policy (eg, no negative starts, max size etc) and ensure that they are enforced. A simple use case: // initialize each to zero... List<labelRange> subListRanges = ...; // scan and categorize if (condition) subListRanges[categoryI]++; // increment size for that category // finally, set the starting points start = 0; for (labelRange& range : subListRanges) { range.setStart(start); start += range.size(); }
-
- May 02, 2017
-
-
Andrew Heather authored
Dict lookup See merge request !105
-
Andrew Heather authored
Use updated edge and labelPair containers See merge request !106
-
Mark OLESEN authored
-
Mark OLESEN authored
-
- May 01, 2017
-
-
Mark OLESEN authored
- much more useful than returning nil. Can now use with a for range: for (auto i : myLabelHashSet) { ... }
-