Wordsearch Solver
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
compact_trie::Node Class Reference

Bitset based node representing suffixes/letters. More...

#include <node.hpp>

Public Types

using PrecedingType = std::uint32_t
 

Public Member Functions

void add_char (char c)
 
void set_preceding (std::size_t preceding)
 
void set_is_end_of_word (bool is_end_of_word)
 
std::size_t bits_on_before (std::size_t i) const
 
bool test (std::size_t i) const
 O(1) test if a suffix is present. More...
 
bool any () const
 
bool is_end_of_word () const
 
PrecedingType preceding () const
 

Private Attributes

std::bitset< 26 > bits_
 
PrecedingType preceding_
 
bool is_end_of_word_
 

Friends

std::ostream & operator<< (std::ostream &os, const Node &node)
 

Detailed Description

Bitset based node representing suffixes/letters.

Member Function Documentation

◆ any()

bool compact_trie::Node::any ( ) const
Returns
True if any suffixes are present/child nodes of this one exist.

◆ bits_on_before()

std::size_t compact_trie::Node::bits_on_before ( std::size_t  i) const
Returns
Number of on bits/suffixes before the bit at index i. Used for calculating the offset into the next row for child nodes.
Parameters
[in]i

◆ preceding()

Node::PrecedingType compact_trie::Node::preceding ( ) const
Returns
The number of suffixes of words in the row prior to this Node, used for calculating the offset into the next row for child nodes.

◆ test()

bool compact_trie::Node::test ( std::size_t  i) const

O(1) test if a suffix is present.

Parameters
[in]iSuffix/letter to test, 0 == 'a', 1 == 'b'...

The documentation for this class was generated from the following files: