- Oct 29, 2021
-
-
Mark OLESEN authored
- the size of a List often requires adjustment prior to an operation, but old values (if any) are not of interest and will be overwritten. In these cases can use the _nocopy versions to avoid additional memory overhead of the intermediate list and the copy/move overhead of retaining the old values (that we will subsequently discard anyhow). No equivalent for PtrList/UPtrList - this would be too fragile. - add swap DynamicField with DynamicList BUG: fixed Dynamic{Field,List} setCapacity corner case - for the case when the newly requested capacity coincides with the current addressable size, the resize of the underlying list would have been bypassed - ie, the real capacity was not actually changed. - remove (unused) PtrDynList setCapacity method as too fragile
-
- Apr 27, 2021
-
-
Mark OLESEN authored
-
Mark OLESEN authored
-
- Apr 19, 2021
-
-
- affords some code reduction. STYLE: use HashSet insert() without found() check in more places
-
- Jan 26, 2021
-
-
Mark OLESEN authored
- modification/continuation of 8d63073b and 5c1ec7ec (#595). Although this protected function is only used internally, the name `size(label)` is too easily confused with `resize(label)` and `setSize(label)`. The longer method name eliminates some ambiguity. Name consistent with PtrListDetail. - leave size(label) method (for possible compatibility), but mark as deprecated - improve sizing consistency for (Istream >> DynamicList) STYLE: more consistent use of resize vs setSize in DynamicList - more consistency between DynamicList and DynamicField. There were some inconsistencies in how construct with a size was interpreted. STYLE: more consistent declaration/use of Swap
-
- Nov 19, 2020
-
-
Mark OLESEN authored
ENH: support construction of zero-sized IndirectList - useful when addressing is to be generated in-place after construction. Eg, indirectPrimitivePatch myPatches ( IndirectList<face>(mesh.faces(), Zero), mesh.points() ); labelList& patchFaces = myPatches.addressing(); patchFaces.resize(...); // populate patchFaces STYLE: add noexcept for zero/one fields and remove old dependency files COMP: correct typedefs for geometricOneField, geometricZeroField
-
- Dec 10, 2019
-
-
Mark OLESEN authored
- not yet triggered by any code, but avoid anyhow
-
- Dec 06, 2019
-
-
Mark OLESEN authored
- ITstream append() would previously have used the append from the underlying tokenList, which leaves the tokenIndex untouched and renders the freshly appended tokens effectively invisible if interspersed with primitiveEntry::read() that itself uses tokenIndex when building the list. The new append() method makes this hidden ITstream bi-directionality easier to manage. For efficiency, we only append lists (not individual tokens) and support a 'lazy' resizing that allows the final resizing to occur later when all tokens have been appended. - The new ITstream seek() method provides a conveniently means to move to the end of the list or reposition to the middle. Using rewind() and using seek(0) are identical. ENH: added OTstream to output directly to a list of tokens --- BUG: List::newElem resized incorrectly - had a simple doubling of the List size without checking that this would indeed be sufficient for the requested index. Bug was not triggered since primitiveEntry was the only class using this call, and it added the tokens sequentially.
-
- Oct 31, 2019
-
-
OpenFOAM bot authored
-
- Nov 05, 2019
-
-
Mark OLESEN authored
- this can help if using std algorithms that return a const reference such as std::min() does.
-
- Apr 11, 2019
-
-
Mark OLESEN authored
- use an IndirectListBase class for various indirect list types. - new SortList type In some places the SortList can be used as a lightweight alternative to SortableList to have the convenience of bundling data and sort indices together, but while operating on existing data lists. In other situations, it can be useful as an alternative to sortedOrder. For example, pointField points = ...; labelList order; sortedOrder(points, order); forAll(order, i) { points[order[i]] = ...; } Can be replaced with the following (with the same memory overhead) pointField points = ...; SortList<point> sortedPoints(points); for (point& pt : sortedPoints) { pt = ...; } - new SliceList type (#1220), which can be used for stride-based addressing into existing lists
-
- Feb 06, 2019
-
-
OpenFOAM bot authored
-
- Jul 27, 2018
-
-
Mark OLESEN authored
- test(), get(), set(), unset() with behaviour as per bitSet, to allow easier swapping out of boolList <-> bitSet.
-
- Mar 05, 2018
-
-
Mark OLESEN authored
This class is largely a pre-C++11 holdover. It is now possible to simply use move construct/assignment directly. In a few rare cases (eg, polyMesh::resetPrimitives) it has been replaced by an autoPtr.
-
- Feb 26, 2018
-
-
Mark OLESEN authored
-
- Mar 01, 2018
-
-
Mark OLESEN authored
- relocated ListAppendEqOp and ListUniqueEqOp to ListOps::appendEqOp and ListOps::UniqueEqOp, respectively for better code isolation and documentation of purpose. - relocated setValues to ListOps::setValue() with many more alternative selectors possible - relocated createWithValues to ListOps::createWithValue for better code isolation. The default initialization value is itself now a default parameter, which allow for less typing. Negative indices in the locations to set are now silently ignored, which makes it possible to use an oldToNew mapping that includes negative indices. - additional ListOps::createWithValue taking a single position to set, available both in copy assign and move assign versions. Since a negative index is ignored, it is possible to combine with the output of List::find() etc. STYLE: changes for PackedList - code simplication in the PackedList iterators, including dropping the unused operator() on iterators, which is not available in plain list versions either. - improved sizing for PackedBoolList creation from a labelUList. ENH: additional List constructors, for handling single element list. - can assist in reducing constructor ambiguity, but can also helps memory optimization when creating a single element list. For example, labelListList labels(one(), identity(mesh.nFaces()));
-
- Feb 08, 2018
-
-
Mark OLESEN authored
- add copy construct from UList - remove copy construct from dissimilar types. This templated constructor was too generous in what it accepted. For the special cases where a copy constructor is required with a change in the data type, now use the createList factory method, which accepts a unary operator. Eg, auto scalars = scalarList::createList ( labels, [](const label& val){ return 1.5*val; } );
-
- Nov 05, 2017
-
-
Mark OLESEN authored
- move append() single element to List and DynamicList ENH: add stringOps::count to avoid unnecessary string conversions
-
- Oct 25, 2017
-
-
Mark OLESEN authored
- makes it accessible for containers that manage their own storage and derive directly from UList. - DynamicList::min_size() method to access the corresponding SizeMin template parameter. - ensure consistency in the reserve size for the constructor DynamicList<..> lst(N); now has identical sizing as DynamicList<..> lst(); reserve(N);
-
- Sep 20, 2017
-
-
Mark OLESEN authored
- improve functional compatibility with DynList (remove methods) * eg, remove an element from any position in a DynamicList * reduce the number of template parameters * remove/subset regions of DynamicList - propagate Swap template specializations for lists, hashtables - move construct/assignment to various containers. - add find/found methods for FixedList and UList for a more succinct (and clearer?) usage than the equivalent global findIndex() function. - simplify List_FOR_ALL loops
-
- May 14, 2017
-
-
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
-
- Aug 09, 2016
-
-
Henry Weller authored
-
- Mar 22, 2016
-
-
Henry Weller authored
-
- Jan 10, 2016
-
-
Henry Weller authored
-
- Nov 08, 2015
-
-
Henry Weller authored
Avoids the clutter and maintenance effort associated with providing the function signature string.
-
- Dec 15, 2014
-
-
Henry authored
-
- Aug 14, 2011
-
-
Henry authored
-
- Jan 19, 2011
-
- Jan 14, 2011
-
-
Andrew Heather authored
-
- Jan 07, 2011
-
-
graham authored
-
- Jan 05, 2011
-
-
Andrew Heather authored
This reverts commit b18f6cc1.
-
graham authored
-
- Jun 07, 2010
-
-
Mark Olesen authored
-
- Mar 29, 2010
-
-
Mark Olesen authored
-
- Jan 15, 2010
-
-
Andrew Heather authored
-
- Apr 27, 2009
-
-
Mark Olesen authored
- DynamicList gets append methods as per List - misc cosmetic changes
-
- Jan 20, 2009
-
-
Mark Olesen authored
- added STL-compatible resize() method. Should this be the primary entry point? - made [DS]LListBase end iterators private
-
- Jan 16, 2009
-
-
Mark Olesen authored
- uniform use of reinterpret_cast<foo*>(0) instead of reinterpret_cast<foo*>(NULL) - make all static null() members inline since they are really only a cast: "*reinterpret_cast<foo*>(0)"
-
- Jan 05, 2009
-
-
Mark Olesen authored
- The capitalization is consistent with most other template classes, but more importantly frees up xfer() for use as method name without needing special treatment to avoid ambiguities. It seems reasonable to have different names for transfer(...) and xfer() methods, since the transfer is occuring in different directions. The xfer() method can thus replace the recently introduced zero-parameter transfer() methods. Other name candidates (eg, yield, release, etc.) were deemed too abstract.
-
- Jan 02, 2009
-
-
Mark Olesen authored
- this should provide a slightly more naturally means to using transfer constructors, for example labelList list2(list1.transfer()); vs. labelList list2(xferMove(list1)); - returns a plain list where appropriate (eg, DynamicList, SortableList) for example labelList list2(dynList1.transfer()); vs. labelList list2(xferMoveTo<labelList>(dynList1));
-