Sha256: 49539e7de8935895c3bfd866e1a21a83a6beba82cc53427ed12f4d526188f59d
Contents?: true
Size: 1.67 KB
Versions: 2
Compression:
Stored size: 1.67 KB
Contents
#ifndef NATIVE_H #define NATIVE_H #include <ruby.h> #include <errors.h> #include <expand_capacity.h> #include <priority_queue.h> struct ItemDataStruct; typedef struct ItemDataStruct* ItemData; typedef struct ItemDataStruct { ITEM previous; PRIORITY distance; bool visited; } ItemDataStruct; ////////////////////////////////////////////////////////////////////////////////////// struct NativeStruct; typedef struct NativeStruct* Native; typedef struct NativeStruct { PriorityQueue pq; ItemData *item_data; unsigned long item_data_capacity; ITEM u; // current working item ITEM completed; // Number of items completed (for progress) } NativeStruct; ////////////////////////////////////////////////////////////////////////////////////// Native make_native(); #define expand_item_data(n) expand_capacity(ItemData, n->item_data, n->item_data_capacity, 256, "Dijkstra items") void free_native(void *data); ItemData make_item_data(); void free_item_data(ItemData id); ////////////////////////////////////////////////////////////////////////////////////// void Init_native_shortest_path(); VALUE native_allocate(VALUE self); VALUE native_shortest_path(VALUE self, VALUE source, VALUE dest, VALUE progress); VALUE with_connection(VALUE v, VALUE context, int argc, VALUE extra[]); VALUE to_result(Native n, ITEM source, ITEM dest); ////////////////////////////////////////////////////////////////////////////////////// PRIORITY get_distance(Native n, ITEM u); void update_distance(Native n, ITEM u, PRIORITY distance); bool has_visited(Native n, ITEM v); void mark_visited(Native n, ITEM v); ITEM get_previous(Native n, ITEM v); void update_previous(Native n, ITEM v, ITEM u); #endif
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
dijkstra_fast-1.5.3 | ext/dijkstra_fast/native.h |
dijkstra_fast-1.5.2 | ext/dijkstra_fast/native.h |