This commit is contained in:
2026-09-07 18:48:16 +08:00
parent 1564716731
commit c945aa211f
138 changed files with 10337 additions and 150 deletions
+36
View File
@@ -0,0 +1,36 @@
#ifndef INCLUDED_C_DIRECTEDEDGE_H
#define INCLUDED_C_DIRECTEDEDGE_H
#ifndef INCLUDED_C_TYPES_H
#include <c_Types.h>
#endif /*INCLUDED_C_TYPES_H*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
typedef struct {
c_size_t from; /* The source vertex index */
c_size_t to; /* The destination vertex index */
double weight; /* The numerical edge weight */
} c_DirectedEdge_t;
#define C_DIRECTED_EDGE_SENTINEL ((c_size_t)(-1))
/* Inline helper methods for c_DirectedEdge_t */
C_STATIC_FORCE_INLINE
c_size_t c_DirectedEdge_From(const c_DirectedEdge_t* edge) {
return edge ? edge->from : 0;
}
C_STATIC_FORCE_INLINE
c_size_t c_DirectedEdge_To(const c_DirectedEdge_t* edge) {
return edge ? edge->to : 0;
}
C_STATIC_FORCE_INLINE
double c_DirectedEdge_Weight(const c_DirectedEdge_t* edge) {
return edge ? edge->weight : 0.0;
}
#endif /*INCLUDED_C_DIRECTEDEDGE_H*/