cartesian 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Manifest.txt +13 -35
- data/Rakefile +19 -3
- data/{lib → etc}/recursive.rb +0 -0
- data/index.html +7 -0
- data/lib/cartesian.rb +1 -1
- data/script/txt2html +4 -2
- data/website/doc/Array.html +172 -0
- data/website/doc/Cartesian.html +638 -0
- data/website/doc/CartesianIterator.html +672 -0
- data/website/doc/Enumerable.html +158 -0
- data/website/doc/GridSearch.html +292 -0
- data/website/doc/Iterable.html +306 -0
- data/website/doc/README_rdoc.html +220 -0
- data/website/doc/created.rid +4 -4
- data/website/doc/lib/cartesian_iterator_rb.html +52 -0
- data/website/doc/lib/cartesian_rb.html +56 -0
- data/website/doc/lib/grid_search_rb.html +52 -0
- data/website/doc/rdoc.css +706 -0
- data/website/index.html +3 -3
- data/website/template.html.erb +1 -1
- metadata +15 -37
- data/website/doc/classes/Array.html +0 -128
- data/website/doc/classes/Cartesian.html +0 -398
- data/website/doc/classes/Cartesian.src/M000020.html +0 -18
- data/website/doc/classes/Cartesian.src/M000021.html +0 -18
- data/website/doc/classes/Cartesian.src/M000022.html +0 -18
- data/website/doc/classes/Cartesian.src/M000023.html +0 -23
- data/website/doc/classes/Cartesian.src/M000026.html +0 -23
- data/website/doc/classes/Cartesian.src/M000027.html +0 -30
- data/website/doc/classes/CartesianIterator.html +0 -326
- data/website/doc/classes/CartesianIterator.src/M000001.html +0 -21
- data/website/doc/classes/CartesianIterator.src/M000002.html +0 -18
- data/website/doc/classes/CartesianIterator.src/M000003.html +0 -21
- data/website/doc/classes/CartesianIterator.src/M000005.html +0 -20
- data/website/doc/classes/CartesianIterator.src/M000008.html +0 -20
- data/website/doc/classes/CartesianIterator.src/M000009.html +0 -19
- data/website/doc/classes/CartesianIterator.src/M000012.html +0 -19
- data/website/doc/classes/CartesianIterator.src/M000013.html +0 -39
- data/website/doc/classes/Enumerable.html +0 -112
- data/website/doc/classes/GridSearch.html +0 -160
- data/website/doc/classes/GridSearch.src/M000014.html +0 -18
- data/website/doc/classes/GridSearch.src/M000015.html +0 -18
- data/website/doc/classes/Iterable.html +0 -176
- data/website/doc/classes/Iterable.src/M000016.html +0 -19
- data/website/doc/classes/Iterable.src/M000017.html +0 -19
- data/website/doc/classes/Iterable.src/M000018.html +0 -18
- data/website/doc/classes/Iterable.src/M000019.html +0 -18
- data/website/doc/classes/Range.html +0 -118
- data/website/doc/files/cartesian_iterator_rb.html +0 -101
- data/website/doc/files/cartesian_rb.html +0 -108
- data/website/doc/files/grid_search_rb.html +0 -101
- data/website/doc/fr_class_index.html +0 -33
- data/website/doc/fr_file_index.html +0 -29
- data/website/doc/fr_method_index.html +0 -54
- data/website/doc/rdoc-style.css +0 -208
@@ -0,0 +1,672 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: CartesianIterator</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="class">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="./index.html">Home</a>
|
29
|
+
<a href="./index.html#classes">Classes</a>
|
30
|
+
<a href="./index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="./lib/cartesian_iterator_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/cartesian_iterator.rb">lib/cartesian_iterator.rb</a></li>
|
43
|
+
|
44
|
+
</ul>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div id="class-metadata">
|
52
|
+
|
53
|
+
<!-- Parent Class -->
|
54
|
+
|
55
|
+
<div id="parent-class-section" class="section">
|
56
|
+
<h3 class="section-header">Parent</h3>
|
57
|
+
|
58
|
+
<p class="link">Object</p>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Namespace Contents -->
|
64
|
+
|
65
|
+
|
66
|
+
<!-- Method Quickref -->
|
67
|
+
|
68
|
+
<div id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
<li><a href="#method-c-new">::new</a></li>
|
73
|
+
|
74
|
+
<li><a href="#method-i-%3D%3D">#==</a></li>
|
75
|
+
|
76
|
+
<li><a href="#method-i-dup">#dup</a></li>
|
77
|
+
|
78
|
+
<li><a href="#method-i-each">#each</a></li>
|
79
|
+
|
80
|
+
<li><a href="#method-i-equal">#equal</a></li>
|
81
|
+
|
82
|
+
<li><a href="#method-i-left_product">#left_product</a></li>
|
83
|
+
|
84
|
+
<li><a href="#method-i-left_product%21">#left_product!</a></li>
|
85
|
+
|
86
|
+
<li><a href="#method-i-product">#product</a></li>
|
87
|
+
|
88
|
+
<li><a href="#method-i-product%21">#product!</a></li>
|
89
|
+
|
90
|
+
<li><a href="#method-i-right_product">#right_product</a></li>
|
91
|
+
|
92
|
+
<li><a href="#method-i-right_product%21">#right_product!</a></li>
|
93
|
+
|
94
|
+
<li><a href="#method-i-x">#x</a></li>
|
95
|
+
|
96
|
+
<li><a href="#method-i-x%21">#x!</a></li>
|
97
|
+
|
98
|
+
</ul>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
<!-- Included Modules -->
|
103
|
+
|
104
|
+
<div id="includes-section" class="section">
|
105
|
+
<h3 class="section-header">Included Modules</h3>
|
106
|
+
<ul class="link-list">
|
107
|
+
|
108
|
+
|
109
|
+
<li><a class="include" href="Enumerable.html">Enumerable</a></li>
|
110
|
+
|
111
|
+
|
112
|
+
</ul>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div id="project-metadata">
|
118
|
+
|
119
|
+
|
120
|
+
<div id="fileindex-section" class="section project-section">
|
121
|
+
<h3 class="section-header">Files</h3>
|
122
|
+
<ul>
|
123
|
+
|
124
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
125
|
+
|
126
|
+
</ul>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
|
130
|
+
<div id="classindex-section" class="section project-section">
|
131
|
+
<h3 class="section-header">Class Index
|
132
|
+
<span class="search-toggle"><img src="./images/find.png"
|
133
|
+
height="16" width="16" alt="[+]"
|
134
|
+
title="show/hide quicksearch" /></span></h3>
|
135
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
136
|
+
<fieldset>
|
137
|
+
<legend>Quicksearch</legend>
|
138
|
+
<input type="text" name="quicksearch" value=""
|
139
|
+
class="quicksearch-field" />
|
140
|
+
</fieldset>
|
141
|
+
</form>
|
142
|
+
|
143
|
+
<ul class="link-list">
|
144
|
+
|
145
|
+
<li><a href="./Array.html">Array</a></li>
|
146
|
+
|
147
|
+
<li><a href="./Cartesian.html">Cartesian</a></li>
|
148
|
+
|
149
|
+
<li><a href="./CartesianIterator.html">CartesianIterator</a></li>
|
150
|
+
|
151
|
+
<li><a href="./Enumerable.html">Enumerable</a></li>
|
152
|
+
|
153
|
+
<li><a href="./GridSearch.html">GridSearch</a></li>
|
154
|
+
|
155
|
+
<li><a href="./Iterable.html">Iterable</a></li>
|
156
|
+
|
157
|
+
</ul>
|
158
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div id="documentation">
|
166
|
+
<h1 class="class">CartesianIterator</h1>
|
167
|
+
|
168
|
+
<div id="description">
|
169
|
+
|
170
|
+
</div>
|
171
|
+
|
172
|
+
<!-- Constants -->
|
173
|
+
|
174
|
+
|
175
|
+
<!-- Attributes -->
|
176
|
+
|
177
|
+
|
178
|
+
<!-- Methods -->
|
179
|
+
|
180
|
+
<div id="public-class-method-details" class="method-section section">
|
181
|
+
<h3 class="section-header">Public Class Methods</h3>
|
182
|
+
|
183
|
+
|
184
|
+
<div id="new-method" class="method-detail ">
|
185
|
+
<a name="method-c-new"></a>
|
186
|
+
|
187
|
+
<div class="method-heading">
|
188
|
+
|
189
|
+
<span class="method-name">new</span><span
|
190
|
+
class="method-args">(foo, bar)</span>
|
191
|
+
<span class="method-click-advice">click to toggle source</span>
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div class="method-description">
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
<div class="method-source-code"
|
202
|
+
id="new-source">
|
203
|
+
<pre>
|
204
|
+
<span class="ruby-comment cmt"># File lib/cartesian_iterator.rb, line 3</span>
|
205
|
+
3: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">foo</span>, <span class="ruby-identifier">bar</span>)
|
206
|
+
4: <span class="ruby-ivar">@lists</span> = []
|
207
|
+
5: <span class="ruby-ivar">@tot_iter</span> = <span class="ruby-value">1</span>
|
208
|
+
6: <span class="ruby-identifier">product!</span>(<span class="ruby-identifier">foo</span>)
|
209
|
+
7: <span class="ruby-identifier">product!</span>(<span class="ruby-identifier">bar</span>)
|
210
|
+
8: <span class="ruby-keyword kw">end</span></pre>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
</div>
|
219
|
+
|
220
|
+
|
221
|
+
</div>
|
222
|
+
|
223
|
+
<div id="public-instance-method-details" class="method-section section">
|
224
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
225
|
+
|
226
|
+
|
227
|
+
<div id="--method" class="method-detail method-alias">
|
228
|
+
<a name="method-i-%3D%3D"></a>
|
229
|
+
|
230
|
+
<div class="method-heading">
|
231
|
+
|
232
|
+
<span class="method-name">==</span><span
|
233
|
+
class="method-args">(other)</span>
|
234
|
+
<span class="method-click-advice">click to toggle source</span>
|
235
|
+
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div class="method-description">
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<div class="aliases">
|
250
|
+
Alias for: <a href="CartesianIterator.html#method-i-equal">equal</a>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
|
256
|
+
<div id="dup-method" class="method-detail ">
|
257
|
+
<a name="method-i-dup"></a>
|
258
|
+
|
259
|
+
<div class="method-heading">
|
260
|
+
|
261
|
+
<span class="method-name">dup</span><span
|
262
|
+
class="method-args">()</span>
|
263
|
+
<span class="method-click-advice">click to toggle source</span>
|
264
|
+
|
265
|
+
</div>
|
266
|
+
|
267
|
+
<div class="method-description">
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
<div class="method-source-code"
|
274
|
+
id="dup-source">
|
275
|
+
<pre>
|
276
|
+
<span class="ruby-comment cmt"># File lib/cartesian_iterator.rb, line 10</span>
|
277
|
+
10: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dup</span>
|
278
|
+
11: <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-keyword kw">self</span>))
|
279
|
+
12: <span class="ruby-keyword kw">end</span></pre>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
</div>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
|
290
|
+
<div id="each-method" class="method-detail ">
|
291
|
+
<a name="method-i-each"></a>
|
292
|
+
|
293
|
+
<div class="method-heading">
|
294
|
+
|
295
|
+
<span class="method-name">each</span><span
|
296
|
+
class="method-args">()</span>
|
297
|
+
<span class="method-click-advice">click to toggle source</span>
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
<div class="method-description">
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
<div class="method-source-code"
|
308
|
+
id="each-source">
|
309
|
+
<pre>
|
310
|
+
<span class="ruby-comment cmt"># File lib/cartesian_iterator.rb, line 48</span>
|
311
|
+
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>
|
312
|
+
49: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@tot_iter</span> <span class="ruby-operator"><</span> <span class="ruby-value">1</span>
|
313
|
+
50:
|
314
|
+
51: <span class="ruby-identifier">elems</span> = []
|
315
|
+
52: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">list</span> <span class="ruby-keyword kw">in</span> <span class="ruby-ivar">@lists</span>
|
316
|
+
53: <span class="ruby-identifier">elems</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">restart_and_raw_next</span>
|
317
|
+
54: <span class="ruby-keyword kw">end</span>
|
318
|
+
55: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_VERSION</span> <span class="ruby-operator"><=</span> <span class="ruby-value str">'1.9.1'</span>; <span class="ruby-keyword kw">yield</span>(*<span class="ruby-identifier">elems</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> }); <span class="ruby-keyword kw">else</span>; <span class="ruby-keyword kw">yield</span>(*<span class="ruby-identifier">elems</span>); <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># Yeah, v.map{|x|x} should be equal to v, but strangely it is NOT in Ruby versions prior to 1.9.2.</span>
|
319
|
+
56:
|
320
|
+
57: <span class="ruby-identifier">last_list_index</span> = <span class="ruby-ivar">@lists</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>
|
321
|
+
58: <span class="ruby-identifier">n</span> = <span class="ruby-identifier">last_list_index</span>
|
322
|
+
59: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
|
323
|
+
60: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">elems</span>[<span class="ruby-identifier">n</span>] = <span class="ruby-ivar">@lists</span>[<span class="ruby-identifier">n</span>].<span class="ruby-identifier">raw_next</span>
|
324
|
+
61: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_VERSION</span> <span class="ruby-operator"><=</span> <span class="ruby-value str">'1.9.1'</span>; <span class="ruby-keyword kw">yield</span>(*<span class="ruby-identifier">elems</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> }); <span class="ruby-keyword kw">else</span>; <span class="ruby-keyword kw">yield</span>(*<span class="ruby-identifier">elems</span>); <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># See previous comment.</span>
|
325
|
+
62: <span class="ruby-identifier">n</span> = <span class="ruby-identifier">last_list_index</span>
|
326
|
+
63: <span class="ruby-keyword kw">next</span>
|
327
|
+
64: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
328
|
+
65: <span class="ruby-identifier">elems</span>[<span class="ruby-identifier">n</span>] = <span class="ruby-ivar">@lists</span>[<span class="ruby-identifier">n</span>].<span class="ruby-identifier">restart_and_raw_next</span>
|
329
|
+
66: <span class="ruby-identifier">n</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
|
330
|
+
67: <span class="ruby-keyword kw">else</span>
|
331
|
+
68: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
|
332
|
+
69: <span class="ruby-keyword kw">end</span>
|
333
|
+
70: <span class="ruby-keyword kw">end</span>
|
334
|
+
71: <span class="ruby-keyword kw">end</span></pre>
|
335
|
+
</div>
|
336
|
+
|
337
|
+
</div>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
</div>
|
343
|
+
|
344
|
+
|
345
|
+
<div id="equal-method" class="method-detail ">
|
346
|
+
<a name="method-i-equal"></a>
|
347
|
+
|
348
|
+
<div class="method-heading">
|
349
|
+
|
350
|
+
<span class="method-name">equal</span><span
|
351
|
+
class="method-args">(other)</span>
|
352
|
+
<span class="method-click-advice">click to toggle source</span>
|
353
|
+
|
354
|
+
</div>
|
355
|
+
|
356
|
+
<div class="method-description">
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
<div class="method-source-code"
|
363
|
+
id="equal-source">
|
364
|
+
<pre>
|
365
|
+
<span class="ruby-comment cmt"># File lib/cartesian_iterator.rb, line 14</span>
|
366
|
+
14: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">equal</span>(<span class="ruby-identifier">other</span>)
|
367
|
+
15: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var_name</span><span class="ruby-operator">|</span>
|
368
|
+
16: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">var_name</span>) <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">var_name</span>)
|
369
|
+
17: <span class="ruby-keyword kw">end</span>
|
370
|
+
18: <span class="ruby-keyword kw">true</span>
|
371
|
+
19: <span class="ruby-keyword kw">end</span></pre>
|
372
|
+
</div>
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
|
377
|
+
<div class="aliases">
|
378
|
+
Also aliased as: <a href="CartesianIterator.html#method-i-%3D%3D">==</a>
|
379
|
+
</div>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
</div>
|
384
|
+
|
385
|
+
|
386
|
+
<div id="left-product-method" class="method-detail ">
|
387
|
+
<a name="method-i-left_product"></a>
|
388
|
+
|
389
|
+
<div class="method-heading">
|
390
|
+
|
391
|
+
<span class="method-name">left_product</span><span
|
392
|
+
class="method-args">(other)</span>
|
393
|
+
<span class="method-click-advice">click to toggle source</span>
|
394
|
+
|
395
|
+
</div>
|
396
|
+
|
397
|
+
<div class="method-description">
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
<div class="method-source-code"
|
404
|
+
id="left-product-source">
|
405
|
+
<pre>
|
406
|
+
<span class="ruby-comment cmt"># File lib/cartesian_iterator.rb, line 43</span>
|
407
|
+
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">left_product</span>(<span class="ruby-identifier">other</span>)
|
408
|
+
44: (<span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>).<span class="ruby-identifier">left_product!</span>(<span class="ruby-identifier">other</span>)
|
409
|
+
45: <span class="ruby-identifier">result</span>
|
410
|
+
46: <span class="ruby-keyword kw">end</span></pre>
|
411
|
+
</div>
|
412
|
+
|
413
|
+
</div>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
</div>
|
419
|
+
|
420
|
+
|
421
|
+
<div id="left-product--method" class="method-detail ">
|
422
|
+
<a name="method-i-left_product%21"></a>
|
423
|
+
|
424
|
+
<div class="method-heading">
|
425
|
+
|
426
|
+
<span class="method-name">left_product!</span><span
|
427
|
+
class="method-args">(other)</span>
|
428
|
+
<span class="method-click-advice">click to toggle source</span>
|
429
|
+
|
430
|
+
</div>
|
431
|
+
|
432
|
+
<div class="method-description">
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
<div class="method-source-code"
|
439
|
+
id="left-product--source">
|
440
|
+
<pre>
|
441
|
+
<span class="ruby-comment cmt"># File lib/cartesian_iterator.rb, line 30</span>
|
442
|
+
30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">left_product!</span>(<span class="ruby-identifier">other</span>)
|
443
|
+
31: <span class="ruby-ivar">@lists</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">dup</span>
|
444
|
+
32: <span class="ruby-ivar">@tot_iter</span> <span class="ruby-operator">*=</span> <span class="ruby-ivar">@lists</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">size</span>
|
445
|
+
33: <span class="ruby-keyword kw">self</span>
|
446
|
+
34: <span class="ruby-keyword kw">end</span></pre>
|
447
|
+
</div>
|
448
|
+
|
449
|
+
</div>
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
</div>
|
455
|
+
|
456
|
+
|
457
|
+
<div id="product-method" class="method-detail ">
|
458
|
+
<a name="method-i-product"></a>
|
459
|
+
|
460
|
+
<div class="method-heading">
|
461
|
+
|
462
|
+
<span class="method-name">product</span><span
|
463
|
+
class="method-args">(other)</span>
|
464
|
+
<span class="method-click-advice">click to toggle source</span>
|
465
|
+
|
466
|
+
</div>
|
467
|
+
|
468
|
+
<div class="method-description">
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
<div class="method-source-code"
|
475
|
+
id="product-source">
|
476
|
+
<pre>
|
477
|
+
<span class="ruby-comment cmt"># File lib/cartesian_iterator.rb, line 36</span>
|
478
|
+
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">product</span>(<span class="ruby-identifier">other</span>)
|
479
|
+
37: (<span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>).<span class="ruby-identifier">product!</span>(<span class="ruby-identifier">other</span>)
|
480
|
+
38: <span class="ruby-identifier">result</span>
|
481
|
+
39: <span class="ruby-keyword kw">end</span></pre>
|
482
|
+
</div>
|
483
|
+
|
484
|
+
</div>
|
485
|
+
|
486
|
+
|
487
|
+
<div class="aliases">
|
488
|
+
Also aliased as: <a href="CartesianIterator.html#method-i-right_product">right_product</a>, <a href="CartesianIterator.html#method-i-x">x</a>
|
489
|
+
</div>
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
</div>
|
494
|
+
|
495
|
+
|
496
|
+
<div id="product--method" class="method-detail ">
|
497
|
+
<a name="method-i-product%21"></a>
|
498
|
+
|
499
|
+
<div class="method-heading">
|
500
|
+
|
501
|
+
<span class="method-name">product!</span><span
|
502
|
+
class="method-args">(other)</span>
|
503
|
+
<span class="method-click-advice">click to toggle source</span>
|
504
|
+
|
505
|
+
</div>
|
506
|
+
|
507
|
+
<div class="method-description">
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
<div class="method-source-code"
|
514
|
+
id="product--source">
|
515
|
+
<pre>
|
516
|
+
<span class="ruby-comment cmt"># File lib/cartesian_iterator.rb, line 22</span>
|
517
|
+
22: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">product!</span>(<span class="ruby-identifier">other</span>)
|
518
|
+
23: <span class="ruby-ivar">@lists</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">dup</span>
|
519
|
+
24: <span class="ruby-ivar">@tot_iter</span> <span class="ruby-operator">*=</span> <span class="ruby-ivar">@lists</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">size</span>
|
520
|
+
25: <span class="ruby-keyword kw">self</span>
|
521
|
+
26: <span class="ruby-keyword kw">end</span></pre>
|
522
|
+
</div>
|
523
|
+
|
524
|
+
</div>
|
525
|
+
|
526
|
+
|
527
|
+
<div class="aliases">
|
528
|
+
Also aliased as: <a href="CartesianIterator.html#method-i-right_product%21">right_product!</a>, <a href="CartesianIterator.html#method-i-x%21">x!</a>
|
529
|
+
</div>
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
</div>
|
534
|
+
|
535
|
+
|
536
|
+
<div id="right-product-method" class="method-detail method-alias">
|
537
|
+
<a name="method-i-right_product"></a>
|
538
|
+
|
539
|
+
<div class="method-heading">
|
540
|
+
|
541
|
+
<span class="method-name">right_product</span><span
|
542
|
+
class="method-args">(other)</span>
|
543
|
+
<span class="method-click-advice">click to toggle source</span>
|
544
|
+
|
545
|
+
</div>
|
546
|
+
|
547
|
+
<div class="method-description">
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
</div>
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
<div class="aliases">
|
559
|
+
Alias for: <a href="CartesianIterator.html#method-i-product">product</a>
|
560
|
+
</div>
|
561
|
+
|
562
|
+
</div>
|
563
|
+
|
564
|
+
|
565
|
+
<div id="right-product--method" class="method-detail method-alias">
|
566
|
+
<a name="method-i-right_product%21"></a>
|
567
|
+
|
568
|
+
<div class="method-heading">
|
569
|
+
|
570
|
+
<span class="method-name">right_product!</span><span
|
571
|
+
class="method-args">(other)</span>
|
572
|
+
<span class="method-click-advice">click to toggle source</span>
|
573
|
+
|
574
|
+
</div>
|
575
|
+
|
576
|
+
<div class="method-description">
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
</div>
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
<div class="aliases">
|
588
|
+
Alias for: <a href="CartesianIterator.html#method-i-product%21">product!</a>
|
589
|
+
</div>
|
590
|
+
|
591
|
+
</div>
|
592
|
+
|
593
|
+
|
594
|
+
<div id="x-method" class="method-detail method-alias">
|
595
|
+
<a name="method-i-x"></a>
|
596
|
+
|
597
|
+
<div class="method-heading">
|
598
|
+
|
599
|
+
<span class="method-name">x</span><span
|
600
|
+
class="method-args">(other)</span>
|
601
|
+
<span class="method-click-advice">click to toggle source</span>
|
602
|
+
|
603
|
+
</div>
|
604
|
+
|
605
|
+
<div class="method-description">
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
</div>
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
|
616
|
+
<div class="aliases">
|
617
|
+
Alias for: <a href="CartesianIterator.html#method-i-product">product</a>
|
618
|
+
</div>
|
619
|
+
|
620
|
+
</div>
|
621
|
+
|
622
|
+
|
623
|
+
<div id="x--method" class="method-detail method-alias">
|
624
|
+
<a name="method-i-x%21"></a>
|
625
|
+
|
626
|
+
<div class="method-heading">
|
627
|
+
|
628
|
+
<span class="method-name">x!</span><span
|
629
|
+
class="method-args">(other)</span>
|
630
|
+
<span class="method-click-advice">click to toggle source</span>
|
631
|
+
|
632
|
+
</div>
|
633
|
+
|
634
|
+
<div class="method-description">
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
</div>
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
<div class="aliases">
|
646
|
+
Alias for: <a href="CartesianIterator.html#method-i-product%21">product!</a>
|
647
|
+
</div>
|
648
|
+
|
649
|
+
</div>
|
650
|
+
|
651
|
+
|
652
|
+
</div>
|
653
|
+
|
654
|
+
|
655
|
+
</div>
|
656
|
+
|
657
|
+
|
658
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
659
|
+
|
660
|
+
<p>Disabled; run with --debug to generate this.</p>
|
661
|
+
|
662
|
+
</div>
|
663
|
+
|
664
|
+
<div id="validator-badges">
|
665
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
666
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
667
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
668
|
+
</div>
|
669
|
+
|
670
|
+
</body>
|
671
|
+
</html>
|
672
|
+
|