Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
set.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2025 James Roy <
[email protected]
>
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
26
27
#ifndef ZEPHYR_INCLUDE_SYS_SET_H_
28
#define ZEPHYR_INCLUDE_SYS_SET_H_
29
30
#include <
stdint.h
>
31
35
struct
sys_set_node
{
37
struct
sys_set_node
*parent;
38
uint16_t
rank;
40
};
41
48
static
inline
void
sys_set_makeset
(
struct
sys_set_node
*node,
uint16_t
rank)
49
{
50
node->parent = node;
51
node->rank = rank;
52
}
53
60
struct
sys_set_node
*
sys_set_find
(
struct
sys_set_node
*node);
61
72
void
sys_set_union
(
struct
sys_set_node
*node1,
struct
sys_set_node
*node2);
73
75
76
#endif
/* ZEPHYR_INCLUDE_SYS_SET_H_ */
sys_set_find
struct sys_set_node * sys_set_find(struct sys_set_node *node)
Find the root of the disjoint-set.
sys_set_union
void sys_set_union(struct sys_set_node *node1, struct sys_set_node *node2)
Merge two nodes into the same disjoint-set.
sys_set_makeset
static void sys_set_makeset(struct sys_set_node *node, uint16_t rank)
Initialize a disjoint-set.
Definition
set.h:48
stdint.h
uint16_t
__UINT16_TYPE__ uint16_t
Definition
stdint.h:89
sys_set_node
Disjoint-set node structure.
Definition
set.h:35
zephyr
sys
set.h
Generated on
for Zephyr API by
1.17.0