template <std::size_t dim, typename node_value_type = std::size_t>
struct slot

slot stucture, used to store Nodes with a hash code in an interval.

slot structures, store a set of Nodes.

Inherits from std::vector< Node< dim, node_value_type > >

Public Functions

auto find(node_type const &node)

find a Node.

we do not check if x is hashed.

void put(node_type x)

put a Node at the end.

  • x: a hashed node (not checked).

template <typename container>
void put(container const &x)

put a vector of Node’s at the end.

  • x: vector of hashed nodes (not checked).

int lastPos() const

position of the last entered Node in v[]

void compress(node_type N = node_type::voidbit)

compress: ie, supress void Nodes with a given value

  • N: supress nodes for which N&node !=0

void compressany()

compress all marked Nodes.

ie, supress Nodes with any value in the FreeBitsPart or marked as void

void compress(node_type N, node_type M)

compress: ie, supress void Nodes with given values

a Node K are supressed iff K&N==N or K&M==M
  • N: test value
  • M: test value

void setMark(node_type N)

mark the slot with some value.

  • N: associated value.

unsigned char getMark()

get the mark tag.

void unsetMark(node_type N)

suppress a given mark

throw an exception if not marked “mark”.
  • N: the mark

bool markedOther(node_type mark)

test if the slot has been marked by an other mark as “mark”

  • mark: for the test.

bool hasvoidNodes() const

does this slot contains void Nodes ?

void sethasvoidNodes()

mark the slot as containing void Nodes.

void And(node_type N)

make a logical “and” of all Nodes with a given value.

  • N: the value.

void setTag(node_type N)

Tag, ie add some value to all Nodes.

a “and” with the value must be zero. Not tested if DEBUG is not set. We do not want to set a value to Nodes, but to tag them.
  • N: the value.

void empty()

empty the slot. Do not change s1 and s2, do not deallocate space.

auto cut(std::size_t const nc)

cut the slot in nc slots.

sizes of the resulting slots are not garanted to be equal.
  • nc: number of slots
  • s: result. Array of nc slot*.

auto cutBefore(std::size_t pos, node_type s2new)

cut this slot in 2 slots, at position pos, and then shrink it.

the returned slot is the first part containing v[0,pos[

we do not check that pos is correct, except if DEBUG is set.
for s2new: position part only; tested only if DEBUG set.
  • pos:
  • s2new: value for s2 of the new slot, and s1 of this slot.

void fusion(const slot &sl)

fusion this slot with slot sl

  • sl: slot.

void sort()

sort by hash function.

bool cutdown(std::size_t lim = 2)

reallocate to reduce size;

return True iff slot is reduced.
  • lim: we reduce size if allocsize/size>= lim

void forgetFreeBits()

suppress all bits used to mark something (except voidbit).

void uniq()

suppress ex-aequo.

slot must be sorted (tested only if DEBUG is set).

bool testWellFormed(bool throwexept = true) const

test if all nodes have their abscissa between s1 and s2.

  • throwexept: throw an exception if true.

bool exaequo() const

look for ex-aequo

void setStartRank(std::size_t r)

set startrank

  • r:

int Slotrank() const

return slotrank.

void setSlotrank(std::size_t r)

set the slot rank

  • r:

void dump(std::ofstream &f)

Write slot to a file, already open.

_param f the file.

void restore(std::ifstream &f)

restore a slot from a dump.

  • file: the file to restore from.