data_structures_rmolinari 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -10
- data/ext/c_disjoint_union/disjoint_union.c +79 -69
- data/ext/c_disjoint_union/extconf.rb +2 -14
- data/ext/c_segment_tree_template/extconf.rb +2 -15
- data/ext/c_segment_tree_template/segment_tree_template.c +6 -5
- data/ext/cc.h +3879 -0
- data/ext/shared.c +1 -0
- data/ext/shared.h +30 -0
- metadata +4 -2
data/ext/shared.c
CHANGED
data/ext/shared.h
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
#ifndef SHARED_H
|
2
|
+
#define SHARED_H
|
3
|
+
|
4
|
+
#include <stddef.h>
|
5
|
+
|
6
|
+
#define mShared rb_define_module("Shared")
|
7
|
+
#define eSharedDataError rb_const_get(mShared, rb_intern_const("DataError"))
|
8
|
+
#define eSharedInternalLogicError rb_const_get(mShared, rb_intern_const("InternalLogicError"))
|
9
|
+
#define mDataStructuresRMolinari rb_define_module("DataStructuresRMolinari")
|
10
|
+
|
11
|
+
//#define debug(...) printf(__VA_ARGS__)
|
12
|
+
#define debug(...)
|
13
|
+
|
14
|
+
/* What we might think of as vector[index] for a CC vec(foo). It is assignable */
|
15
|
+
#define lval(vector, index) (*get(vector, index))
|
16
|
+
|
17
|
+
/*
|
18
|
+
* Binary tree arithmetic for an implicit tree in an array, 1-based.
|
19
|
+
*/
|
20
|
+
#define TREE_ROOT 1
|
21
|
+
size_t midpoint(size_t left, size_t right);
|
22
|
+
size_t left_child(size_t i);
|
23
|
+
size_t right_child(size_t i);
|
24
|
+
|
25
|
+
/*
|
26
|
+
* Check that a Ruby value is a non-negative Fixnum and convert it to a C unsigned long
|
27
|
+
*/
|
28
|
+
unsigned long checked_nonneg_fixnum(VALUE val);
|
29
|
+
|
30
|
+
#endif
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_structures_rmolinari
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rory Molinari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: must_be
|
@@ -89,7 +89,9 @@ files:
|
|
89
89
|
- ext/c_disjoint_union/extconf.rb
|
90
90
|
- ext/c_segment_tree_template/extconf.rb
|
91
91
|
- ext/c_segment_tree_template/segment_tree_template.c
|
92
|
+
- ext/cc.h
|
92
93
|
- ext/shared.c
|
94
|
+
- ext/shared.h
|
93
95
|
- lib/data_structures_rmolinari.rb
|
94
96
|
- lib/data_structures_rmolinari/algorithms.rb
|
95
97
|
- lib/data_structures_rmolinari/c_segment_tree_template_impl.rb
|