mdarray 0.4.3.pre-java → 0.5.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +82 -14
- data/Rakefile +8 -2
- data/doc/BinaryOperator.html +227 -0
- data/doc/BitwiseOperators.html +135 -0
- data/doc/BooleanFunctions.html +135 -0
- data/doc/BooleanMDArray.html +193 -0
- data/doc/ByteMDArray.html +271 -0
- data/doc/Colt.html +269 -0
- data/doc/ComparisonOperators.html +135 -0
- data/doc/Const.html +490 -0
- data/doc/Csv.html +589 -0
- data/doc/DDescriptive.html +4373 -0
- data/doc/DoubleMDArray.html +555 -0
- data/doc/DoubleStatList.html +256 -0
- data/doc/FastBinaryOperator.html +743 -0
- data/doc/FastBoolean.html +512 -0
- data/doc/FastUnaryOperator.html +583 -0
- data/doc/FloatMDArray.html +237 -0
- data/doc/FunctionCreation.html +520 -0
- data/doc/FunctionMap.html +813 -0
- data/doc/GenericFunctions.html +135 -0
- data/doc/IntMDArray.html +259 -0
- data/doc/LongMDArray.html +257 -0
- data/doc/MDArray.html +9639 -0
- data/doc/MDArray/Counter.html +2767 -0
- data/doc/MDArray/IteratorFast.html +872 -0
- data/doc/MDArray/IteratorFastBoolean.html +384 -0
- data/doc/MDArray/IteratorFastByte.html +373 -0
- data/doc/MDArray/IteratorFastChar.html +384 -0
- data/doc/MDArray/IteratorFastDouble.html +384 -0
- data/doc/MDArray/IteratorFastFloat.html +384 -0
- data/doc/MDArray/IteratorFastInt.html +384 -0
- data/doc/MDArray/IteratorFastLong.html +384 -0
- data/doc/MDArray/IteratorFastShort.html +384 -0
- data/doc/MDArrayTest.html +125 -0
- data/doc/NonNumericalMDArray.html +177 -0
- data/doc/NumericFunctions.html +297 -0
- data/doc/NumericalMDArray.html +278 -0
- data/doc/Operator.html +826 -0
- data/doc/Proc.html +1097 -0
- data/doc/RubyBinaryOperator.html +526 -0
- data/doc/RubyFunctions.html +232 -0
- data/doc/RubyMath.html +135 -0
- data/doc/RubyStats.html +135 -0
- data/doc/RubyUnaryOperator.html +510 -0
- data/doc/ShortMDArray.html +267 -0
- data/doc/StatList.html +1176 -0
- data/doc/StringMDArray.html +181 -0
- data/doc/StructureMDArray.html +181 -0
- data/doc/UnaryOperator.html +227 -0
- data/doc/UserFunction.html +297 -0
- data/doc/_index.html +467 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +338 -0
- data/doc/file.README.html +173 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +173 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +2524 -0
- data/doc/top-level-namespace.html +114 -0
- data/lib/colt/colt.rb +56 -0
- data/lib/colt/colt_mdarray.rb +95 -0
- data/lib/colt/double_descriptive.rb +636 -0
- data/lib/colt/probability.rb +12 -0
- data/lib/colt/stat_list.rb +192 -0
- data/lib/env.rb +5 -1
- data/lib/mdarray.rb +5 -0
- data/lib/mdarray/access.rb +2 -2
- data/lib/mdarray/creation.rb +34 -19
- data/lib/mdarray/csv.rb +61 -0
- data/lib/mdarray/fast_operators.rb +241 -0
- data/lib/mdarray/operators.rb +18 -0
- data/lib/mdarray/ruby_operators.rb +2 -18
- data/lib/mdarray/ruby_stats.rb +1 -1
- data/lib/mdarray/views.rb +8 -8
- data/target/helper.jar +0 -0
- data/test/colt/VALE3.csv +3437 -0
- data/test/colt/VALE3.xlsx +0 -0
- data/test/colt/VALE3_short-err.csv +20 -0
- data/test/colt/VALE3_short.csv +20 -0
- data/test/colt/VALE3_short.xlsx +0 -0
- data/test/colt/test_complete.rb +25 -0
- data/test/colt/test_stat_list.rb +128 -0
- data/test/colt/test_statistics.rb +114 -0
- data/test/complete.rb +25 -0
- data/test/env.rb +54 -30
- data/test/{arithmetic_casting.rb → mdarray/arithmetic_casting.rb} +0 -0
- data/test/{test_access.rb → mdarray/test_access.rb} +0 -0
- data/test/{test_boolean.rb → mdarray/test_boolean.rb} +0 -2
- data/test/{test_comparison.rb → mdarray/test_comparison.rb} +0 -0
- data/test/{test_complete.rb → mdarray/test_complete.rb} +3 -14
- data/test/{test_counter.rb → mdarray/test_counter.rb} +0 -0
- data/test/{test_creation.rb → mdarray/test_creation.rb} +0 -0
- data/test/{test_error.rb → mdarray/test_error.rb} +8 -5
- data/test/{test_operator.rb → mdarray/test_operator.rb} +6 -2
- data/test/{test_speed.rb → mdarray/test_performance.rb} +74 -39
- data/test/{test_printing.rb → mdarray/test_printing.rb} +0 -1
- data/test/{test_shape.rb → mdarray/test_shape.rb} +0 -0
- data/test/mdarray/test_statistics.rb +80 -0
- data/test/{test_trigonometry.rb → mdarray/test_trigonometry.rb} +0 -0
- data/test/{test_views.rb → mdarray/test_views.rb} +0 -0
- data/vendor/parallelcolt-0.10.0.jar +0 -0
- data/version.rb +1 -1
- metadata +122 -39
- data/test/test_lazy.rb +0 -52
- data/test/test_statistics.rb +0 -38
|
@@ -0,0 +1,2767 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<title>
|
|
7
|
+
Class: MDArray::Counter
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.8.5.2
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '../';
|
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
25
|
+
|
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<div id="header">
|
|
32
|
+
<div id="menu">
|
|
33
|
+
|
|
34
|
+
<a href="../_index.html">Index (C)</a> »
|
|
35
|
+
<span class='title'><span class='object_link'><a href="../MDArray.html" title="MDArray (class)">MDArray</a></span></span>
|
|
36
|
+
»
|
|
37
|
+
<span class="title">Counter</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
54
|
+
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<iframe id="search_frame"></iframe>
|
|
65
|
+
|
|
66
|
+
<div id="content"><h1>Class: MDArray::Counter
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</h1>
|
|
71
|
+
|
|
72
|
+
<dl class="box">
|
|
73
|
+
|
|
74
|
+
<dt class="r1">Inherits:</dt>
|
|
75
|
+
<dd class="r1">
|
|
76
|
+
<span class="inheritName">Object</span>
|
|
77
|
+
|
|
78
|
+
<ul class="fullTree">
|
|
79
|
+
<li>Object</li>
|
|
80
|
+
|
|
81
|
+
<li class="next">MDArray::Counter</li>
|
|
82
|
+
|
|
83
|
+
</ul>
|
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
85
|
+
|
|
86
|
+
</dd>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
<dt class="r2">Includes:</dt>
|
|
94
|
+
<dd class="r2">Enumerable</dd>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<dt class="r1 last">Defined in:</dt>
|
|
101
|
+
<dd class="r1 last">lib/mdarray/counter.rb</dd>
|
|
102
|
+
|
|
103
|
+
</dl>
|
|
104
|
+
<div class="clear"></div>
|
|
105
|
+
|
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
|
107
|
+
<div class="discussion">
|
|
108
|
+
<hr style="height: 10px">
|
|
109
|
+
|
|
110
|
+
<p>Counters for Multidimensional arrays. A Counter refers to a particular
|
|
111
|
+
element of an array. This is a generalization of index as int[].</p>
|
|
112
|
+
<hr style="height: 10px">
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="tags">
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
|
125
|
+
<ul class="summary">
|
|
126
|
+
|
|
127
|
+
<li class="public ">
|
|
128
|
+
<span class="summary_signature">
|
|
129
|
+
|
|
130
|
+
<a href="#counter-instance_method" title="#counter (instance method)">- (Object) <strong>counter</strong> </a>
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
</span>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
<span class="note title readonly">readonly</span>
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
<span class="summary_desc"><div class='inline'>
|
|
150
|
+
<p>Returns the value of attribute counter.</p>
|
|
151
|
+
</div></span>
|
|
152
|
+
|
|
153
|
+
</li>
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<li class="public ">
|
|
157
|
+
<span class="summary_signature">
|
|
158
|
+
|
|
159
|
+
<a href="#finish-instance_method" title="#finish (instance method)">- (Object) <strong>finish</strong> </a>
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
</span>
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
<span class="note title readonly">readonly</span>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<span class="summary_desc"><div class='inline'>
|
|
179
|
+
<p>Returns the value of attribute finish.</p>
|
|
180
|
+
</div></span>
|
|
181
|
+
|
|
182
|
+
</li>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
<li class="public ">
|
|
186
|
+
<span class="summary_signature">
|
|
187
|
+
|
|
188
|
+
<a href="#mdarray-instance_method" title="#mdarray (instance method)">- (Object) <strong>mdarray</strong> </a>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
</span>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
<span class="note title readonly">readonly</span>
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
<span class="summary_desc"><div class='inline'>
|
|
208
|
+
<p>Returns the value of attribute mdarray.</p>
|
|
209
|
+
</div></span>
|
|
210
|
+
|
|
211
|
+
</li>
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
<li class="public ">
|
|
215
|
+
<span class="summary_signature">
|
|
216
|
+
|
|
217
|
+
<a href="#nc_index-instance_method" title="#nc_index (instance method)">- (Object) <strong>nc_index</strong> </a>
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
</span>
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
<span class="note title readonly">readonly</span>
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
<span class="summary_desc"><div class='inline'>
|
|
237
|
+
<p>Returns the value of attribute nc_index.</p>
|
|
238
|
+
</div></span>
|
|
239
|
+
|
|
240
|
+
</li>
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
<li class="public ">
|
|
244
|
+
<span class="summary_signature">
|
|
245
|
+
|
|
246
|
+
<a href="#shape-instance_method" title="#shape (instance method)">- (Object) <strong>shape</strong> </a>
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
</span>
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
<span class="note title readonly">readonly</span>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
<span class="summary_desc"><div class='inline'>
|
|
266
|
+
<p>Returns the value of attribute shape.</p>
|
|
267
|
+
</div></span>
|
|
268
|
+
|
|
269
|
+
</li>
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
<li class="public ">
|
|
273
|
+
<span class="summary_signature">
|
|
274
|
+
|
|
275
|
+
<a href="#start-instance_method" title="#start (instance method)">- (Object) <strong>start</strong> </a>
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
</span>
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
<span class="note title readonly">readonly</span>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
295
|
+
|
|
296
|
+
<p>Accessor methods for start, finish and position.</p>
|
|
297
|
+
</div></span>
|
|
298
|
+
|
|
299
|
+
</li>
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
</ul>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
<h2>
|
|
309
|
+
Instance Method Summary
|
|
310
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
311
|
+
</h2>
|
|
312
|
+
|
|
313
|
+
<ul class="summary">
|
|
314
|
+
|
|
315
|
+
<li class="public ">
|
|
316
|
+
<span class="summary_signature">
|
|
317
|
+
|
|
318
|
+
<a href="#%5B%5D-instance_method" title="#[] (instance method)">- (Object) <strong>[]</strong>(*counter) </a>
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
</span>
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
333
|
+
|
|
334
|
+
<p>Gets the element at the given counter.</p>
|
|
335
|
+
</div></span>
|
|
336
|
+
|
|
337
|
+
</li>
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
<li class="public ">
|
|
341
|
+
<span class="summary_signature">
|
|
342
|
+
|
|
343
|
+
<a href="#%5B%5D%3D-instance_method" title="#[]= (instance method)">- (Object) <strong>[]=</strong>(counter, value) </a>
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
</span>
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
358
|
+
|
|
359
|
+
<p>Sets the value of counter.</p>
|
|
360
|
+
</div></span>
|
|
361
|
+
|
|
362
|
+
</li>
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
<li class="public ">
|
|
366
|
+
<span class="summary_signature">
|
|
367
|
+
|
|
368
|
+
<a href="#compute_size-instance_method" title="#compute_size (instance method)">- (Object) <strong>compute_size</strong> </a>
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
</span>
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
383
|
+
|
|
384
|
+
<p>Compute total number of elements in the array.</p>
|
|
385
|
+
</div></span>
|
|
386
|
+
|
|
387
|
+
</li>
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
<li class="public ">
|
|
391
|
+
<span class="summary_signature">
|
|
392
|
+
|
|
393
|
+
<a href="#each-instance_method" title="#each (instance method)">- (Object) <strong>each</strong> </a>
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
</span>
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
<span class="summary_desc"><div class='inline'>
|
|
408
|
+
<p>????????????????????????????-.</p>
|
|
409
|
+
</div></span>
|
|
410
|
+
|
|
411
|
+
</li>
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
<li class="public ">
|
|
415
|
+
<span class="summary_signature">
|
|
416
|
+
|
|
417
|
+
<a href="#each_along_axes-instance_method" title="#each_along_axes (instance method)">- (Object) <strong>each_along_axes</strong>(axes) </a>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
</span>
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
432
|
+
|
|
433
|
+
<p>Walks the counter along each of the axes.</p>
|
|
434
|
+
</div></span>
|
|
435
|
+
|
|
436
|
+
</li>
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
<li class="public ">
|
|
440
|
+
<span class="summary_signature">
|
|
441
|
+
|
|
442
|
+
<a href="#get-instance_method" title="#get (instance method)">- (Object) <strong>get</strong>(counter) </a>
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
</span>
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
457
|
+
|
|
458
|
+
<p>Gets the element at the given counter.</p>
|
|
459
|
+
</div></span>
|
|
460
|
+
|
|
461
|
+
</li>
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
<li class="public ">
|
|
465
|
+
<span class="summary_signature">
|
|
466
|
+
|
|
467
|
+
<a href="#get_at_counter-instance_method" title="#get_at_counter (instance method)">- (Object) <strong>get_at_counter</strong> </a>
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
</span>
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
<span class="summary_desc"><div class='inline'>
|
|
482
|
+
<p>????????????????????????????.</p>
|
|
483
|
+
</div></span>
|
|
484
|
+
|
|
485
|
+
</li>
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
<li class="public ">
|
|
489
|
+
<span class="summary_signature">
|
|
490
|
+
|
|
491
|
+
<a href="#get_current-instance_method" title="#get_current (instance method)">- (Object) <strong>get_current</strong> </a>
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
</span>
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
506
|
+
|
|
507
|
+
<p>Gets element at current counter.</p>
|
|
508
|
+
</div></span>
|
|
509
|
+
|
|
510
|
+
</li>
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
<li class="public ">
|
|
514
|
+
<span class="summary_signature">
|
|
515
|
+
|
|
516
|
+
<a href="#get_current_counter-instance_method" title="#get_current_counter (instance method)">- (Object) <strong>get_current_counter</strong> </a>
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
</span>
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
531
|
+
|
|
532
|
+
<p>Gets the current counter from the underlining storage.</p>
|
|
533
|
+
</div></span>
|
|
534
|
+
|
|
535
|
+
</li>
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
<li class="public ">
|
|
539
|
+
<span class="summary_signature">
|
|
540
|
+
|
|
541
|
+
<a href="#get_next_counter-instance_method" title="#get_next_counter (instance method)">- (Object) <strong>get_next_counter</strong> </a>
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
</span>
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
556
|
+
|
|
557
|
+
<p>Returns next counter if no overflow, otherwise returns nil
|
|
558
|
+
????????????????????????????-.</p>
|
|
559
|
+
</div></span>
|
|
560
|
+
|
|
561
|
+
</li>
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
<li class="public ">
|
|
565
|
+
<span class="summary_signature">
|
|
566
|
+
|
|
567
|
+
<a href="#get_shape-instance_method" title="#get_shape (instance method)">- (Object) <strong>get_shape</strong>(dim_i) </a>
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
</span>
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
582
|
+
|
|
583
|
+
<p>Get the length of the ith dimension.</p>
|
|
584
|
+
</div></span>
|
|
585
|
+
|
|
586
|
+
</li>
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
<li class="public ">
|
|
590
|
+
<span class="summary_signature">
|
|
591
|
+
|
|
592
|
+
<a href="#incr-instance_method" title="#incr (instance method)">- (Object) <strong>incr</strong> </a>
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
</span>
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
607
|
+
|
|
608
|
+
<p>Increment the current element by 1.</p>
|
|
609
|
+
</div></span>
|
|
610
|
+
|
|
611
|
+
</li>
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
<li class="public ">
|
|
615
|
+
<span class="summary_signature">
|
|
616
|
+
|
|
617
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Counter) <strong>initialize</strong>(mdarray) </a>
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
</span>
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
<span class="note title constructor">constructor</span>
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
<span class="summary_desc"><div class='inline'>
|
|
634
|
+
<p>????????????????????????????.</p>
|
|
635
|
+
</div></span>
|
|
636
|
+
|
|
637
|
+
</li>
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
<li class="public ">
|
|
641
|
+
<span class="summary_signature">
|
|
642
|
+
|
|
643
|
+
<a href="#reset_counter-instance_method" title="#reset_counter (instance method)">- (Object) <strong>reset_counter</strong> </a>
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
</span>
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
658
|
+
|
|
659
|
+
<p>Reset the counter to the defined start value ????????????????????????????.</p>
|
|
660
|
+
</div></span>
|
|
661
|
+
|
|
662
|
+
</li>
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
<li class="public ">
|
|
666
|
+
<span class="summary_signature">
|
|
667
|
+
|
|
668
|
+
<a href="#reshape-instance_method" title="#reshape (instance method)">- (Object) <strong>reshape</strong>(counter) </a>
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
</span>
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
683
|
+
|
|
684
|
+
<p>If given index has negative values, then reshape it so that it only has
|
|
685
|
+
positive values.</p>
|
|
686
|
+
</div></span>
|
|
687
|
+
|
|
688
|
+
</li>
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
<li class="public ">
|
|
692
|
+
<span class="summary_signature">
|
|
693
|
+
|
|
694
|
+
<a href="#set-instance_method" title="#set (instance method)">- (Object) <strong>set</strong>(counter, value) </a>
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
</span>
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
709
|
+
|
|
710
|
+
<p>Sets the value of counter.</p>
|
|
711
|
+
</div></span>
|
|
712
|
+
|
|
713
|
+
</li>
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
<li class="public ">
|
|
717
|
+
<span class="summary_signature">
|
|
718
|
+
|
|
719
|
+
<a href="#set_at_counter-instance_method" title="#set_at_counter (instance method)">- (Object) <strong>set_at_counter</strong>(value) </a>
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
</span>
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
734
|
+
|
|
735
|
+
<p>Sets the value of the array at counter with value.</p>
|
|
736
|
+
</div></span>
|
|
737
|
+
|
|
738
|
+
</li>
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
<li class="public ">
|
|
742
|
+
<span class="summary_signature">
|
|
743
|
+
|
|
744
|
+
<a href="#set_counter-instance_method" title="#set_counter (instance method)">- (Object) <strong>set_counter</strong>(counter) </a>
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
</span>
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
759
|
+
|
|
760
|
+
<p>Sets this index to point to the given counter.</p>
|
|
761
|
+
</div></span>
|
|
762
|
+
|
|
763
|
+
</li>
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
<li class="public ">
|
|
767
|
+
<span class="summary_signature">
|
|
768
|
+
|
|
769
|
+
<a href="#set_counter_fast-instance_method" title="#set_counter_fast (instance method)">- (Object) <strong>set_counter_fast</strong>(counter) </a>
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
</span>
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
784
|
+
|
|
785
|
+
<p>Sets this index to point to the given counter.</p>
|
|
786
|
+
</div></span>
|
|
787
|
+
|
|
788
|
+
</li>
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
<li class="public ">
|
|
792
|
+
<span class="summary_signature">
|
|
793
|
+
|
|
794
|
+
<a href="#set_current-instance_method" title="#set_current (instance method)">- (Object) <strong>set_current</strong>(value) </a>
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
</span>
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
809
|
+
|
|
810
|
+
<p>Sets value of current counter.</p>
|
|
811
|
+
</div></span>
|
|
812
|
+
|
|
813
|
+
</li>
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
<li class="public ">
|
|
817
|
+
<span class="summary_signature">
|
|
818
|
+
|
|
819
|
+
<a href="#set_finish-instance_method" title="#set_finish (instance method)">- (Object) <strong>set_finish</strong>(finish) </a>
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
</span>
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
834
|
+
|
|
835
|
+
<p>Sets the finishing position of the index ????????????????????????????-.</p>
|
|
836
|
+
</div></span>
|
|
837
|
+
|
|
838
|
+
</li>
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
<li class="public ">
|
|
842
|
+
<span class="summary_signature">
|
|
843
|
+
|
|
844
|
+
<a href="#set_i-instance_method" title="#set_i (instance method)">- (Object) <strong>set_i</strong>(dim, index) </a>
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
</span>
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
<span class="summary_desc"><div class='inline'>
|
|
859
|
+
<p>????????????????????????????.</p>
|
|
860
|
+
</div></span>
|
|
861
|
+
|
|
862
|
+
</li>
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
<li class="public ">
|
|
866
|
+
<span class="summary_signature">
|
|
867
|
+
|
|
868
|
+
<a href="#set_i_fast-instance_method" title="#set_i_fast (instance method)">- (Object) <strong>set_i_fast</strong>(dim, index) </a>
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
</span>
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
<span class="summary_desc"><div class='inline'>
|
|
883
|
+
<p>????????????????????????????.</p>
|
|
884
|
+
</div></span>
|
|
885
|
+
|
|
886
|
+
</li>
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
<li class="public ">
|
|
890
|
+
<span class="summary_signature">
|
|
891
|
+
|
|
892
|
+
<a href="#set_start-instance_method" title="#set_start (instance method)">- (Object) <strong>set_start</strong>(start) </a>
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
</span>
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
<span class="summary_desc"><div class='inline'><hr style="height: 10px">
|
|
907
|
+
|
|
908
|
+
<p>Sets the starting position of the index ????????????????????????????-.</p>
|
|
909
|
+
</div></span>
|
|
910
|
+
|
|
911
|
+
</li>
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
<li class="public ">
|
|
915
|
+
<span class="summary_signature">
|
|
916
|
+
|
|
917
|
+
<a href="#walk_along_axes-instance_method" title="#walk_along_axes (instance method)">- (Object) <strong>walk_along_axes</strong> </a>
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
</span>
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
<span class="summary_desc"><div class='inline'>
|
|
932
|
+
<p>????????????????????????????-.</p>
|
|
933
|
+
</div></span>
|
|
934
|
+
|
|
935
|
+
</li>
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
</ul>
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
<div id="constructor_details" class="method_details_list">
|
|
943
|
+
<h2>Constructor Details</h2>
|
|
944
|
+
|
|
945
|
+
<div class="method_details first">
|
|
946
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
947
|
+
|
|
948
|
+
- (<tt><span class='object_link'><a href="" title="MDArray::Counter (class)">Counter</a></span></tt>) <strong>initialize</strong>(mdarray)
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
</h3><div class="docstring">
|
|
955
|
+
<div class="discussion">
|
|
956
|
+
<hr style="height: 10px">
|
|
957
|
+
<hr style="height: 10px">
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
</div>
|
|
961
|
+
</div>
|
|
962
|
+
<div class="tags">
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
</div><table class="source_code">
|
|
966
|
+
<tr>
|
|
967
|
+
<td>
|
|
968
|
+
<pre class="lines">
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
56
|
|
972
|
+
57
|
|
973
|
+
58
|
|
974
|
+
59
|
|
975
|
+
60
|
|
976
|
+
61
|
|
977
|
+
62
|
|
978
|
+
63
|
|
979
|
+
64
|
|
980
|
+
65
|
|
981
|
+
66
|
|
982
|
+
67
|
|
983
|
+
68
|
|
984
|
+
69
|
|
985
|
+
70
|
|
986
|
+
71
|
|
987
|
+
72
|
|
988
|
+
73</pre>
|
|
989
|
+
</td>
|
|
990
|
+
<td>
|
|
991
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 56</span>
|
|
992
|
+
|
|
993
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_mdarray identifier id'>mdarray</span><span class='rparen token'>)</span>
|
|
994
|
+
|
|
995
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span> <span class='assign token'>=</span> <span class='rubyid_mdarray identifier id'>mdarray</span>
|
|
996
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span> <span class='assign token'>=</span> <span class='rubyid_mdarray identifier id'>mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getIndex identifier id'>getIndex</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
|
|
997
|
+
<span class='rubyid_@shape ivar id'>@shape</span> <span class='assign token'>=</span> <span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_getShape identifier id'>getShape</span><span class='lparen token'>(</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_to_a identifier id'>to_a</span>
|
|
998
|
+
|
|
999
|
+
<span class='comment val'># by default the starting index is the [0] index (first element)</span>
|
|
1000
|
+
<span class='rubyid_shape identifier id'>shape</span> <span class='assign token'>=</span> <span class='rubyid_@shape ivar id'>@shape</span><span class='dot token'>.</span><span class='rubyid_dup identifier id'>dup</span>
|
|
1001
|
+
<span class='rubyid_set_start identifier id'>set_start</span><span class='lparen token'>(</span><span class='rubyid_shape identifier id'>shape</span><span class='dot token'>.</span><span class='rubyid_fill identifier id'>fill</span><span class='lparen token'>(</span><span class='integer val'>0</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
|
1002
|
+
<span class='comment val'># by default the finish index is the last element of the array</span>
|
|
1003
|
+
<span class='rubyid_finish identifier id'>finish</span> <span class='assign token'>=</span> <span class='rubyid_Array constant id'>Array</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span>
|
|
1004
|
+
<span class='rubyid_@shape ivar id'>@shape</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_val identifier id'>val</span><span class='bitor op'>|</span>
|
|
1005
|
+
<span class='rubyid_finish identifier id'>finish</span> <span class='lshft op'><<</span> <span class='rubyid_val identifier id'>val</span> <span class='minus op'>-</span> <span class='integer val'>1</span>
|
|
1006
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1007
|
+
|
|
1008
|
+
<span class='rubyid_set_finish identifier id'>set_finish</span><span class='lparen token'>(</span><span class='rubyid_finish identifier id'>finish</span><span class='rparen token'>)</span>
|
|
1009
|
+
|
|
1010
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1011
|
+
</pre>
|
|
1012
|
+
</td>
|
|
1013
|
+
</tr>
|
|
1014
|
+
</table>
|
|
1015
|
+
</div>
|
|
1016
|
+
|
|
1017
|
+
</div>
|
|
1018
|
+
|
|
1019
|
+
<div id="instance_attr_details" class="attr_details">
|
|
1020
|
+
<h2>Instance Attribute Details</h2>
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
<span id=""></span>
|
|
1024
|
+
<div class="method_details first">
|
|
1025
|
+
<h3 class="signature first" id="counter-instance_method">
|
|
1026
|
+
|
|
1027
|
+
- (<tt>Object</tt>) <strong>counter</strong> <span class="extras">(readonly)</span>
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
</h3><div class="docstring">
|
|
1034
|
+
<div class="discussion">
|
|
1035
|
+
|
|
1036
|
+
<p>Returns the value of attribute counter</p>
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
</div>
|
|
1040
|
+
</div>
|
|
1041
|
+
<div class="tags">
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
</div><table class="source_code">
|
|
1045
|
+
<tr>
|
|
1046
|
+
<td>
|
|
1047
|
+
<pre class="lines">
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
50
|
|
1051
|
+
51
|
|
1052
|
+
52</pre>
|
|
1053
|
+
</td>
|
|
1054
|
+
<td>
|
|
1055
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 50</span>
|
|
1056
|
+
|
|
1057
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_counter identifier id'>counter</span>
|
|
1058
|
+
<span class='rubyid_@counter ivar id'>@counter</span>
|
|
1059
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1060
|
+
</pre>
|
|
1061
|
+
</td>
|
|
1062
|
+
</tr>
|
|
1063
|
+
</table>
|
|
1064
|
+
</div>
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
<span id=""></span>
|
|
1068
|
+
<div class="method_details ">
|
|
1069
|
+
<h3 class="signature " id="finish-instance_method">
|
|
1070
|
+
|
|
1071
|
+
- (<tt>Object</tt>) <strong>finish</strong> <span class="extras">(readonly)</span>
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
</h3><div class="docstring">
|
|
1078
|
+
<div class="discussion">
|
|
1079
|
+
|
|
1080
|
+
<p>Returns the value of attribute finish</p>
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
</div>
|
|
1084
|
+
</div>
|
|
1085
|
+
<div class="tags">
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
</div><table class="source_code">
|
|
1089
|
+
<tr>
|
|
1090
|
+
<td>
|
|
1091
|
+
<pre class="lines">
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
49
|
|
1095
|
+
50
|
|
1096
|
+
51</pre>
|
|
1097
|
+
</td>
|
|
1098
|
+
<td>
|
|
1099
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 49</span>
|
|
1100
|
+
|
|
1101
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_finish identifier id'>finish</span>
|
|
1102
|
+
<span class='rubyid_@finish ivar id'>@finish</span>
|
|
1103
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1104
|
+
</pre>
|
|
1105
|
+
</td>
|
|
1106
|
+
</tr>
|
|
1107
|
+
</table>
|
|
1108
|
+
</div>
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
<span id=""></span>
|
|
1112
|
+
<div class="method_details ">
|
|
1113
|
+
<h3 class="signature " id="mdarray-instance_method">
|
|
1114
|
+
|
|
1115
|
+
- (<tt>Object</tt>) <strong>mdarray</strong> <span class="extras">(readonly)</span>
|
|
1116
|
+
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
</h3><div class="docstring">
|
|
1122
|
+
<div class="discussion">
|
|
1123
|
+
|
|
1124
|
+
<p>Returns the value of attribute mdarray</p>
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
</div>
|
|
1128
|
+
</div>
|
|
1129
|
+
<div class="tags">
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
</div><table class="source_code">
|
|
1133
|
+
<tr>
|
|
1134
|
+
<td>
|
|
1135
|
+
<pre class="lines">
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
45
|
|
1139
|
+
46
|
|
1140
|
+
47</pre>
|
|
1141
|
+
</td>
|
|
1142
|
+
<td>
|
|
1143
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 45</span>
|
|
1144
|
+
|
|
1145
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_mdarray identifier id'>mdarray</span>
|
|
1146
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span>
|
|
1147
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1148
|
+
</pre>
|
|
1149
|
+
</td>
|
|
1150
|
+
</tr>
|
|
1151
|
+
</table>
|
|
1152
|
+
</div>
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
<span id=""></span>
|
|
1156
|
+
<div class="method_details ">
|
|
1157
|
+
<h3 class="signature " id="nc_index-instance_method">
|
|
1158
|
+
|
|
1159
|
+
- (<tt>Object</tt>) <strong>nc_index</strong> <span class="extras">(readonly)</span>
|
|
1160
|
+
|
|
1161
|
+
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
</h3><div class="docstring">
|
|
1166
|
+
<div class="discussion">
|
|
1167
|
+
|
|
1168
|
+
<p>Returns the value of attribute nc_index</p>
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
</div>
|
|
1172
|
+
</div>
|
|
1173
|
+
<div class="tags">
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
</div><table class="source_code">
|
|
1177
|
+
<tr>
|
|
1178
|
+
<td>
|
|
1179
|
+
<pre class="lines">
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
46
|
|
1183
|
+
47
|
|
1184
|
+
48</pre>
|
|
1185
|
+
</td>
|
|
1186
|
+
<td>
|
|
1187
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 46</span>
|
|
1188
|
+
|
|
1189
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_nc_index identifier id'>nc_index</span>
|
|
1190
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span>
|
|
1191
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1192
|
+
</pre>
|
|
1193
|
+
</td>
|
|
1194
|
+
</tr>
|
|
1195
|
+
</table>
|
|
1196
|
+
</div>
|
|
1197
|
+
|
|
1198
|
+
|
|
1199
|
+
<span id=""></span>
|
|
1200
|
+
<div class="method_details ">
|
|
1201
|
+
<h3 class="signature " id="shape-instance_method">
|
|
1202
|
+
|
|
1203
|
+
- (<tt>Object</tt>) <strong>shape</strong> <span class="extras">(readonly)</span>
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
</h3><div class="docstring">
|
|
1210
|
+
<div class="discussion">
|
|
1211
|
+
|
|
1212
|
+
<p>Returns the value of attribute shape</p>
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
</div>
|
|
1216
|
+
</div>
|
|
1217
|
+
<div class="tags">
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
</div><table class="source_code">
|
|
1221
|
+
<tr>
|
|
1222
|
+
<td>
|
|
1223
|
+
<pre class="lines">
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
47
|
|
1227
|
+
48
|
|
1228
|
+
49</pre>
|
|
1229
|
+
</td>
|
|
1230
|
+
<td>
|
|
1231
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 47</span>
|
|
1232
|
+
|
|
1233
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_shape identifier id'>shape</span>
|
|
1234
|
+
<span class='rubyid_@shape ivar id'>@shape</span>
|
|
1235
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1236
|
+
</pre>
|
|
1237
|
+
</td>
|
|
1238
|
+
</tr>
|
|
1239
|
+
</table>
|
|
1240
|
+
</div>
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
<span id=""></span>
|
|
1244
|
+
<div class="method_details ">
|
|
1245
|
+
<h3 class="signature " id="start-instance_method">
|
|
1246
|
+
|
|
1247
|
+
- (<tt>Object</tt>) <strong>start</strong> <span class="extras">(readonly)</span>
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
</h3><div class="docstring">
|
|
1254
|
+
<div class="discussion">
|
|
1255
|
+
<hr style="height: 10px">
|
|
1256
|
+
|
|
1257
|
+
<p>Accessor methods for start, finish and position.</p>
|
|
1258
|
+
<hr style="height: 10px">
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
</div>
|
|
1262
|
+
</div>
|
|
1263
|
+
<div class="tags">
|
|
1264
|
+
|
|
1265
|
+
|
|
1266
|
+
</div><table class="source_code">
|
|
1267
|
+
<tr>
|
|
1268
|
+
<td>
|
|
1269
|
+
<pre class="lines">
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
110
|
|
1273
|
+
111
|
|
1274
|
+
112</pre>
|
|
1275
|
+
</td>
|
|
1276
|
+
<td>
|
|
1277
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 110</span>
|
|
1278
|
+
|
|
1279
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_start identifier id'>start</span>
|
|
1280
|
+
<span class='rubyid_@start ivar id'>@start</span>
|
|
1281
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1282
|
+
</pre>
|
|
1283
|
+
</td>
|
|
1284
|
+
</tr>
|
|
1285
|
+
</table>
|
|
1286
|
+
</div>
|
|
1287
|
+
|
|
1288
|
+
</div>
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
<div id="instance_method_details" class="method_details_list">
|
|
1292
|
+
<h2>Instance Method Details</h2>
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
<div class="method_details first">
|
|
1296
|
+
<h3 class="signature first" id="[]-instance_method">
|
|
1297
|
+
|
|
1298
|
+
- (<tt>Object</tt>) <strong>[]</strong>(*counter)
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
</h3><div class="docstring">
|
|
1305
|
+
<div class="discussion">
|
|
1306
|
+
<hr style="height: 10px">
|
|
1307
|
+
|
|
1308
|
+
<p>Gets the element at the given counter. If counter is not basic, try to fix
|
|
1309
|
+
it to its basic form.</p>
|
|
1310
|
+
<hr style="height: 10px">
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
</div>
|
|
1314
|
+
</div>
|
|
1315
|
+
<div class="tags">
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
</div><table class="source_code">
|
|
1319
|
+
<tr>
|
|
1320
|
+
<td>
|
|
1321
|
+
<pre class="lines">
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
166
|
|
1325
|
+
167
|
|
1326
|
+
168
|
|
1327
|
+
169</pre>
|
|
1328
|
+
</td>
|
|
1329
|
+
<td>
|
|
1330
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 166</span>
|
|
1331
|
+
|
|
1332
|
+
<span class='rubyid_def def kw'>def</span> <span class='aref op'>[]</span><span class='lparen token'>(</span><span class='mult op'>*</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
1333
|
+
<span class='rubyid_set_counter identifier id'>set_counter</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
1334
|
+
<span class='rubyid_get_at_counter identifier id'>get_at_counter</span>
|
|
1335
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1336
|
+
</pre>
|
|
1337
|
+
</td>
|
|
1338
|
+
</tr>
|
|
1339
|
+
</table>
|
|
1340
|
+
</div>
|
|
1341
|
+
|
|
1342
|
+
<div class="method_details ">
|
|
1343
|
+
<h3 class="signature " id="[]=-instance_method">
|
|
1344
|
+
|
|
1345
|
+
- (<tt>Object</tt>) <strong>[]=</strong>(counter, value)
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
</h3><div class="docstring">
|
|
1352
|
+
<div class="discussion">
|
|
1353
|
+
<hr style="height: 10px">
|
|
1354
|
+
|
|
1355
|
+
<p>Sets the value of counter. If counter is not basic, try to fix it to its
|
|
1356
|
+
basic form.</p>
|
|
1357
|
+
<hr style="height: 10px">
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
</div>
|
|
1361
|
+
</div>
|
|
1362
|
+
<div class="tags">
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
</div><table class="source_code">
|
|
1366
|
+
<tr>
|
|
1367
|
+
<td>
|
|
1368
|
+
<pre class="lines">
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
196
|
|
1372
|
+
197
|
|
1373
|
+
198
|
|
1374
|
+
199</pre>
|
|
1375
|
+
</td>
|
|
1376
|
+
<td>
|
|
1377
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 196</span>
|
|
1378
|
+
|
|
1379
|
+
<span class='rubyid_def def kw'>def</span> <span class='aset op'>[]=</span> <span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
1380
|
+
<span class='rubyid_set_counter identifier id'>set_counter</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
1381
|
+
<span class='rubyid_set_at_counter identifier id'>set_at_counter</span><span class='lparen token'>(</span><span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
1382
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1383
|
+
</pre>
|
|
1384
|
+
</td>
|
|
1385
|
+
</tr>
|
|
1386
|
+
</table>
|
|
1387
|
+
</div>
|
|
1388
|
+
|
|
1389
|
+
<div class="method_details ">
|
|
1390
|
+
<h3 class="signature " id="compute_size-instance_method">
|
|
1391
|
+
|
|
1392
|
+
- (<tt>Object</tt>) <strong>compute_size</strong>
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
|
|
1397
|
+
|
|
1398
|
+
</h3><div class="docstring">
|
|
1399
|
+
<div class="discussion">
|
|
1400
|
+
<hr style="height: 10px">
|
|
1401
|
+
|
|
1402
|
+
<p>Compute total number of elements in the array.</p>
|
|
1403
|
+
<hr style="height: 10px">
|
|
1404
|
+
|
|
1405
|
+
|
|
1406
|
+
</div>
|
|
1407
|
+
</div>
|
|
1408
|
+
<div class="tags">
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
</div><table class="source_code">
|
|
1412
|
+
<tr>
|
|
1413
|
+
<td>
|
|
1414
|
+
<pre class="lines">
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
490
|
|
1418
|
+
491
|
|
1419
|
+
492</pre>
|
|
1420
|
+
</td>
|
|
1421
|
+
<td>
|
|
1422
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 490</span>
|
|
1423
|
+
|
|
1424
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_compute_size identifier id'>compute_size</span>
|
|
1425
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_computeSize identifier id'>computeSize</span><span class='lparen token'>(</span><span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getShape identifier id'>getShape</span><span class='lparen token'>(</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
|
1426
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1427
|
+
</pre>
|
|
1428
|
+
</td>
|
|
1429
|
+
</tr>
|
|
1430
|
+
</table>
|
|
1431
|
+
</div>
|
|
1432
|
+
|
|
1433
|
+
<div class="method_details ">
|
|
1434
|
+
<h3 class="signature " id="each-instance_method">
|
|
1435
|
+
|
|
1436
|
+
- (<tt>Object</tt>) <strong>each</strong>
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
|
|
1440
|
+
|
|
1441
|
+
|
|
1442
|
+
</h3><div class="docstring">
|
|
1443
|
+
<div class="discussion">
|
|
1444
|
+
<hr style="height: 10px">
|
|
1445
|
+
<hr style="height: 10px">
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
</div>
|
|
1449
|
+
</div>
|
|
1450
|
+
<div class="tags">
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
</div><table class="source_code">
|
|
1454
|
+
<tr>
|
|
1455
|
+
<td>
|
|
1456
|
+
<pre class="lines">
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
134
|
|
1460
|
+
135
|
|
1461
|
+
136
|
|
1462
|
+
137
|
|
1463
|
+
138
|
|
1464
|
+
139
|
|
1465
|
+
140
|
|
1466
|
+
141</pre>
|
|
1467
|
+
</td>
|
|
1468
|
+
<td>
|
|
1469
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 134</span>
|
|
1470
|
+
|
|
1471
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_each identifier id'>each</span>
|
|
1472
|
+
|
|
1473
|
+
<span class='rubyid_reset_counter identifier id'>reset_counter</span>
|
|
1474
|
+
<span class='rubyid_begin begin kw'>begin</span>
|
|
1475
|
+
<span class='rubyid_yield yield kw'>yield</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_counter identifier id'>counter</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_block_given? fid id'>block_given?</span>
|
|
1476
|
+
<span class='rubyid_end end kw'>end</span> <span class='rubyid_while while_mod kw'>while</span><span class='lparen token'>(</span><span class='rubyid_get_next_counter identifier id'>get_next_counter</span><span class='rparen token'>)</span>
|
|
1477
|
+
|
|
1478
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1479
|
+
</pre>
|
|
1480
|
+
</td>
|
|
1481
|
+
</tr>
|
|
1482
|
+
</table>
|
|
1483
|
+
</div>
|
|
1484
|
+
|
|
1485
|
+
<div class="method_details ">
|
|
1486
|
+
<h3 class="signature " id="each_along_axes-instance_method">
|
|
1487
|
+
|
|
1488
|
+
- (<tt>Object</tt>) <strong>each_along_axes</strong>(axes)
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
</h3><div class="docstring">
|
|
1495
|
+
<div class="discussion">
|
|
1496
|
+
<hr style="height: 10px">
|
|
1497
|
+
|
|
1498
|
+
<p>Walks the counter along each of the axes. For instance if given axes [0,
|
|
1499
|
+
2] and the array shape is [4, 3, 2], then the counter will be [0, 0, 0],
|
|
1500
|
+
[0, 0, 1],</p>
|
|
1501
|
+
<dl class="rdoc-list"><dt>1, 0, 1], [1, 0, 1], [2, 0, 0], ? [3, 0, 1</dt>
|
|
1502
|
+
<dd><hr style="height: 10px">
|
|
1503
|
+
</dd></dl>
|
|
1504
|
+
|
|
1505
|
+
|
|
1506
|
+
</div>
|
|
1507
|
+
</div>
|
|
1508
|
+
<div class="tags">
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
</div><table class="source_code">
|
|
1512
|
+
<tr>
|
|
1513
|
+
<td>
|
|
1514
|
+
<pre class="lines">
|
|
1515
|
+
|
|
1516
|
+
|
|
1517
|
+
149
|
|
1518
|
+
150
|
|
1519
|
+
151
|
|
1520
|
+
152
|
|
1521
|
+
153
|
|
1522
|
+
154
|
|
1523
|
+
155
|
|
1524
|
+
156
|
|
1525
|
+
157
|
|
1526
|
+
158
|
|
1527
|
+
159</pre>
|
|
1528
|
+
</td>
|
|
1529
|
+
<td>
|
|
1530
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 149</span>
|
|
1531
|
+
|
|
1532
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_each_along_axes identifier id'>each_along_axes</span><span class='lparen token'>(</span><span class='rubyid_axes identifier id'>axes</span><span class='rparen token'>)</span>
|
|
1533
|
+
|
|
1534
|
+
<span class='rubyid_reset_counter identifier id'>reset_counter</span>
|
|
1535
|
+
<span class='rubyid_@axes ivar id'>@axes</span> <span class='assign token'>=</span> <span class='rubyid_axes identifier id'>axes</span>
|
|
1536
|
+
|
|
1537
|
+
<span class='rubyid_axis identifier id'>axis</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='integer val'>0</span><span class='comma token'>,</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_counter identifier id'>counter</span><span class='dot token'>.</span><span class='rubyid_size identifier id'>size</span> <span class='minus op'>-</span> <span class='integer val'>2</span><span class='rbrack token'>]</span>
|
|
1538
|
+
<span class='rubyid_begin begin kw'>begin</span>
|
|
1539
|
+
<span class='rubyid_yield yield kw'>yield</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_counter identifier id'>counter</span><span class='comma token'>,</span> <span class='rubyid_axis identifier id'>axis</span><span class='lbrack token'>[</span><span class='integer val'>1</span><span class='rbrack token'>]</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_block_given? fid id'>block_given?</span>
|
|
1540
|
+
<span class='rubyid_end end kw'>end</span> <span class='rubyid_while while_mod kw'>while</span> <span class='lparen token'>(</span><span class='rubyid_axis identifier id'>axis</span> <span class='assign token'>=</span> <span class='rubyid_walk_along_axes identifier id'>walk_along_axes</span><span class='rparen token'>)</span>
|
|
1541
|
+
|
|
1542
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1543
|
+
</pre>
|
|
1544
|
+
</td>
|
|
1545
|
+
</tr>
|
|
1546
|
+
</table>
|
|
1547
|
+
</div>
|
|
1548
|
+
|
|
1549
|
+
<div class="method_details ">
|
|
1550
|
+
<h3 class="signature " id="get-instance_method">
|
|
1551
|
+
|
|
1552
|
+
- (<tt>Object</tt>) <strong>get</strong>(counter)
|
|
1553
|
+
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
|
|
1558
|
+
</h3><div class="docstring">
|
|
1559
|
+
<div class="discussion">
|
|
1560
|
+
<hr style="height: 10px">
|
|
1561
|
+
|
|
1562
|
+
<p>Gets the element at the given counter. Assumes that the counter is of the
|
|
1563
|
+
proper shape.</p>
|
|
1564
|
+
<hr style="height: 10px">
|
|
1565
|
+
|
|
1566
|
+
|
|
1567
|
+
</div>
|
|
1568
|
+
</div>
|
|
1569
|
+
<div class="tags">
|
|
1570
|
+
|
|
1571
|
+
|
|
1572
|
+
</div><table class="source_code">
|
|
1573
|
+
<tr>
|
|
1574
|
+
<td>
|
|
1575
|
+
<pre class="lines">
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
176
|
|
1579
|
+
177
|
|
1580
|
+
178
|
|
1581
|
+
179</pre>
|
|
1582
|
+
</td>
|
|
1583
|
+
<td>
|
|
1584
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 176</span>
|
|
1585
|
+
|
|
1586
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_get identifier id'>get</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
1587
|
+
<span class='rubyid_set_counter_fast identifier id'>set_counter_fast</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
1588
|
+
<span class='rubyid_get_at_counter identifier id'>get_at_counter</span>
|
|
1589
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1590
|
+
</pre>
|
|
1591
|
+
</td>
|
|
1592
|
+
</tr>
|
|
1593
|
+
</table>
|
|
1594
|
+
</div>
|
|
1595
|
+
|
|
1596
|
+
<div class="method_details ">
|
|
1597
|
+
<h3 class="signature " id="get_at_counter-instance_method">
|
|
1598
|
+
|
|
1599
|
+
- (<tt>Object</tt>) <strong>get_at_counter</strong>
|
|
1600
|
+
|
|
1601
|
+
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
|
|
1605
|
+
</h3><div class="docstring">
|
|
1606
|
+
<div class="discussion">
|
|
1607
|
+
<hr style="height: 10px">
|
|
1608
|
+
<hr style="height: 10px">
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
</div>
|
|
1612
|
+
</div>
|
|
1613
|
+
<div class="tags">
|
|
1614
|
+
|
|
1615
|
+
|
|
1616
|
+
</div><table class="source_code">
|
|
1617
|
+
<tr>
|
|
1618
|
+
<td>
|
|
1619
|
+
<pre class="lines">
|
|
1620
|
+
|
|
1621
|
+
|
|
1622
|
+
387
|
|
1623
|
+
388
|
|
1624
|
+
389
|
|
1625
|
+
390
|
|
1626
|
+
391
|
|
1627
|
+
392
|
|
1628
|
+
393
|
|
1629
|
+
394
|
|
1630
|
+
395
|
|
1631
|
+
396
|
|
1632
|
+
397
|
|
1633
|
+
398
|
|
1634
|
+
399
|
|
1635
|
+
400
|
|
1636
|
+
401
|
|
1637
|
+
402
|
|
1638
|
+
403
|
|
1639
|
+
404
|
|
1640
|
+
405
|
|
1641
|
+
406
|
|
1642
|
+
407
|
|
1643
|
+
408
|
|
1644
|
+
409
|
|
1645
|
+
410
|
|
1646
|
+
411
|
|
1647
|
+
412</pre>
|
|
1648
|
+
</td>
|
|
1649
|
+
<td>
|
|
1650
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 387</span>
|
|
1651
|
+
|
|
1652
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_get_at_counter identifier id'>get_at_counter</span>
|
|
1653
|
+
|
|
1654
|
+
<span class='rubyid_case case kw'>case</span> <span class='rubyid_@type ivar id'>@type</span>
|
|
1655
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"boolean"</span>
|
|
1656
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getBoolean identifier id'>getBoolean</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1657
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"byte"</span>
|
|
1658
|
+
<span class='rubyid_@mdarra ivar id'>@mdarra</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getByte identifier id'>getByte</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1659
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"char"</span>
|
|
1660
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getChar identifier id'>getChar</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1661
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"double"</span>
|
|
1662
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getDouble identifier id'>getDouble</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1663
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"float"</span>
|
|
1664
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getFloat identifier id'>getFloat</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1665
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"int"</span>
|
|
1666
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getInt identifier id'>getInt</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1667
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"long"</span>
|
|
1668
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getLong identifier id'>getLong</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1669
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"short"</span>
|
|
1670
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getShort identifier id'>getShort</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1671
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"unsigned"</span>
|
|
1672
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getUnsigned identifier id'>getUnsigned</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1673
|
+
<span class='rubyid_else else kw'>else</span>
|
|
1674
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_getObject identifier id'>getObject</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='rparen token'>)</span>
|
|
1675
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1676
|
+
|
|
1677
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1678
|
+
</pre>
|
|
1679
|
+
</td>
|
|
1680
|
+
</tr>
|
|
1681
|
+
</table>
|
|
1682
|
+
</div>
|
|
1683
|
+
|
|
1684
|
+
<div class="method_details ">
|
|
1685
|
+
<h3 class="signature " id="get_current-instance_method">
|
|
1686
|
+
|
|
1687
|
+
- (<tt>Object</tt>) <strong>get_current</strong>
|
|
1688
|
+
|
|
1689
|
+
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
</h3><div class="docstring">
|
|
1694
|
+
<div class="discussion">
|
|
1695
|
+
<hr style="height: 10px">
|
|
1696
|
+
|
|
1697
|
+
<p>Gets element at current counter. Can be done fast, as counter is always of
|
|
1698
|
+
the proper shape.</p>
|
|
1699
|
+
<hr style="height: 10px">
|
|
1700
|
+
|
|
1701
|
+
|
|
1702
|
+
</div>
|
|
1703
|
+
</div>
|
|
1704
|
+
<div class="tags">
|
|
1705
|
+
|
|
1706
|
+
|
|
1707
|
+
</div><table class="source_code">
|
|
1708
|
+
<tr>
|
|
1709
|
+
<td>
|
|
1710
|
+
<pre class="lines">
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
186
|
|
1714
|
+
187
|
|
1715
|
+
188
|
|
1716
|
+
189</pre>
|
|
1717
|
+
</td>
|
|
1718
|
+
<td>
|
|
1719
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 186</span>
|
|
1720
|
+
|
|
1721
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_get_current identifier id'>get_current</span>
|
|
1722
|
+
<span class='rubyid_set_counter_fast identifier id'>set_counter_fast</span><span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
1723
|
+
<span class='rubyid_get_at_counter identifier id'>get_at_counter</span>
|
|
1724
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1725
|
+
</pre>
|
|
1726
|
+
</td>
|
|
1727
|
+
</tr>
|
|
1728
|
+
</table>
|
|
1729
|
+
</div>
|
|
1730
|
+
|
|
1731
|
+
<div class="method_details ">
|
|
1732
|
+
<h3 class="signature " id="get_current_counter-instance_method">
|
|
1733
|
+
|
|
1734
|
+
- (<tt>Object</tt>) <strong>get_current_counter</strong>
|
|
1735
|
+
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
|
|
1740
|
+
</h3><div class="docstring">
|
|
1741
|
+
<div class="discussion">
|
|
1742
|
+
<hr style="height: 10px">
|
|
1743
|
+
|
|
1744
|
+
<p>Gets the current counter from the underlining storage. Should be the same
|
|
1745
|
+
as</p>
|
|
1746
|
+
<hr style="height: 10px">
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
</div>
|
|
1750
|
+
</div>
|
|
1751
|
+
<div class="tags">
|
|
1752
|
+
|
|
1753
|
+
|
|
1754
|
+
</div><table class="source_code">
|
|
1755
|
+
<tr>
|
|
1756
|
+
<td>
|
|
1757
|
+
<pre class="lines">
|
|
1758
|
+
|
|
1759
|
+
|
|
1760
|
+
499
|
|
1761
|
+
500
|
|
1762
|
+
501</pre>
|
|
1763
|
+
</td>
|
|
1764
|
+
<td>
|
|
1765
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 499</span>
|
|
1766
|
+
|
|
1767
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_get_current_counter identifier id'>get_current_counter</span>
|
|
1768
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_getCurrentCounter identifier id'>getCurrentCounter</span><span class='lparen token'>(</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_to_a identifier id'>to_a</span>
|
|
1769
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1770
|
+
</pre>
|
|
1771
|
+
</td>
|
|
1772
|
+
</tr>
|
|
1773
|
+
</table>
|
|
1774
|
+
</div>
|
|
1775
|
+
|
|
1776
|
+
<div class="method_details ">
|
|
1777
|
+
<h3 class="signature " id="get_next_counter-instance_method">
|
|
1778
|
+
|
|
1779
|
+
- (<tt>Object</tt>) <strong>get_next_counter</strong>
|
|
1780
|
+
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
|
|
1784
|
+
|
|
1785
|
+
</h3><div class="docstring">
|
|
1786
|
+
<div class="discussion">
|
|
1787
|
+
<hr style="height: 10px">
|
|
1788
|
+
|
|
1789
|
+
<p>Returns next counter if no overflow, otherwise returns nil</p>
|
|
1790
|
+
<hr style="height: 10px">
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
</div>
|
|
1794
|
+
</div>
|
|
1795
|
+
<div class="tags">
|
|
1796
|
+
|
|
1797
|
+
|
|
1798
|
+
</div><table class="source_code">
|
|
1799
|
+
<tr>
|
|
1800
|
+
<td>
|
|
1801
|
+
<pre class="lines">
|
|
1802
|
+
|
|
1803
|
+
|
|
1804
|
+
230
|
|
1805
|
+
231
|
|
1806
|
+
232
|
|
1807
|
+
233
|
|
1808
|
+
234
|
|
1809
|
+
235
|
|
1810
|
+
236
|
|
1811
|
+
237
|
|
1812
|
+
238
|
|
1813
|
+
239
|
|
1814
|
+
240
|
|
1815
|
+
241
|
|
1816
|
+
242
|
|
1817
|
+
243
|
|
1818
|
+
244
|
|
1819
|
+
245
|
|
1820
|
+
246
|
|
1821
|
+
247
|
|
1822
|
+
248</pre>
|
|
1823
|
+
</td>
|
|
1824
|
+
<td>
|
|
1825
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 230</span>
|
|
1826
|
+
|
|
1827
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_get_next_counter identifier id'>get_next_counter</span>
|
|
1828
|
+
|
|
1829
|
+
<span class='comment val'># gets the next counter</span>
|
|
1830
|
+
<span class='rubyid_shape identifier id'>shape</span> <span class='assign token'>=</span> <span class='rubyid_@shape ivar id'>@shape</span><span class='dot token'>.</span><span class='rubyid_dup identifier id'>dup</span><span class='dot token'>.</span><span class='rubyid_reverse identifier id'>reverse</span>
|
|
1831
|
+
|
|
1832
|
+
<span class='rubyid_@counter ivar id'>@counter</span><span class='dot token'>.</span><span class='rubyid_each_with_index identifier id'>each_with_index</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_val identifier id'>val</span><span class='comma token'>,</span> <span class='rubyid_index identifier id'>index</span><span class='bitor op'>|</span>
|
|
1833
|
+
|
|
1834
|
+
<span class='rubyid_if if kw'>if</span> <span class='rubyid_val identifier id'>val</span> <span class='lt op'><</span> <span class='rubyid_shape identifier id'>shape</span><span class='lbrack token'>[</span><span class='rubyid_index identifier id'>index</span><span class='rbrack token'>]</span> <span class='minus op'>-</span> <span class='integer val'>1</span>
|
|
1835
|
+
<span class='rubyid_@counter ivar id'>@counter</span><span class='lbrack token'>[</span><span class='rubyid_index identifier id'>index</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_val identifier id'>val</span> <span class='plus op'>+</span> <span class='integer val'>1</span>
|
|
1836
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_counter identifier id'>counter</span>
|
|
1837
|
+
<span class='rubyid_else else kw'>else</span>
|
|
1838
|
+
<span class='rubyid_@counter ivar id'>@counter</span><span class='lbrack token'>[</span><span class='rubyid_index identifier id'>index</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='integer val'>0</span>
|
|
1839
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1840
|
+
|
|
1841
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1842
|
+
|
|
1843
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_nil nil kw'>nil</span>
|
|
1844
|
+
|
|
1845
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1846
|
+
</pre>
|
|
1847
|
+
</td>
|
|
1848
|
+
</tr>
|
|
1849
|
+
</table>
|
|
1850
|
+
</div>
|
|
1851
|
+
|
|
1852
|
+
<div class="method_details ">
|
|
1853
|
+
<h3 class="signature " id="get_shape-instance_method">
|
|
1854
|
+
|
|
1855
|
+
- (<tt>Object</tt>) <strong>get_shape</strong>(dim_i)
|
|
1856
|
+
|
|
1857
|
+
|
|
1858
|
+
|
|
1859
|
+
|
|
1860
|
+
|
|
1861
|
+
</h3><div class="docstring">
|
|
1862
|
+
<div class="discussion">
|
|
1863
|
+
<hr style="height: 10px">
|
|
1864
|
+
|
|
1865
|
+
<p>Get the length of the ith dimension.</p>
|
|
1866
|
+
<hr style="height: 10px">
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
</div>
|
|
1870
|
+
</div>
|
|
1871
|
+
<div class="tags">
|
|
1872
|
+
|
|
1873
|
+
|
|
1874
|
+
</div><table class="source_code">
|
|
1875
|
+
<tr>
|
|
1876
|
+
<td>
|
|
1877
|
+
<pre class="lines">
|
|
1878
|
+
|
|
1879
|
+
|
|
1880
|
+
482
|
|
1881
|
+
483
|
|
1882
|
+
484</pre>
|
|
1883
|
+
</td>
|
|
1884
|
+
<td>
|
|
1885
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 482</span>
|
|
1886
|
+
|
|
1887
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_get_shape identifier id'>get_shape</span><span class='lparen token'>(</span><span class='rubyid_dim_i identifier id'>dim_i</span><span class='rparen token'>)</span>
|
|
1888
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_getShape identifier id'>getShape</span><span class='lparen token'>(</span><span class='rubyid_dim_i identifier id'>dim_i</span><span class='rparen token'>)</span>
|
|
1889
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1890
|
+
</pre>
|
|
1891
|
+
</td>
|
|
1892
|
+
</tr>
|
|
1893
|
+
</table>
|
|
1894
|
+
</div>
|
|
1895
|
+
|
|
1896
|
+
<div class="method_details ">
|
|
1897
|
+
<h3 class="signature " id="incr-instance_method">
|
|
1898
|
+
|
|
1899
|
+
- (<tt>Object</tt>) <strong>incr</strong>
|
|
1900
|
+
|
|
1901
|
+
|
|
1902
|
+
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
</h3><div class="docstring">
|
|
1906
|
+
<div class="discussion">
|
|
1907
|
+
<hr style="height: 10px">
|
|
1908
|
+
|
|
1909
|
+
<p>Increment the current element by 1.</p>
|
|
1910
|
+
<hr style="height: 10px">
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
</div>
|
|
1914
|
+
</div>
|
|
1915
|
+
<div class="tags">
|
|
1916
|
+
|
|
1917
|
+
|
|
1918
|
+
</div><table class="source_code">
|
|
1919
|
+
<tr>
|
|
1920
|
+
<td>
|
|
1921
|
+
<pre class="lines">
|
|
1922
|
+
|
|
1923
|
+
|
|
1924
|
+
474
|
|
1925
|
+
475
|
|
1926
|
+
476</pre>
|
|
1927
|
+
</td>
|
|
1928
|
+
<td>
|
|
1929
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 474</span>
|
|
1930
|
+
|
|
1931
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_incr identifier id'>incr</span>
|
|
1932
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_incr identifier id'>incr</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
|
|
1933
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1934
|
+
</pre>
|
|
1935
|
+
</td>
|
|
1936
|
+
</tr>
|
|
1937
|
+
</table>
|
|
1938
|
+
</div>
|
|
1939
|
+
|
|
1940
|
+
<div class="method_details ">
|
|
1941
|
+
<h3 class="signature " id="reset_counter-instance_method">
|
|
1942
|
+
|
|
1943
|
+
- (<tt>Object</tt>) <strong>reset_counter</strong>
|
|
1944
|
+
|
|
1945
|
+
|
|
1946
|
+
|
|
1947
|
+
|
|
1948
|
+
|
|
1949
|
+
</h3><div class="docstring">
|
|
1950
|
+
<div class="discussion">
|
|
1951
|
+
<hr style="height: 10px">
|
|
1952
|
+
|
|
1953
|
+
<p>Reset the counter to the defined start value</p>
|
|
1954
|
+
<hr style="height: 10px">
|
|
1955
|
+
|
|
1956
|
+
|
|
1957
|
+
</div>
|
|
1958
|
+
</div>
|
|
1959
|
+
<div class="tags">
|
|
1960
|
+
|
|
1961
|
+
|
|
1962
|
+
</div><table class="source_code">
|
|
1963
|
+
<tr>
|
|
1964
|
+
<td>
|
|
1965
|
+
<pre class="lines">
|
|
1966
|
+
|
|
1967
|
+
|
|
1968
|
+
126
|
|
1969
|
+
127
|
|
1970
|
+
128</pre>
|
|
1971
|
+
</td>
|
|
1972
|
+
<td>
|
|
1973
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 126</span>
|
|
1974
|
+
|
|
1975
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_reset_counter identifier id'>reset_counter</span>
|
|
1976
|
+
<span class='rubyid_@counter ivar id'>@counter</span> <span class='assign token'>=</span> <span class='rubyid_@start ivar id'>@start</span><span class='dot token'>.</span><span class='rubyid_dup identifier id'>dup</span>
|
|
1977
|
+
<span class='rubyid_end end kw'>end</span>
|
|
1978
|
+
</pre>
|
|
1979
|
+
</td>
|
|
1980
|
+
</tr>
|
|
1981
|
+
</table>
|
|
1982
|
+
</div>
|
|
1983
|
+
|
|
1984
|
+
<div class="method_details ">
|
|
1985
|
+
<h3 class="signature " id="reshape-instance_method">
|
|
1986
|
+
|
|
1987
|
+
- (<tt>Object</tt>) <strong>reshape</strong>(counter)
|
|
1988
|
+
|
|
1989
|
+
|
|
1990
|
+
|
|
1991
|
+
|
|
1992
|
+
|
|
1993
|
+
</h3><div class="docstring">
|
|
1994
|
+
<div class="discussion">
|
|
1995
|
+
<hr style="height: 10px">
|
|
1996
|
+
|
|
1997
|
+
<p>If given index has negative values, then reshape it so that it only has
|
|
1998
|
+
positive values. check if it is a range: regex of the form /x/ or /x:y/ or
|
|
1999
|
+
/x:y:z/</p>
|
|
2000
|
+
<hr style="height: 10px">
|
|
2001
|
+
|
|
2002
|
+
|
|
2003
|
+
</div>
|
|
2004
|
+
</div>
|
|
2005
|
+
<div class="tags">
|
|
2006
|
+
|
|
2007
|
+
|
|
2008
|
+
</div><table class="source_code">
|
|
2009
|
+
<tr>
|
|
2010
|
+
<td>
|
|
2011
|
+
<pre class="lines">
|
|
2012
|
+
|
|
2013
|
+
|
|
2014
|
+
280
|
|
2015
|
+
281
|
|
2016
|
+
282
|
|
2017
|
+
283
|
|
2018
|
+
284
|
|
2019
|
+
285
|
|
2020
|
+
286
|
|
2021
|
+
287
|
|
2022
|
+
288
|
|
2023
|
+
289
|
|
2024
|
+
290
|
|
2025
|
+
291
|
|
2026
|
+
292
|
|
2027
|
+
293
|
|
2028
|
+
294
|
|
2029
|
+
295
|
|
2030
|
+
296
|
|
2031
|
+
297
|
|
2032
|
+
298
|
|
2033
|
+
299
|
|
2034
|
+
300
|
|
2035
|
+
301
|
|
2036
|
+
302
|
|
2037
|
+
303
|
|
2038
|
+
304
|
|
2039
|
+
305
|
|
2040
|
+
306
|
|
2041
|
+
307
|
|
2042
|
+
308
|
|
2043
|
+
309
|
|
2044
|
+
310
|
|
2045
|
+
311
|
|
2046
|
+
312
|
|
2047
|
+
313
|
|
2048
|
+
314</pre>
|
|
2049
|
+
</td>
|
|
2050
|
+
<td>
|
|
2051
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 280</span>
|
|
2052
|
+
|
|
2053
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_reshape identifier id'>reshape</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
2054
|
+
|
|
2055
|
+
<span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='dot token'>.</span><span class='rubyid_size identifier id'>size</span> <span class='neq op'>!=</span> <span class='rubyid_@shape ivar id'>@shape</span><span class='dot token'>.</span><span class='rubyid_size identifier id'>size</span><span class='rparen token'>)</span>
|
|
2056
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='dstring node'>"Counter shape #{counter} is not compatible with iterator shape #{@shape}"</span>
|
|
2057
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2058
|
+
|
|
2059
|
+
<span class='rubyid_reshaped_counter identifier id'>reshaped_counter</span> <span class='assign token'>=</span> <span class='rubyid_Array constant id'>Array</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span>
|
|
2060
|
+
<span class='rubyid_section identifier id'>section</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span>
|
|
2061
|
+
|
|
2062
|
+
<span class='rubyid_counter identifier id'>counter</span><span class='dot token'>.</span><span class='rubyid_each_with_index identifier id'>each_with_index</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_val identifier id'>val</span><span class='comma token'>,</span> <span class='rubyid_ind identifier id'>ind</span><span class='bitor op'>|</span>
|
|
2063
|
+
|
|
2064
|
+
<span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_val identifier id'>val</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span> <span class='rubyid_Integer constant id'>Integer</span><span class='rparen token'>)</span>
|
|
2065
|
+
<span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_val identifier id'>val</span> <span class='lt op'><</span> <span class='integer val'>0</span><span class='rparen token'>)</span>
|
|
2066
|
+
<span class='rubyid_new_ind identifier id'>new_ind</span> <span class='assign token'>=</span> <span class='rubyid_@shape ivar id'>@shape</span><span class='lbrack token'>[</span><span class='rubyid_ind identifier id'>ind</span><span class='rbrack token'>]</span> <span class='plus op'>+</span> <span class='rubyid_val identifier id'>val</span>
|
|
2067
|
+
<span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_new_ind identifier id'>new_ind</span> <span class='lt op'><</span> <span class='integer val'>0</span><span class='rparen token'>)</span>
|
|
2068
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='dstring node'>"Counter shape #{counter} is not compatible with iterator shape #{@shape}"</span>
|
|
2069
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2070
|
+
<span class='rubyid_reshaped_counter identifier id'>reshaped_counter</span><span class='lbrack token'>[</span><span class='rubyid_ind identifier id'>ind</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_new_ind identifier id'>new_ind</span>
|
|
2071
|
+
<span class='rubyid_elsif elsif kw'>elsif</span> <span class='lparen token'>(</span><span class='rubyid_val identifier id'>val</span> <span class='geq op'>>=</span> <span class='rubyid_@shape ivar id'>@shape</span><span class='lbrack token'>[</span><span class='rubyid_ind identifier id'>ind</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
|
|
2072
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='dstring node'>"Counter shape #{counter} is not compatible with iterator shape #{@shape}"</span>
|
|
2073
|
+
<span class='rubyid_else else kw'>else</span>
|
|
2074
|
+
<span class='rubyid_reshaped_counter identifier id'>reshaped_counter</span><span class='lbrack token'>[</span><span class='rubyid_ind identifier id'>ind</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_counter identifier id'>counter</span><span class='lbrack token'>[</span><span class='rubyid_ind identifier id'>ind</span><span class='rbrack token'>]</span>
|
|
2075
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2076
|
+
|
|
2077
|
+
<span class='rubyid_elsif elsif kw'>elsif</span> <span class='lparen token'>(</span><span class='rubyid_val identifier id'>val</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span> <span class='rubyid_Regexp constant id'>Regexp</span><span class='rparen token'>)</span>
|
|
2078
|
+
<span class='rubyid_section identifier id'>section</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span>
|
|
2079
|
+
<span class='rubyid_else else kw'>else</span>
|
|
2080
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='dstring node'>"Invalid index format: #{val}"</span>
|
|
2081
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2082
|
+
|
|
2083
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2084
|
+
|
|
2085
|
+
<span class='lbrack token'>[</span><span class='rubyid_section identifier id'>section</span><span class='comma token'>,</span> <span class='rubyid_reshaped_counter identifier id'>reshaped_counter</span><span class='rbrack token'>]</span>
|
|
2086
|
+
|
|
2087
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2088
|
+
</pre>
|
|
2089
|
+
</td>
|
|
2090
|
+
</tr>
|
|
2091
|
+
</table>
|
|
2092
|
+
</div>
|
|
2093
|
+
|
|
2094
|
+
<div class="method_details ">
|
|
2095
|
+
<h3 class="signature " id="set-instance_method">
|
|
2096
|
+
|
|
2097
|
+
- (<tt>Object</tt>) <strong>set</strong>(counter, value)
|
|
2098
|
+
|
|
2099
|
+
|
|
2100
|
+
|
|
2101
|
+
|
|
2102
|
+
|
|
2103
|
+
</h3><div class="docstring">
|
|
2104
|
+
<div class="discussion">
|
|
2105
|
+
<hr style="height: 10px">
|
|
2106
|
+
|
|
2107
|
+
<p>Sets the value of counter. Assume that counter is on its basic form.</p>
|
|
2108
|
+
<hr style="height: 10px">
|
|
2109
|
+
|
|
2110
|
+
|
|
2111
|
+
</div>
|
|
2112
|
+
</div>
|
|
2113
|
+
<div class="tags">
|
|
2114
|
+
|
|
2115
|
+
|
|
2116
|
+
</div><table class="source_code">
|
|
2117
|
+
<tr>
|
|
2118
|
+
<td>
|
|
2119
|
+
<pre class="lines">
|
|
2120
|
+
|
|
2121
|
+
|
|
2122
|
+
205
|
|
2123
|
+
206
|
|
2124
|
+
207
|
|
2125
|
+
208</pre>
|
|
2126
|
+
</td>
|
|
2127
|
+
<td>
|
|
2128
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 205</span>
|
|
2129
|
+
|
|
2130
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_set identifier id'>set</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2131
|
+
<span class='rubyid_set_counter_fast identifier id'>set_counter_fast</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
2132
|
+
<span class='rubyid_set_at_counter identifier id'>set_at_counter</span><span class='lparen token'>(</span><span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2133
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2134
|
+
</pre>
|
|
2135
|
+
</td>
|
|
2136
|
+
</tr>
|
|
2137
|
+
</table>
|
|
2138
|
+
</div>
|
|
2139
|
+
|
|
2140
|
+
<div class="method_details ">
|
|
2141
|
+
<h3 class="signature " id="set_at_counter-instance_method">
|
|
2142
|
+
|
|
2143
|
+
- (<tt>Object</tt>) <strong>set_at_counter</strong>(value)
|
|
2144
|
+
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
|
|
2148
|
+
|
|
2149
|
+
</h3><div class="docstring">
|
|
2150
|
+
<div class="discussion">
|
|
2151
|
+
<hr style="height: 10px">
|
|
2152
|
+
|
|
2153
|
+
<p>Sets the value of the array at counter with value. If type is given, cast
|
|
2154
|
+
the value to type before assignment</p>
|
|
2155
|
+
<hr style="height: 10px">
|
|
2156
|
+
|
|
2157
|
+
|
|
2158
|
+
</div>
|
|
2159
|
+
</div>
|
|
2160
|
+
<div class="tags">
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
</div><table class="source_code">
|
|
2164
|
+
<tr>
|
|
2165
|
+
<td>
|
|
2166
|
+
<pre class="lines">
|
|
2167
|
+
|
|
2168
|
+
|
|
2169
|
+
350
|
|
2170
|
+
351
|
|
2171
|
+
352
|
|
2172
|
+
353
|
|
2173
|
+
354
|
|
2174
|
+
355
|
|
2175
|
+
356
|
|
2176
|
+
357
|
|
2177
|
+
358
|
|
2178
|
+
359
|
|
2179
|
+
360
|
|
2180
|
+
361
|
|
2181
|
+
362
|
|
2182
|
+
363
|
|
2183
|
+
364
|
|
2184
|
+
365
|
|
2185
|
+
366
|
|
2186
|
+
367
|
|
2187
|
+
368
|
|
2188
|
+
369
|
|
2189
|
+
370
|
|
2190
|
+
371
|
|
2191
|
+
372
|
|
2192
|
+
373
|
|
2193
|
+
374
|
|
2194
|
+
375
|
|
2195
|
+
376
|
|
2196
|
+
377
|
|
2197
|
+
378
|
|
2198
|
+
379
|
|
2199
|
+
380
|
|
2200
|
+
381</pre>
|
|
2201
|
+
</td>
|
|
2202
|
+
<td>
|
|
2203
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 350</span>
|
|
2204
|
+
|
|
2205
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_set_at_counter identifier id'>set_at_counter</span><span class='lparen token'>(</span><span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2206
|
+
|
|
2207
|
+
<span class='rubyid_begin begin kw'>begin</span>
|
|
2208
|
+
|
|
2209
|
+
<span class='rubyid_case case kw'>case</span> <span class='rubyid_@type ivar id'>@type</span>
|
|
2210
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"boolean"</span>
|
|
2211
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setBoolean identifier id'>setBoolean</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2212
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"byte"</span>
|
|
2213
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setByte identifier id'>setByte</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2214
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"char"</span>
|
|
2215
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setChar identifier id'>setChar</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2216
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"short"</span>
|
|
2217
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setShort identifier id'>setShort</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2218
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"unsigned"</span>
|
|
2219
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setUnsigned identifier id'>setUnsigned</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2220
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"int"</span>
|
|
2221
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setInt identifier id'>setInt</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2222
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"long"</span>
|
|
2223
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setLong identifier id'>setLong</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2224
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"float"</span>
|
|
2225
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setFloat identifier id'>setFloat</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2226
|
+
<span class='rubyid_when when kw'>when</span> <span class='string val'>"double"</span>
|
|
2227
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setDouble identifier id'>setDouble</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2228
|
+
<span class='rubyid_else else kw'>else</span>
|
|
2229
|
+
<span class='rubyid_@mdarray ivar id'>@mdarray</span><span class='dot token'>.</span><span class='rubyid_nc_array identifier id'>nc_array</span><span class='dot token'>.</span><span class='rubyid_setObject identifier id'>setObject</span><span class='lparen token'>(</span><span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='comma token'>,</span> <span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2230
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2231
|
+
|
|
2232
|
+
<span class='rubyid_rescue rescue kw'>rescue</span> <span class='rubyid_ClassCastException constant id'>ClassCastException</span>
|
|
2233
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='string val'>"Cannot cast element to array type"</span>
|
|
2234
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2235
|
+
|
|
2236
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2237
|
+
</pre>
|
|
2238
|
+
</td>
|
|
2239
|
+
</tr>
|
|
2240
|
+
</table>
|
|
2241
|
+
</div>
|
|
2242
|
+
|
|
2243
|
+
<div class="method_details ">
|
|
2244
|
+
<h3 class="signature " id="set_counter-instance_method">
|
|
2245
|
+
|
|
2246
|
+
- (<tt>Object</tt>) <strong>set_counter</strong>(counter)
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
|
|
2250
|
+
|
|
2251
|
+
|
|
2252
|
+
</h3><div class="docstring">
|
|
2253
|
+
<div class="discussion">
|
|
2254
|
+
<hr style="height: 10px">
|
|
2255
|
+
|
|
2256
|
+
<p>Sets this index to point to the given counter. If given counter has
|
|
2257
|
+
negative values then convert them to positive values, making sure that the
|
|
2258
|
+
counter respects the shape constraints. The given counter is a list of
|
|
2259
|
+
elements as (2, 3, 3) and not and array.</p>
|
|
2260
|
+
<hr style="height: 10px">
|
|
2261
|
+
|
|
2262
|
+
|
|
2263
|
+
</div>
|
|
2264
|
+
</div>
|
|
2265
|
+
<div class="tags">
|
|
2266
|
+
|
|
2267
|
+
|
|
2268
|
+
</div><table class="source_code">
|
|
2269
|
+
<tr>
|
|
2270
|
+
<td>
|
|
2271
|
+
<pre class="lines">
|
|
2272
|
+
|
|
2273
|
+
|
|
2274
|
+
338
|
|
2275
|
+
339
|
|
2276
|
+
340
|
|
2277
|
+
341
|
|
2278
|
+
342
|
|
2279
|
+
343</pre>
|
|
2280
|
+
</td>
|
|
2281
|
+
<td>
|
|
2282
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 338</span>
|
|
2283
|
+
|
|
2284
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_set_counter identifier id'>set_counter</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
2285
|
+
|
|
2286
|
+
<span class='rubyid_counter identifier id'>counter</span> <span class='assign token'>=</span> <span class='rubyid_reshape identifier id'>reshape</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
2287
|
+
<span class='rubyid_set_counter_fast identifier id'>set_counter_fast</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='lbrack token'>[</span><span class='integer val'>1</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
|
|
2288
|
+
|
|
2289
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2290
|
+
</pre>
|
|
2291
|
+
</td>
|
|
2292
|
+
</tr>
|
|
2293
|
+
</table>
|
|
2294
|
+
</div>
|
|
2295
|
+
|
|
2296
|
+
<div class="method_details ">
|
|
2297
|
+
<h3 class="signature " id="set_counter_fast-instance_method">
|
|
2298
|
+
|
|
2299
|
+
- (<tt>Object</tt>) <strong>set_counter_fast</strong>(counter)
|
|
2300
|
+
|
|
2301
|
+
|
|
2302
|
+
|
|
2303
|
+
|
|
2304
|
+
|
|
2305
|
+
</h3><div class="docstring">
|
|
2306
|
+
<div class="discussion">
|
|
2307
|
+
<hr style="height: 10px">
|
|
2308
|
+
|
|
2309
|
+
<p>Sets this index to point to the given counter. assumes that the counter
|
|
2310
|
+
respects the shape constraints.</p>
|
|
2311
|
+
<hr style="height: 10px">
|
|
2312
|
+
|
|
2313
|
+
|
|
2314
|
+
</div>
|
|
2315
|
+
</div>
|
|
2316
|
+
<div class="tags">
|
|
2317
|
+
|
|
2318
|
+
|
|
2319
|
+
</div><table class="source_code">
|
|
2320
|
+
<tr>
|
|
2321
|
+
<td>
|
|
2322
|
+
<pre class="lines">
|
|
2323
|
+
|
|
2324
|
+
|
|
2325
|
+
321
|
|
2326
|
+
322
|
|
2327
|
+
323
|
|
2328
|
+
324
|
|
2329
|
+
325
|
|
2330
|
+
326
|
|
2331
|
+
327
|
|
2332
|
+
328
|
|
2333
|
+
329</pre>
|
|
2334
|
+
</td>
|
|
2335
|
+
<td>
|
|
2336
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 321</span>
|
|
2337
|
+
|
|
2338
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_set_counter_fast identifier id'>set_counter_fast</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
2339
|
+
|
|
2340
|
+
<span class='rubyid_begin begin kw'>begin</span>
|
|
2341
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set identifier id'>set</span><span class='lparen token'>(</span><span class='rubyid_counter identifier id'>counter</span><span class='dot token'>.</span><span class='rubyid_to_java identifier id'>to_java</span> <span class='symbol val'>:int</span><span class='rparen token'>)</span>
|
|
2342
|
+
<span class='rubyid_rescue rescue kw'>rescue</span> <span class='rubyid_java identifier id'>java</span><span class='dot token'>.</span><span class='rubyid_lang identifier id'>lang</span><span class='dot token'>.</span><span class='rubyid_ArrayIndexOutOfBoundsException constant id'>ArrayIndexOutOfBoundsException</span>
|
|
2343
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='rubyid_RangeError constant id'>RangeError</span><span class='comma token'>,</span> <span class='dstring node'>"Invalid counter: #{counter}"</span>
|
|
2344
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2345
|
+
|
|
2346
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2347
|
+
</pre>
|
|
2348
|
+
</td>
|
|
2349
|
+
</tr>
|
|
2350
|
+
</table>
|
|
2351
|
+
</div>
|
|
2352
|
+
|
|
2353
|
+
<div class="method_details ">
|
|
2354
|
+
<h3 class="signature " id="set_current-instance_method">
|
|
2355
|
+
|
|
2356
|
+
- (<tt>Object</tt>) <strong>set_current</strong>(value)
|
|
2357
|
+
|
|
2358
|
+
|
|
2359
|
+
|
|
2360
|
+
|
|
2361
|
+
|
|
2362
|
+
</h3><div class="docstring">
|
|
2363
|
+
<div class="discussion">
|
|
2364
|
+
<hr style="height: 10px">
|
|
2365
|
+
|
|
2366
|
+
<p>Sets value of current counter. Can be done fast, as the current counter is
|
|
2367
|
+
always in its basic shape.</p>
|
|
2368
|
+
<hr style="height: 10px">
|
|
2369
|
+
|
|
2370
|
+
|
|
2371
|
+
</div>
|
|
2372
|
+
</div>
|
|
2373
|
+
<div class="tags">
|
|
2374
|
+
|
|
2375
|
+
|
|
2376
|
+
</div><table class="source_code">
|
|
2377
|
+
<tr>
|
|
2378
|
+
<td>
|
|
2379
|
+
<pre class="lines">
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
215
|
|
2383
|
+
216
|
|
2384
|
+
217
|
|
2385
|
+
218</pre>
|
|
2386
|
+
</td>
|
|
2387
|
+
<td>
|
|
2388
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 215</span>
|
|
2389
|
+
|
|
2390
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_set_current identifier id'>set_current</span><span class='lparen token'>(</span><span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2391
|
+
<span class='rubyid_set_counter_fast identifier id'>set_counter_fast</span><span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_counter identifier id'>counter</span><span class='rparen token'>)</span>
|
|
2392
|
+
<span class='rubyid_set_at_counter identifier id'>set_at_counter</span><span class='lparen token'>(</span><span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
|
|
2393
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2394
|
+
</pre>
|
|
2395
|
+
</td>
|
|
2396
|
+
</tr>
|
|
2397
|
+
</table>
|
|
2398
|
+
</div>
|
|
2399
|
+
|
|
2400
|
+
<div class="method_details ">
|
|
2401
|
+
<h3 class="signature " id="set_finish-instance_method">
|
|
2402
|
+
|
|
2403
|
+
- (<tt>Object</tt>) <strong>set_finish</strong>(finish)
|
|
2404
|
+
|
|
2405
|
+
|
|
2406
|
+
|
|
2407
|
+
|
|
2408
|
+
|
|
2409
|
+
</h3><div class="docstring">
|
|
2410
|
+
<div class="discussion">
|
|
2411
|
+
<hr style="height: 10px">
|
|
2412
|
+
|
|
2413
|
+
<p>Sets the finishing position of the index</p>
|
|
2414
|
+
<hr style="height: 10px">
|
|
2415
|
+
|
|
2416
|
+
|
|
2417
|
+
</div>
|
|
2418
|
+
</div>
|
|
2419
|
+
<div class="tags">
|
|
2420
|
+
|
|
2421
|
+
|
|
2422
|
+
</div><table class="source_code">
|
|
2423
|
+
<tr>
|
|
2424
|
+
<td>
|
|
2425
|
+
<pre class="lines">
|
|
2426
|
+
|
|
2427
|
+
|
|
2428
|
+
95
|
|
2429
|
+
96
|
|
2430
|
+
97
|
|
2431
|
+
98
|
|
2432
|
+
99
|
|
2433
|
+
100
|
|
2434
|
+
101
|
|
2435
|
+
102
|
|
2436
|
+
103
|
|
2437
|
+
104</pre>
|
|
2438
|
+
</td>
|
|
2439
|
+
<td>
|
|
2440
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 95</span>
|
|
2441
|
+
|
|
2442
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_set_finish identifier id'>set_finish</span><span class='lparen token'>(</span><span class='rubyid_finish identifier id'>finish</span><span class='rparen token'>)</span>
|
|
2443
|
+
|
|
2444
|
+
<span class='rubyid_finish identifier id'>finish</span> <span class='assign token'>=</span> <span class='rubyid_reshape identifier id'>reshape</span><span class='lparen token'>(</span><span class='rubyid_finish identifier id'>finish</span><span class='rparen token'>)</span>
|
|
2445
|
+
<span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_finish identifier id'>finish</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
|
|
2446
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='string val'>"Cannot set index finish position to an array section"</span>
|
|
2447
|
+
<span class='rubyid_else else kw'>else</span>
|
|
2448
|
+
<span class='rubyid_@finish ivar id'>@finish</span> <span class='assign token'>=</span> <span class='rubyid_finish identifier id'>finish</span><span class='lbrack token'>[</span><span class='integer val'>1</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_reverse identifier id'>reverse</span>
|
|
2449
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2450
|
+
|
|
2451
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2452
|
+
</pre>
|
|
2453
|
+
</td>
|
|
2454
|
+
</tr>
|
|
2455
|
+
</table>
|
|
2456
|
+
</div>
|
|
2457
|
+
|
|
2458
|
+
<div class="method_details ">
|
|
2459
|
+
<h3 class="signature " id="set_i-instance_method">
|
|
2460
|
+
|
|
2461
|
+
- (<tt>Object</tt>) <strong>set_i</strong>(dim, index)
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
|
|
2465
|
+
|
|
2466
|
+
|
|
2467
|
+
</h3><div class="docstring">
|
|
2468
|
+
<div class="discussion">
|
|
2469
|
+
<hr style="height: 10px">
|
|
2470
|
+
<hr style="height: 10px">
|
|
2471
|
+
|
|
2472
|
+
|
|
2473
|
+
</div>
|
|
2474
|
+
</div>
|
|
2475
|
+
<div class="tags">
|
|
2476
|
+
|
|
2477
|
+
|
|
2478
|
+
</div><table class="source_code">
|
|
2479
|
+
<tr>
|
|
2480
|
+
<td>
|
|
2481
|
+
<pre class="lines">
|
|
2482
|
+
|
|
2483
|
+
|
|
2484
|
+
418
|
|
2485
|
+
419
|
|
2486
|
+
420
|
|
2487
|
+
421
|
|
2488
|
+
422
|
|
2489
|
+
423
|
|
2490
|
+
424
|
|
2491
|
+
425
|
|
2492
|
+
426
|
|
2493
|
+
427
|
|
2494
|
+
428
|
|
2495
|
+
429
|
|
2496
|
+
430
|
|
2497
|
+
431
|
|
2498
|
+
432
|
|
2499
|
+
433
|
|
2500
|
+
434
|
|
2501
|
+
435
|
|
2502
|
+
436
|
|
2503
|
+
437
|
|
2504
|
+
438
|
|
2505
|
+
439
|
|
2506
|
+
440
|
|
2507
|
+
441</pre>
|
|
2508
|
+
</td>
|
|
2509
|
+
<td>
|
|
2510
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 418</span>
|
|
2511
|
+
|
|
2512
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_set_i identifier id'>set_i</span><span class='lparen token'>(</span><span class='rubyid_dim identifier id'>dim</span><span class='comma token'>,</span> <span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2513
|
+
|
|
2514
|
+
<span class='rubyid_index identifier id'>index</span> <span class='assign token'>=</span> <span class='rubyid_reshape identifier id'>reshape</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2515
|
+
|
|
2516
|
+
<span class='rubyid_case case kw'>case</span> <span class='rubyid_dim identifier id'>dim</span>
|
|
2517
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>0</span>
|
|
2518
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set0 identifier id'>set0</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2519
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>1</span>
|
|
2520
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set1 identifier id'>set1</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2521
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>2</span>
|
|
2522
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set2 identifier id'>set2</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2523
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>3</span>
|
|
2524
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set3 identifier id'>set3</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2525
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>4</span>
|
|
2526
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set4 identifier id'>set4</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2527
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>5</span>
|
|
2528
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set5 identifier id'>set5</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2529
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>6</span>
|
|
2530
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set6 identifier id'>set6</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2531
|
+
<span class='rubyid_else else kw'>else</span>
|
|
2532
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='string val'>"Maximum allowed dimension is 6. Please, use method set to set this index"</span>
|
|
2533
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2534
|
+
|
|
2535
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2536
|
+
</pre>
|
|
2537
|
+
</td>
|
|
2538
|
+
</tr>
|
|
2539
|
+
</table>
|
|
2540
|
+
</div>
|
|
2541
|
+
|
|
2542
|
+
<div class="method_details ">
|
|
2543
|
+
<h3 class="signature " id="set_i_fast-instance_method">
|
|
2544
|
+
|
|
2545
|
+
- (<tt>Object</tt>) <strong>set_i_fast</strong>(dim, index)
|
|
2546
|
+
|
|
2547
|
+
|
|
2548
|
+
|
|
2549
|
+
|
|
2550
|
+
|
|
2551
|
+
</h3><div class="docstring">
|
|
2552
|
+
<div class="discussion">
|
|
2553
|
+
<hr style="height: 10px">
|
|
2554
|
+
<hr style="height: 10px">
|
|
2555
|
+
|
|
2556
|
+
|
|
2557
|
+
</div>
|
|
2558
|
+
</div>
|
|
2559
|
+
<div class="tags">
|
|
2560
|
+
|
|
2561
|
+
|
|
2562
|
+
</div><table class="source_code">
|
|
2563
|
+
<tr>
|
|
2564
|
+
<td>
|
|
2565
|
+
<pre class="lines">
|
|
2566
|
+
|
|
2567
|
+
|
|
2568
|
+
447
|
|
2569
|
+
448
|
|
2570
|
+
449
|
|
2571
|
+
450
|
|
2572
|
+
451
|
|
2573
|
+
452
|
|
2574
|
+
453
|
|
2575
|
+
454
|
|
2576
|
+
455
|
|
2577
|
+
456
|
|
2578
|
+
457
|
|
2579
|
+
458
|
|
2580
|
+
459
|
|
2581
|
+
460
|
|
2582
|
+
461
|
|
2583
|
+
462
|
|
2584
|
+
463
|
|
2585
|
+
464
|
|
2586
|
+
465
|
|
2587
|
+
466
|
|
2588
|
+
467
|
|
2589
|
+
468</pre>
|
|
2590
|
+
</td>
|
|
2591
|
+
<td>
|
|
2592
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 447</span>
|
|
2593
|
+
|
|
2594
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_set_i_fast identifier id'>set_i_fast</span><span class='lparen token'>(</span><span class='rubyid_dim identifier id'>dim</span><span class='comma token'>,</span> <span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2595
|
+
|
|
2596
|
+
<span class='rubyid_case case kw'>case</span> <span class='rubyid_dim identifier id'>dim</span>
|
|
2597
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>0</span>
|
|
2598
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set0 identifier id'>set0</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2599
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>1</span>
|
|
2600
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set1 identifier id'>set1</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2601
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>2</span>
|
|
2602
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set2 identifier id'>set2</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2603
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>3</span>
|
|
2604
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set3 identifier id'>set3</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2605
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>4</span>
|
|
2606
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set4 identifier id'>set4</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2607
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>5</span>
|
|
2608
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set5 identifier id'>set5</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2609
|
+
<span class='rubyid_when when kw'>when</span> <span class='integer val'>6</span>
|
|
2610
|
+
<span class='rubyid_@nc_index ivar id'>@nc_index</span><span class='dot token'>.</span><span class='rubyid_set6 identifier id'>set6</span><span class='lparen token'>(</span><span class='rubyid_index identifier id'>index</span><span class='rparen token'>)</span>
|
|
2611
|
+
<span class='rubyid_else else kw'>else</span>
|
|
2612
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='string val'>"Maximum allowed dimension is 6. Please, use method set to set this index"</span>
|
|
2613
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2614
|
+
|
|
2615
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2616
|
+
</pre>
|
|
2617
|
+
</td>
|
|
2618
|
+
</tr>
|
|
2619
|
+
</table>
|
|
2620
|
+
</div>
|
|
2621
|
+
|
|
2622
|
+
<div class="method_details ">
|
|
2623
|
+
<h3 class="signature " id="set_start-instance_method">
|
|
2624
|
+
|
|
2625
|
+
- (<tt>Object</tt>) <strong>set_start</strong>(start)
|
|
2626
|
+
|
|
2627
|
+
|
|
2628
|
+
|
|
2629
|
+
|
|
2630
|
+
|
|
2631
|
+
</h3><div class="docstring">
|
|
2632
|
+
<div class="discussion">
|
|
2633
|
+
<hr style="height: 10px">
|
|
2634
|
+
|
|
2635
|
+
<p>Sets the starting position of the index</p>
|
|
2636
|
+
<hr style="height: 10px">
|
|
2637
|
+
|
|
2638
|
+
|
|
2639
|
+
</div>
|
|
2640
|
+
</div>
|
|
2641
|
+
<div class="tags">
|
|
2642
|
+
|
|
2643
|
+
|
|
2644
|
+
</div><table class="source_code">
|
|
2645
|
+
<tr>
|
|
2646
|
+
<td>
|
|
2647
|
+
<pre class="lines">
|
|
2648
|
+
|
|
2649
|
+
|
|
2650
|
+
79
|
|
2651
|
+
80
|
|
2652
|
+
81
|
|
2653
|
+
82
|
|
2654
|
+
83
|
|
2655
|
+
84
|
|
2656
|
+
85
|
|
2657
|
+
86
|
|
2658
|
+
87
|
|
2659
|
+
88
|
|
2660
|
+
89</pre>
|
|
2661
|
+
</td>
|
|
2662
|
+
<td>
|
|
2663
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 79</span>
|
|
2664
|
+
|
|
2665
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_set_start identifier id'>set_start</span><span class='lparen token'>(</span><span class='rubyid_start identifier id'>start</span><span class='rparen token'>)</span>
|
|
2666
|
+
|
|
2667
|
+
<span class='rubyid_start identifier id'>start</span> <span class='assign token'>=</span> <span class='rubyid_reshape identifier id'>reshape</span><span class='lparen token'>(</span><span class='rubyid_start identifier id'>start</span><span class='rparen token'>)</span>
|
|
2668
|
+
<span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_start identifier id'>start</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
|
|
2669
|
+
<span class='rubyid_raise identifier id'>raise</span> <span class='string val'>"Cannot set index starting position to an array section"</span>
|
|
2670
|
+
<span class='rubyid_else else kw'>else</span>
|
|
2671
|
+
<span class='rubyid_@start ivar id'>@start</span> <span class='assign token'>=</span> <span class='rubyid_start identifier id'>start</span><span class='lbrack token'>[</span><span class='integer val'>1</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_reverse identifier id'>reverse</span>
|
|
2672
|
+
<span class='rubyid_reset_counter identifier id'>reset_counter</span>
|
|
2673
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2674
|
+
|
|
2675
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2676
|
+
</pre>
|
|
2677
|
+
</td>
|
|
2678
|
+
</tr>
|
|
2679
|
+
</table>
|
|
2680
|
+
</div>
|
|
2681
|
+
|
|
2682
|
+
<div class="method_details ">
|
|
2683
|
+
<h3 class="signature " id="walk_along_axes-instance_method">
|
|
2684
|
+
|
|
2685
|
+
- (<tt>Object</tt>) <strong>walk_along_axes</strong>
|
|
2686
|
+
|
|
2687
|
+
|
|
2688
|
+
|
|
2689
|
+
|
|
2690
|
+
|
|
2691
|
+
</h3><div class="docstring">
|
|
2692
|
+
<div class="discussion">
|
|
2693
|
+
<hr style="height: 10px">
|
|
2694
|
+
<hr style="height: 10px">
|
|
2695
|
+
|
|
2696
|
+
|
|
2697
|
+
</div>
|
|
2698
|
+
</div>
|
|
2699
|
+
<div class="tags">
|
|
2700
|
+
|
|
2701
|
+
|
|
2702
|
+
</div><table class="source_code">
|
|
2703
|
+
<tr>
|
|
2704
|
+
<td>
|
|
2705
|
+
<pre class="lines">
|
|
2706
|
+
|
|
2707
|
+
|
|
2708
|
+
254
|
|
2709
|
+
255
|
|
2710
|
+
256
|
|
2711
|
+
257
|
|
2712
|
+
258
|
|
2713
|
+
259
|
|
2714
|
+
260
|
|
2715
|
+
261
|
|
2716
|
+
262
|
|
2717
|
+
263
|
|
2718
|
+
264
|
|
2719
|
+
265
|
|
2720
|
+
266
|
|
2721
|
+
267
|
|
2722
|
+
268
|
|
2723
|
+
269
|
|
2724
|
+
270
|
|
2725
|
+
271
|
|
2726
|
+
272</pre>
|
|
2727
|
+
</td>
|
|
2728
|
+
<td>
|
|
2729
|
+
<pre class="code"><span class="info file"># File 'lib/mdarray/counter.rb', line 254</span>
|
|
2730
|
+
|
|
2731
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_walk_along_axes identifier id'>walk_along_axes</span>
|
|
2732
|
+
|
|
2733
|
+
<span class='rubyid_axes identifier id'>axes</span> <span class='assign token'>=</span> <span class='rubyid_@axes ivar id'>@axes</span><span class='dot token'>.</span><span class='rubyid_dup identifier id'>dup</span><span class='dot token'>.</span><span class='rubyid_reverse identifier id'>reverse</span>
|
|
2734
|
+
|
|
2735
|
+
<span class='rubyid_axes identifier id'>axes</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_axis identifier id'>axis</span><span class='bitor op'>|</span>
|
|
2736
|
+
|
|
2737
|
+
<span class='rubyid_index identifier id'>index</span> <span class='assign token'>=</span> <span class='rubyid_@counter ivar id'>@counter</span><span class='dot token'>.</span><span class='rubyid_size identifier id'>size</span> <span class='minus op'>-</span> <span class='rubyid_axis identifier id'>axis</span> <span class='minus op'>-</span> <span class='integer val'>1</span>
|
|
2738
|
+
<span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_@counter ivar id'>@counter</span><span class='lbrack token'>[</span><span class='rubyid_index identifier id'>index</span><span class='rbrack token'>]</span> <span class='lt op'><</span> <span class='rubyid_@shape ivar id'>@shape</span><span class='lbrack token'>[</span><span class='rubyid_axis identifier id'>axis</span><span class='rbrack token'>]</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rparen token'>)</span>
|
|
2739
|
+
<span class='rubyid_@counter ivar id'>@counter</span><span class='lbrack token'>[</span><span class='rubyid_index identifier id'>index</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_@counter ivar id'>@counter</span><span class='lbrack token'>[</span><span class='rubyid_index identifier id'>index</span><span class='rbrack token'>]</span> <span class='plus op'>+</span> <span class='integer val'>1</span>
|
|
2740
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_@counter ivar id'>@counter</span><span class='comma token'>,</span> <span class='rubyid_axis identifier id'>axis</span>
|
|
2741
|
+
<span class='rubyid_else else kw'>else</span>
|
|
2742
|
+
<span class='rubyid_@counter ivar id'>@counter</span><span class='lbrack token'>[</span><span class='rubyid_index identifier id'>index</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='integer val'>0</span>
|
|
2743
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2744
|
+
|
|
2745
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2746
|
+
|
|
2747
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_nil nil kw'>nil</span>
|
|
2748
|
+
|
|
2749
|
+
<span class='rubyid_end end kw'>end</span>
|
|
2750
|
+
</pre>
|
|
2751
|
+
</td>
|
|
2752
|
+
</tr>
|
|
2753
|
+
</table>
|
|
2754
|
+
</div>
|
|
2755
|
+
|
|
2756
|
+
</div>
|
|
2757
|
+
|
|
2758
|
+
</div>
|
|
2759
|
+
|
|
2760
|
+
<div id="footer">
|
|
2761
|
+
Generated on Thu May 16 12:48:38 2013 by
|
|
2762
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2763
|
+
0.8.5.2 (ruby-1.9.3).
|
|
2764
|
+
</div>
|
|
2765
|
+
|
|
2766
|
+
</body>
|
|
2767
|
+
</html>
|