- 09 Aug, 2018 1 commit
-
-
Andrew Heather authored
-
- 08 Aug, 2018 2 commits
-
-
Mark OLESEN authored
STYLE: use initial hash size 128 instead of 100 in a few places
-
Mark OLESEN authored
- there were previously no hashing mechanisms for lists so they would fall back to the definition for primitives and hash the memory location of the allocated List object. - provide a UList::Hash<> sub-class for inheritance, and also a global specialization for UList<T>, List<T> such that the hash value for List<List<T>> cascades properly. - provide similar function in triFace to ensure that it remains similar in behaviour to face. - added SymmHash to Pair, for use when order is unimportant. STYLE: use string::hash() more consistently - no particular reason to use Hash<word>() which forwards to string::hash() anyhow
-
- 07 Aug, 2018 1 commit
-
-
Mark OLESEN authored
- extract a list of the HashTable values, optionally sorted.
-
- 06 Aug, 2018 1 commit
-
-
Mark OLESEN authored
- when both min and max are required, this is more efficient than traversing the list twice.
-
- 02 Aug, 2018 1 commit
-
-
Mark OLESEN authored
- a second template parameter for the comparison value type instead of ListType::const_reference allows more generic comparison predicates.
-
- 01 Aug, 2018 5 commits
-
-
Mark OLESEN authored
- treat as a List constant without requiring inclusion of ListOps.H - replace use of emptyList<label>() with emptyLabelList directly. The emptyList<T>() casting is disallowed with many modern compilers and now marked as deprecated (expect early removal). - relocate labelList typedef to List.H for more general access. Similar reasoning to having labelUList defined in UList.H
-
Mark OLESEN authored
Eg, processorPolyPatch pp = ...; UOPstream toNbr(pp.neighbProcNo(), pBufs); toNbr << PackedList<Width>(faceValues, pp.range());
-
Mark OLESEN authored
- allows direct 'hashing' of fixed lists. Eg, triFace
-
Mark OLESEN authored
- allows for simpler unpacking of a full list, or list range into any sufficiently large integral type. For example, processorPolyPatch pp = ...; UOPstream toNbr(pp.neighbProcNo(), pBufs); toNbr << faceValues.unpack<char>(pp.range());
-
Mark OLESEN authored
- add range support in globalIndex and SubField, SubDimensionedField
-
- 27 Jul, 2018 2 commits
-
-
Mark OLESEN authored
- test(), get(), set(), unset() with behaviour as per bitSet, to allow easier swapping out of boolList <-> bitSet.
-
Mark OLESEN authored
- already had remove() by iterator, but not by key. As per erase() which already worked by iterator or by key.
-
- 25 Jul, 2018 2 commits
-
-
Mark OLESEN authored
- BitSetOps::create(len, locations, on) that generates a bitSet with the specified length. The optional 'on' bool can be used to flip the logic.
-
Mark OLESEN authored
- gets the pointer within the list.
-
- 24 Jul, 2018 1 commit
-
-
Mark OLESEN authored
- this eliminates a degree of ambiguity when resolving a read() method in inherited classes.
-
- 01 Jun, 2018 1 commit
-
-
Mark OLESEN authored
- Always used for optional dictionary entries, since these are individual values, and not meant to be embedded in a larger stream of tokens. Methods: - lookupOrDefault, lookupOrAddDefault, lookupOrDefaultCompat - readIfPresent, readIfPresentCompat - Handling mandatory dictionary entries is slightly more complex, since these may be part of larger stream of tokens, and are often used in a constructor context. For example, word modelType(dict.lookup("type")); Or they are used without a definite context. For example, dict.lookup("format") >> outputFormat; Newly introduced methods for mandatory dictionary entries: - get, getCompat - read, readCompat In a constructor or assignment context: word modelType(dict.get<word>("type")); outputFormat = dict.lookup("format"); without copy/move (similar to readIfPresent): dict.read("format", outputFormat);
-
- 30 May, 2018 2 commits
-
-
Mark OLESEN authored
- resolve in favour of "inline explicit", which had marginally more uses and provides consistent prefixing for inline methods.
-
Mark OLESEN authored
- make the purpose more explicit, and reduces some work for the compiler as well.
-
- 29 May, 2018 2 commits
-
-
Mark OLESEN authored
- improves backward compatibility and more naming consistency. Retain setMany(iter1, iter2) to avoid ambiguity with the PackedList::set(index, value) method.
-
Mark OLESEN authored
- required for std::iterator_traits specialization, which is used by the std::max_element algorithm on Darwin.
-
- 23 Jan, 2018 1 commit
-
-
Mark OLESEN authored
- problems when the cloud was not available on all processors. - NB: ensight measured data only allows a single cloud, but foamToEnsight writes all clouds.
-
- 21 May, 2018 1 commit
-
-
mattijs authored
-
- 17 May, 2018 1 commit
-
-
Mark OLESEN authored
- disallow insert() of raw pointers, since a failed insertion (ie, entry already existed) results in an unmanaged pointer. Either insert using an autoPtr, or set() with raw pointers or autoPtr. - IOobjectList::add() now takes an autoPtr instead of an object reference - IOobjectList::remove() now returns an autoPtr instead of a raw pointer
-
- 08 May, 2018 1 commit
-
-
Andrew Heather authored
-
- 07 May, 2018 1 commit
-
-
Mark OLESEN authored
- catch (value) - forward declarations for operator<<() - non-const access to Reaction name() - spurious return statement
-
- 02 May, 2018 1 commit
-
-
Mark OLESEN authored
- find the position of the first bit off - symmetrical with find_first()
-
- 27 Apr, 2018 1 commit
-
-
Mark OLESEN authored
For example, with some HashTable or Map container of models { model0 => 1, model1 => 4, model2 => 5, model3 => 12, model4 => 15, } specify the remapping Map<label> mapper({{1, 3}, {2, 6}, {3, 12}, {5, 8}}); inplaceMapValue(mapper, models) then yields { model0 => 3, model1 => 4, model2 => 8, model3 => 12, model4 => 15, } -- ENH: extend bitSet::count() to optionally count unset bits instead. -- ENH: BitOps compatibility methods for boolList. - These ease coding that uses a boolList instead of bitSet and use short-circuit logic when possible. Eg, when 'bitset' and 'bools' contain the same information bitset.count() <-> BitOps::count(bools) bitset.all() <-> BitOps::all(bools) bitset.any() <-> BitOps::any(bools) bitset.none() <-> BitOps::none(bools) These methods can then be used directly in parameters or in logic. Eg, returnReduce(bitset.any(), orOp<bool>()); returnReduce(BitOps::any(bools), orOp<bool>()); if (BitOps::any(bools)) ...
-
- 26 Apr, 2018 2 commits
-
-
Mark OLESEN authored
-
Mark OLESEN authored
- bitSet::used() method for compatibility with code using the PackedBoolList typedef, but marked as deprecated.
-
- 23 Apr, 2018 1 commit
-
-
mattijs authored
-
- 28 Mar, 2018 1 commit
-
-
Andrew Heather authored
-
- 11 Apr, 2018 1 commit
-
-
Mark OLESEN authored
- make purpose as functors _slightly_ clearer. - base definition removed for stricter enforcement of the specialization requirement.
-
- 22 Mar, 2018 1 commit
-
-
Mark OLESEN authored
- improve internal handling to permit deriving resizable containers (eg, PtrDynList). - include '->' iterator dereferencing - Only append/set non-const autoPtr references. This doesn't break existing code, but makes the intention more transparent.
-
- 19 Mar, 2018 1 commit
-
-
Mark OLESEN authored
- can assist the compiler in producing tighter code.
-
- 15 Mar, 2018 1 commit
-
-
Mark OLESEN authored
- also ensure fewer side-effects from inplaceReorder - provide ListOps::reorder especially for PackedList and PackedBoolList since they behave differently from regular lists.
-
- 14 Mar, 2018 1 commit
-
-
Mark OLESEN authored
- this also provides a better separation of the intent (ie, inserting a single value, or inserting multiply values)
-
- 13 Mar, 2018 1 commit
-
-
Mark OLESEN authored
- eliminate iterators from PackedList since they were unused, had lower performance than direct access and added unneeded complexity. - eliminate auto-vivify for the PackedList '[] operator. The set() method provides any required auto-vivification and removing this ability from the '[]' operator allows for a lower when accessing the values. Replaced the previous cascade of iterators with simpler reference class. PackedBoolList: - (temporarily) eliminate logic and addition operators since these contained partially unclear semantics. - the new test() method tests the value of a single bit position and returns a bool without any ambiguity caused by the return type (like the get() method), nor the const/non-const access (like operator[] has). The name corresponds to what std::bitset uses. - more consistent use of PackedBoolList test(), set(), unset() methods for fewer operation and clearer code. Eg, if (list.test(index)) ... | if (list[index]) ... if (!list.test(index)) ... | if (list[index] == 0u) ... list.set(index); | list[index] = 1u; list.unset(index); | list[index] = 0u; - deleted the operator=(const labelUList&) and replaced with a setMany() method for more clarity about the intended operation and to avoid any potential inadvertent behaviour.
-
- 07 Mar, 2018 2 commits
-
-
Mark OLESEN authored
- consistency with other containers. Allows range-for, enables various std algorithms, and can be used with ListOp::create() with an iterator range.
-
Mark OLESEN authored
- The bitSet class replaces the old PackedBoolList class. The redesign provides better block-wise access and reduced method calls. This helps both in cases where the bitSet may be relatively sparse, and in cases where advantage of contiguous operations can be made. This makes it easier to work with a bitSet as top-level object. In addition to the previously available count() method to determine if a bitSet is being used, now have simpler queries: - all() - true if all bits in the addressable range are empty - any() - true if any bits are set at all. - none() - true if no bits are set. These are faster than count() and allow early termination. The new test() method tests the value of a single bit position and returns a bool without any ambiguity caused by the return type (like the get() method), nor the const/non-const access (like operator[] has). The name corresponds to what std::bitset uses. The new find_first(), find_last(), find_next() methods provide a faster means of searching for bits that are set. This can be especially useful when using a bitSet to control an conditional: OLD (with macro): forAll(selected, celli) { if (selected[celli]) { sumVol += mesh_.cellVolumes()[celli]; } } NEW (with const_iterator): for (const label celli : selected) { sumVol += mesh_.cellVolumes()[celli]; } or manually for ( label celli = selected.find_first(); celli != -1; celli = selected.find_next() ) { sumVol += mesh_.cellVolumes()[celli]; } - When marking up contiguous parts of a bitset, an interval can be represented more efficiently as a labelRange of start/size. For example, OLD: if (isA<processorPolyPatch>(pp)) { forAll(pp, i) { ignoreFaces.set(i); } } NEW: if (isA<processorPolyPatch>(pp)) { ignoreFaces.set(pp.range()); }
-