A node.
More...
#include <node.hpp>
|
| constexpr | node (const input *p_key, const std::any *p_value, std::size_t index_in_step, std::size_t preceding_step, const std::vector< int > *p_preceding_edge_costs, std::size_t best_preceding_node, int node_cost, int path_cost) |
| | Creates a node.
|
| |
| constexpr | node (const entry_view &entry, std::size_t index_in_step, std::size_t preceding_step, const std::vector< int > *p_preceding_edge_costs, std::size_t best_preceding_node, int path_cost) |
| | Creates a node from a vocabulary entry.
|
| |
| constexpr const input * | p_key () const |
| | Returns the key.
|
| |
| constexpr const std::any & | value () const |
| | Returns the value.
|
| |
| constexpr std::size_t | index_in_step () const |
| | Returns the index in the step.
|
| |
| constexpr std::size_t | preceding_step () const |
| | Returns the preceding step.
|
| |
| constexpr const std::vector< int > & | preceding_edge_costs () const |
| | Returns the preceding edge costs.
|
| |
| constexpr std::size_t | best_preceding_node () const |
| | Returns the index of the best preceding node.
|
| |
| constexpr int | node_cost () const |
| | Returns the node cost.
|
| |
| constexpr int | path_cost () const |
| | Returns the path cost.
|
| |
| bool | is_bos () const |
| | Returns true is this node is the BOS.
|
| |
|
| static node | bos (const std::vector< int > *p_preceding_edge_costs) |
| | Returns the BOS (Beginning of Sequence).
|
| |
| static node | eos (std::size_t preceding_step, const std::vector< int > *p_preceding_edge_costs, std::size_t best_preceding_node, int path_cost) |
| | Returns an EOS (End of Sequence).
|
| |
|
| constexpr bool | operator== (const node &one, const node &another) |
| | Returns true if one node is equal to another.
|
| |
◆ node() [1/2]
| tetengo::lattice::node::node |
( |
const input * | p_key, |
|
|
const std::any * | p_value, |
|
|
std::size_t | index_in_step, |
|
|
std::size_t | preceding_step, |
|
|
const std::vector< int > * | p_preceding_edge_costs, |
|
|
std::size_t | best_preceding_node, |
|
|
int | node_cost, |
|
|
int | path_cost ) |
|
inlineconstexpr |
Creates a node.
- Parameters
-
| p_key | A pointer to a key. |
| p_value | A pointer to a value. |
| index_in_step | An index in the step. |
| preceding_step | An index of a preceding step. |
| p_preceding_edge_costs | A pointer to preceding edge costs. |
| best_preceding_node | An index of a best preceding node. |
| node_cost | A node cost. |
| path_cost | A path cost. |
◆ node() [2/2]
| tetengo::lattice::node::node |
( |
const entry_view & | entry, |
|
|
std::size_t | index_in_step, |
|
|
std::size_t | preceding_step, |
|
|
const std::vector< int > * | p_preceding_edge_costs, |
|
|
std::size_t | best_preceding_node, |
|
|
int | path_cost ) |
|
inlineconstexpr |
Creates a node from a vocabulary entry.
- Parameters
-
| entry | An entry. |
| index_in_step | An index in the step. |
| preceding_step | An index of a preceding step. |
| p_preceding_edge_costs | A pointer to preceding edge costs. |
| best_preceding_node | An index of a best preceding node. |
| path_cost | A path cost. |
- Exceptions
-
| std::invalid_argument | When p_preceding_edge_costs is nullptr. |
◆ best_preceding_node()
| std::size_t tetengo::lattice::node::best_preceding_node |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Returns the index of the best preceding node.
- Returns
- The index of the best preceding node.
◆ bos()
| static node tetengo::lattice::node::bos |
( |
const std::vector< int > * | p_preceding_edge_costs | ) |
|
|
staticnodiscard |
Returns the BOS (Beginning of Sequence).
- Parameters
-
| p_preceding_edge_costs | A pointer to preceding edge costs. |
- Returns
- The BOS.
- Exceptions
-
| std::invalid_argument | When p_preceding_edge_costs is nullptr. |
◆ eos()
| static node tetengo::lattice::node::eos |
( |
std::size_t | preceding_step, |
|
|
const std::vector< int > * | p_preceding_edge_costs, |
|
|
std::size_t | best_preceding_node, |
|
|
int | path_cost ) |
|
staticnodiscard |
Returns an EOS (End of Sequence).
- Parameters
-
| preceding_step | An index of a preceding step. |
| p_preceding_edge_costs | A pointer to preceding edge costs. |
| best_preceding_node | An index of a best preceding node. |
| path_cost | A path cost. |
- Returns
- An EOS.
- Exceptions
-
| std::invalid_argument | When p_preceding_edge_costs is nullptr. |
◆ index_in_step()
| std::size_t tetengo::lattice::node::index_in_step |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Returns the index in the step.
- Returns
- The index in the step.
◆ is_bos()
| bool tetengo::lattice::node::is_bos |
( |
| ) |
const |
|
nodiscard |
Returns true is this node is the BOS.
- Return values
-
| true | When this node is the BOS. |
| false | Otherwise. |
◆ node_cost()
| int tetengo::lattice::node::node_cost |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Returns the node cost.
- Returns
- The node cost.
◆ p_key()
| const input * tetengo::lattice::node::p_key |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Returns the key.
- Returns
- The key.
◆ path_cost()
| int tetengo::lattice::node::path_cost |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Returns the path cost.
- Returns
- The path cost.
◆ preceding_edge_costs()
| const std::vector< int > & tetengo::lattice::node::preceding_edge_costs |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Returns the preceding edge costs.
- Returns
- The preceding edge costs.
◆ preceding_step()
| std::size_t tetengo::lattice::node::preceding_step |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Returns the preceding step.
- Returns
- The preceding step.
◆ value()
| const std::any & tetengo::lattice::node::value |
( |
| ) |
const |
|
inlinenodiscardconstexpr |
Returns the value.
- Returns
- The value.
◆ operator==
| bool operator== |
( |
const node & | one, |
|
|
const node & | another ) |
|
friend |
Returns true if one node is equal to another.
- Parameters
-
| one | One node. |
| another | Another node. |
- Return values
-
| true | When one node is equal to another. |
| valse | Otherwise. |
The documentation for this class was generated from the following file:
- library/lattice/cpp/include/tetengo/lattice/node.hpp