A path.
More...
#include <stdbool.h>
#include <stddef.h>
#include <tetengo/lattice/node.h>
Go to the source code of this file.
A path.
Copyright (C) 2019-2023 kaoru https://www.tetengo.org/
◆ tetengo_lattice_path_cost()
int tetengo_lattice_path_cost |
( |
const tetengo_lattice_path_t * |
p_path | ) |
|
Returns the cost.
- Parameters
-
p_path | A pointer to a path. |
- Returns
- The cost. Or 0 when p_path is NULL.
◆ tetengo_lattice_path_create()
tetengo_lattice_path_t * tetengo_lattice_path_create |
( |
const tetengo_lattice_node_t * |
p_nodes, |
|
|
size_t |
node_count, |
|
|
int |
cost |
|
) |
| |
Creates a path.
- Parameters
-
p_nodes | A pointer to nodes. |
node_count | A node count. |
cost | A cost. |
- Returns
- A pointer to a path. Or NULL when p_nodes is NULL and noce_count is greater than 0.
◆ tetengo_lattice_path_createEmpty()
tetengo_lattice_path_t * tetengo_lattice_path_createEmpty |
( |
| ) |
|
Creates an empty path.
- Returns
- A pointer to a path. Or NULL when p_nodes is NULL.
◆ tetengo_lattice_path_destroy()
void tetengo_lattice_path_destroy |
( |
const tetengo_lattice_path_t * |
p_path | ) |
|
Destroys a path.
- Parameters
-
p_path | A pointer to a path. |
◆ tetengo_lattice_path_empty()
bool tetengo_lattice_path_empty |
( |
const tetengo_lattice_path_t * |
p_path | ) |
|
Returns true when this path is empty.
- Parameters
-
p_path | A pointer to a path. |
- Return values
-
true | When this path is empty. |
false | Otherwise. |
◆ tetengo_lattice_path_pNodes()
size_t tetengo_lattice_path_pNodes |
( |
const tetengo_lattice_path_t * |
p_path, |
|
|
tetengo_lattice_node_t * |
p_nodes |
|
) |
| |
Returns the nodes.
The second and the latter nodes follows the head node continuously.
- Parameters
-
p_path | A pointer to a path. |
p_nodes | The storage for the nodes. Can be NULL. |
- Returns
- The node count. Or 0 when p_path is NULL.