silicium 0.0.2 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +3 -3
- data/.gitignore +13 -13
- data/.rakeTasks +8 -0
- data/.travis.yml +28 -25
- data/CODE_OF_CONDUCT.md +74 -74
- data/Gemfile +8 -8
- data/LICENSE.txt +21 -21
- data/Makefile +269 -269
- data/README.md +588 -46
- data/Rakefile +16 -16
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/docs/Object.html +117 -117
- data/docs/README_md.html +142 -142
- data/docs/Silicium/Combinatorics.html +270 -270
- data/docs/Silicium/Dice/Polyhedron.html +315 -315
- data/docs/Silicium/Dice/PolyhedronSet.html +321 -321
- data/docs/Silicium/Dice.html +99 -99
- data/docs/Silicium/Error.html +106 -106
- data/docs/Silicium/Geometry/Line2dCanon.html +243 -243
- data/docs/Silicium/Geometry/VariablesOrderException.html +106 -106
- data/docs/Silicium/Geometry.html +940 -940
- data/docs/Silicium/GraphVisualizer.html +226 -0
- data/docs/Silicium/Graphs/GraphError.html +106 -106
- data/docs/Silicium/Graphs/OrientedGraph.html +901 -775
- data/docs/Silicium/Graphs/UnorientedGraph.html +237 -284
- data/docs/Silicium/Graphs.html +374 -164
- data/docs/Silicium/IntegralDoesntExistError.html +106 -106
- data/docs/Silicium/NumericalIntegration.html +521 -521
- data/docs/Silicium/Optimization.html +629 -639
- data/docs/Silicium/Plotter/Image.html +297 -297
- data/docs/Silicium/Plotter.html +186 -186
- data/docs/Silicium.html +101 -101
- data/docs/created.rid +9 -9
- data/docs/css/fonts.css +167 -167
- data/docs/css/rdoc.css +619 -619
- data/docs/index.html +134 -132
- data/docs/js/darkfish.js +84 -84
- data/docs/js/navigation.js +105 -105
- data/docs/js/search.js +110 -110
- data/docs/js/search_index.js +1 -1
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -229
- data/docs/table_of_contents.html +697 -608
- data/lib/algebra.rb +452 -0
- data/lib/algebra_diff.rb +258 -0
- data/lib/geometry/figure.rb +62 -0
- data/lib/geometry.rb +290 -236
- data/lib/geometry3d.rb +270 -0
- data/lib/graph/dfs.rb +42 -0
- data/lib/graph/kruskal.rb +36 -0
- data/lib/graph/scc.rb +97 -0
- data/lib/graph.rb +350 -164
- data/lib/graph_visualizer.rb +287 -0
- data/lib/ml_algorithms.rb +181 -0
- data/lib/numerical_integration.rb +184 -147
- data/lib/optimization.rb +209 -144
- data/lib/plotter.rb +256 -96
- data/lib/polynomial_division.rb +132 -0
- data/lib/polynomial_interpolation.rb +94 -0
- data/lib/regression.rb +120 -0
- data/lib/silicium/adding.rb +37 -0
- data/lib/silicium/conversions.rb +23 -0
- data/lib/silicium/multi.rb +82 -0
- data/lib/silicium/sparse.rb +76 -0
- data/lib/silicium/sugar.rb +37 -0
- data/lib/silicium/trans.rb +26 -0
- data/lib/silicium/version.rb +3 -3
- data/lib/silicium.rb +5 -5
- data/lib/theory_of_probability.rb +240 -226
- data/lib/topological_sort.rb +50 -0
- data/oriented_graph.png +0 -0
- data/plot.png +0 -0
- data/silicium.gemspec +38 -39
- metadata +38 -16
@@ -1,284 +1,237 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class Silicium::Graphs::UnorientedGraph - RDoc Documentation</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "../../";
|
11
|
-
var index_rel_prefix = "../../";
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script src="../../js/navigation.js" defer></script>
|
15
|
-
<script src="../../js/search.js" defer></script>
|
16
|
-
<script src="../../js/search_index.js" defer></script>
|
17
|
-
<script src="../../js/searcher.js" defer></script>
|
18
|
-
<script src="../../js/darkfish.js" defer></script>
|
19
|
-
|
20
|
-
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
-
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<body id="top" role="document" class="class">
|
27
|
-
<nav role="navigation">
|
28
|
-
<div id="project-navigation">
|
29
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
|
-
<h2>
|
31
|
-
<a href="../../index.html" rel="home">Home</a>
|
32
|
-
</h2>
|
33
|
-
|
34
|
-
<div id="table-of-contents-navigation">
|
35
|
-
<a href="../../table_of_contents.html#pages">Pages</a>
|
36
|
-
<a href="../../table_of_contents.html#classes">Classes</a>
|
37
|
-
<a href="../../table_of_contents.html#methods">Methods</a>
|
38
|
-
</div>
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
42
|
-
<form action="#" method="get" accept-charset="utf-8">
|
43
|
-
<div id="search-field-wrapper">
|
44
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
45
|
-
aria-autocomplete="list" aria-controls="search-results"
|
46
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
47
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
48
|
-
</div>
|
49
|
-
|
50
|
-
<ul id="search-results" aria-label="Search Results"
|
51
|
-
aria-busy="false" aria-expanded="false"
|
52
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
53
|
-
</form>
|
54
|
-
</div>
|
55
|
-
|
56
|
-
</div>
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
<div id="class-metadata">
|
61
|
-
|
62
|
-
<div id="parent-class-section" class="nav-section">
|
63
|
-
<h3>Parent</h3>
|
64
|
-
|
65
|
-
|
66
|
-
<p class="link"><a href="OrientedGraph.html">Silicium::Graphs::OrientedGraph</a>
|
67
|
-
|
68
|
-
</div>
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
<!-- Method Quickref -->
|
73
|
-
<div id="method-list-section" class="nav-section">
|
74
|
-
<h3>Methods</h3>
|
75
|
-
|
76
|
-
<ul class="link-list" role="directory">
|
77
|
-
|
78
|
-
<li
|
79
|
-
|
80
|
-
<li
|
81
|
-
|
82
|
-
<li ><a href="#method-i-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
</div>
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
<span class="method-click-advice">click to toggle source</span>
|
240
|
-
|
241
|
-
</div>
|
242
|
-
|
243
|
-
|
244
|
-
<div class="method-description">
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
<div class="method-calls-super">
|
250
|
-
Calls superclass method
|
251
|
-
<a href="OrientedGraph.html#method-i-label_edge-21"><code>Silicium::Graphs::OrientedGraph#label_edge!</code></a>
|
252
|
-
</div>
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
<div class="method-source-code" id="label_edge-21-source">
|
257
|
-
<pre><span class="ruby-comment"># File lib/graph.rb, line 140</span>
|
258
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">label_edge!</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>, <span class="ruby-identifier">label</span>)
|
259
|
-
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>, <span class="ruby-identifier">label</span>)
|
260
|
-
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">label</span>)
|
261
|
-
<span class="ruby-keyword">end</span></pre>
|
262
|
-
</div>
|
263
|
-
|
264
|
-
</div>
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
</div>
|
270
|
-
|
271
|
-
|
272
|
-
</section>
|
273
|
-
|
274
|
-
</section>
|
275
|
-
|
276
|
-
</main>
|
277
|
-
|
278
|
-
|
279
|
-
<footer id="validator-badges" role="contentinfo">
|
280
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
281
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
|
282
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
283
|
-
</footer>
|
284
|
-
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Silicium::Graphs::UnorientedGraph - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
<body id="top" role="document" class="class">
|
27
|
+
<nav role="navigation">
|
28
|
+
<div id="project-navigation">
|
29
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
|
+
<h2>
|
31
|
+
<a href="../../index.html" rel="home">Home</a>
|
32
|
+
</h2>
|
33
|
+
|
34
|
+
<div id="table-of-contents-navigation">
|
35
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
36
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
37
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
42
|
+
<form action="#" method="get" accept-charset="utf-8">
|
43
|
+
<div id="search-field-wrapper">
|
44
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
45
|
+
aria-autocomplete="list" aria-controls="search-results"
|
46
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
47
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<ul id="search-results" aria-label="Search Results"
|
51
|
+
aria-busy="false" aria-expanded="false"
|
52
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
53
|
+
</form>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
<div id="class-metadata">
|
61
|
+
|
62
|
+
<div id="parent-class-section" class="nav-section">
|
63
|
+
<h3>Parent</h3>
|
64
|
+
|
65
|
+
|
66
|
+
<p class="link"><a href="OrientedGraph.html">Silicium::Graphs::OrientedGraph</a>
|
67
|
+
|
68
|
+
</div>
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
<!-- Method Quickref -->
|
73
|
+
<div id="method-list-section" class="nav-section">
|
74
|
+
<h3>Methods</h3>
|
75
|
+
|
76
|
+
<ul class="link-list" role="directory">
|
77
|
+
|
78
|
+
<li ><a href="#method-i-add_edge-21">#add_edge!</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-delete_edge-21">#delete_edge!</a>
|
81
|
+
|
82
|
+
<li class="calls-super" ><a href="#method-i-label_edge-21">#label_edge!</a>
|
83
|
+
|
84
|
+
</ul>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
</nav>
|
89
|
+
|
90
|
+
<main role="main" aria-labelledby="class-Silicium::Graphs::UnorientedGraph">
|
91
|
+
<h1 id="class-Silicium::Graphs::UnorientedGraph" class="class">
|
92
|
+
class Silicium::Graphs::UnorientedGraph
|
93
|
+
</h1>
|
94
|
+
|
95
|
+
<section class="description">
|
96
|
+
|
97
|
+
</section>
|
98
|
+
|
99
|
+
|
100
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
111
|
+
<header>
|
112
|
+
<h3>Public Instance Methods</h3>
|
113
|
+
</header>
|
114
|
+
|
115
|
+
|
116
|
+
<div id="method-i-add_edge-21" class="method-detail ">
|
117
|
+
|
118
|
+
<div class="method-heading">
|
119
|
+
<span class="method-name">add_edge!</span><span
|
120
|
+
class="method-args">(from, to)</span>
|
121
|
+
|
122
|
+
<span class="method-click-advice">click to toggle source</span>
|
123
|
+
|
124
|
+
</div>
|
125
|
+
|
126
|
+
|
127
|
+
<div class="method-description">
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<div class="method-source-code" id="add_edge-21-source">
|
135
|
+
<pre><span class="ruby-comment"># File lib/graph.rb, line 162</span>
|
136
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_edge!</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>)
|
137
|
+
<span class="ruby-identifier">protected_add_edge!</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>)
|
138
|
+
<span class="ruby-identifier">protected_add_edge!</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">from</span>)
|
139
|
+
<span class="ruby-ivar">@edge_number</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
140
|
+
<span class="ruby-keyword">end</span></pre>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</div>
|
149
|
+
|
150
|
+
|
151
|
+
<div id="method-i-delete_edge-21" class="method-detail ">
|
152
|
+
|
153
|
+
<div class="method-heading">
|
154
|
+
<span class="method-name">delete_edge!</span><span
|
155
|
+
class="method-args">(from, to)</span>
|
156
|
+
|
157
|
+
<span class="method-click-advice">click to toggle source</span>
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
<div class="method-description">
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<div class="method-source-code" id="delete_edge-21-source">
|
170
|
+
<pre><span class="ruby-comment"># File lib/graph.rb, line 173</span>
|
171
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_edge!</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>)
|
172
|
+
<span class="ruby-identifier">protected_delete_edge!</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>)
|
173
|
+
<span class="ruby-identifier">protected_delete_edge!</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">from</span>)
|
174
|
+
<span class="ruby-ivar">@edge_number</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
175
|
+
<span class="ruby-keyword">end</span></pre>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
</div>
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
<div id="method-i-label_edge-21" class="method-detail ">
|
187
|
+
|
188
|
+
<div class="method-heading">
|
189
|
+
<span class="method-name">label_edge!</span><span
|
190
|
+
class="method-args">(from, to, label)</span>
|
191
|
+
|
192
|
+
<span class="method-click-advice">click to toggle source</span>
|
193
|
+
|
194
|
+
</div>
|
195
|
+
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<div class="method-calls-super">
|
203
|
+
Calls superclass method
|
204
|
+
<a href="OrientedGraph.html#method-i-label_edge-21"><code>Silicium::Graphs::OrientedGraph#label_edge!</code></a>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
<div class="method-source-code" id="label_edge-21-source">
|
210
|
+
<pre><span class="ruby-comment"># File lib/graph.rb, line 168</span>
|
211
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">label_edge!</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>, <span class="ruby-identifier">label</span>)
|
212
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span>, <span class="ruby-identifier">label</span>)
|
213
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">label</span>)
|
214
|
+
<span class="ruby-keyword">end</span></pre>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
</div>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
</div>
|
223
|
+
|
224
|
+
|
225
|
+
</section>
|
226
|
+
|
227
|
+
</section>
|
228
|
+
|
229
|
+
</main>
|
230
|
+
|
231
|
+
|
232
|
+
<footer id="validator-badges" role="contentinfo">
|
233
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
234
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
|
235
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
236
|
+
</footer>
|
237
|
+
|