Class SmallListSet
SmallListSet stores a set of short integer-valued variable-size lists.
The lists are encoded into a few large DVector buffers, with internal pooling,
so adding/removing lists usually does not involve any new or delete ops.
The lists are stored in two parts. The first N elements are stored in a linear
subset of a dvector. If the list spills past these N elements, the extra elements
are stored in a linked list (which is also stored in a flat array).
Each list stores its count, so list-size operations are constant time.
All the internal "pointers" are 32-bit.
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public class SmallListSet
Constructors
SmallListSet()
Declaration
SmallListSet(SmallListSet)
Declaration
public SmallListSet(SmallListSet copy)
Parameters
Properties
MemoryUsage
Declaration
public string MemoryUsage { get; }
Property Value
Size
returns largest current list_index
Declaration
Property Value
Methods
allocate_block()
Declaration
protected int allocate_block()
Returns
AllocateAt(Int32)
create a new list at list_index
Declaration
public void AllocateAt(int list_index)
Parameters
Type |
Name |
Description |
Int32 |
list_index |
|
Clear(Int32)
remove all elements from list at list_index
Declaration
public void Clear(int list_index)
Parameters
Type |
Name |
Description |
Int32 |
list_index |
|
Contains(Int32, Int32)
search for val in list at list_index
Declaration
public bool Contains(int list_index, int val)
Parameters
Returns
Count(Int32)
return size of list at list_index
Declaration
public int Count(int list_index)
Parameters
Type |
Name |
Description |
Int32 |
list_index |
|
Returns
Find(Int32, Func<Int32, Boolean>, Int32)
search for findF(list_value) == true, of list at list_index, and return list_value
Declaration
public int Find(int list_index, Func<int, bool> findF, int invalidValue = -1)
Parameters
Returns
First(Int32)
return the first item in the list at list_index (no zero-size-list checking)
Declaration
public int First(int list_index)
Parameters
Type |
Name |
Description |
Int32 |
list_index |
|
Returns
Insert(Int32, Int32)
insert val into list at list_index.
Declaration
public void Insert(int list_index, int val)
Parameters
Move(Int32, Int32)
move list at from_index to to_index
Declaration
public void Move(int from_index, int to_index)
Parameters
Type |
Name |
Description |
Int32 |
from_index |
|
Int32 |
to_index |
|
Remove(Int32, Int32)
remove val from the list at list_index. return false if val was not in list.
Declaration
public bool Remove(int list_index, int val)
Parameters
Returns
Replace(Int32, Func<Int32, Boolean>, Int32)
search for findF(list_value) == true, of list at list_index, and replace with new_value.
returns false if not found
Declaration
public bool Replace(int list_index, Func<int, bool> findF, int new_value)
Parameters
Returns
Resize(Int32)
Declaration
public void Resize(int new_size)
Parameters
Type |
Name |
Description |
Int32 |
new_size |
|
ValueItr(Int32)
iterate over the values of list at list_index
Declaration
public IEnumerable<int> ValueItr(int list_index)
Parameters
Type |
Name |
Description |
Int32 |
list_index |
|
Returns