abanalyzer 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.rdoc +28 -0
- data/docs/ABAnalyzer.html +336 -0
- data/docs/ABAnalyzer/ABTest.html +559 -0
- data/docs/ABAnalyzer/InsufficientDataError.html +152 -0
- data/docs/ABAnalyzer/Matrix.html +547 -0
- data/docs/ABAnalyzer/MatrixFormatError.html +152 -0
- data/docs/README_rdoc.html +237 -0
- data/docs/created.rid +8 -0
- data/docs/index.html +108 -0
- data/docs/lib/abanalyzer/abtest_rb.html +54 -0
- data/docs/lib/abanalyzer/exceptions_rb.html +52 -0
- data/docs/lib/abanalyzer/matrix_rb.html +52 -0
- data/docs/lib/abanalyzer/sample_rb.html +54 -0
- data/docs/lib/abanalyzer/version_rb.html +52 -0
- data/docs/lib/abanalyzer_rb.html +62 -0
- data/docs/rdoc.css +706 -0
- data/lib/abanalyzer/sample.rb +5 -4
- data/lib/abanalyzer/version.rb +1 -1
- metadata +24 -3
@@ -0,0 +1,152 @@
|
|
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: ABAnalyzer::InsufficientDataError</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/abanalyzer/exceptions_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/abanalyzer/exceptions.rb">lib/abanalyzer/exceptions.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">RuntimeError</p>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Namespace Contents -->
|
64
|
+
|
65
|
+
|
66
|
+
<!-- Method Quickref -->
|
67
|
+
|
68
|
+
|
69
|
+
<!-- Included Modules -->
|
70
|
+
|
71
|
+
</div>
|
72
|
+
|
73
|
+
<div id="project-metadata">
|
74
|
+
|
75
|
+
|
76
|
+
<div id="fileindex-section" class="section project-section">
|
77
|
+
<h3 class="section-header">Files</h3>
|
78
|
+
<ul>
|
79
|
+
|
80
|
+
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
81
|
+
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
<div id="classindex-section" class="section project-section">
|
87
|
+
<h3 class="section-header">Class Index
|
88
|
+
<span class="search-toggle"><img src="../images/find.png"
|
89
|
+
height="16" width="16" alt="[+]"
|
90
|
+
title="show/hide quicksearch" /></span></h3>
|
91
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
92
|
+
<fieldset>
|
93
|
+
<legend>Quicksearch</legend>
|
94
|
+
<input type="text" name="quicksearch" value=""
|
95
|
+
class="quicksearch-field" />
|
96
|
+
</fieldset>
|
97
|
+
</form>
|
98
|
+
|
99
|
+
<ul class="link-list">
|
100
|
+
|
101
|
+
<li><a href="../ABAnalyzer.html">ABAnalyzer</a></li>
|
102
|
+
|
103
|
+
<li><a href="../ABAnalyzer/ABTest.html">ABAnalyzer::ABTest</a></li>
|
104
|
+
|
105
|
+
<li><a href="../ABAnalyzer/InsufficientDataError.html">ABAnalyzer::InsufficientDataError</a></li>
|
106
|
+
|
107
|
+
<li><a href="../ABAnalyzer/Matrix.html">ABAnalyzer::Matrix</a></li>
|
108
|
+
|
109
|
+
<li><a href="../ABAnalyzer/MatrixFormatError.html">ABAnalyzer::MatrixFormatError</a></li>
|
110
|
+
|
111
|
+
</ul>
|
112
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
|
119
|
+
<div id="documentation">
|
120
|
+
<h1 class="class">ABAnalyzer::InsufficientDataError</h1>
|
121
|
+
|
122
|
+
<div id="description">
|
123
|
+
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<!-- Constants -->
|
127
|
+
|
128
|
+
|
129
|
+
<!-- Attributes -->
|
130
|
+
|
131
|
+
|
132
|
+
<!-- Methods -->
|
133
|
+
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
|
138
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
139
|
+
|
140
|
+
<p>Disabled; run with --debug to generate this.</p>
|
141
|
+
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<div id="validator-badges">
|
145
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
146
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
147
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
</body>
|
151
|
+
</html>
|
152
|
+
|
@@ -0,0 +1,547 @@
|
|
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: ABAnalyzer::Matrix</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/abanalyzer/matrix_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/abanalyzer/matrix.rb">lib/abanalyzer/matrix.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-column_sum">#column_sum</a></li>
|
75
|
+
|
76
|
+
<li><a href="#method-i-each_cell">#each_cell</a></li>
|
77
|
+
|
78
|
+
<li><a href="#method-i-get">#get</a></li>
|
79
|
+
|
80
|
+
<li><a href="#method-i-get_column">#get_column</a></li>
|
81
|
+
|
82
|
+
<li><a href="#method-i-get_row">#get_row</a></li>
|
83
|
+
|
84
|
+
<li><a href="#method-i-row_sum">#row_sum</a></li>
|
85
|
+
|
86
|
+
<li><a href="#method-i-total_sum">#total_sum</a></li>
|
87
|
+
|
88
|
+
<li><a href="#method-i-validate">#validate</a></li>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
|
94
|
+
<!-- Included Modules -->
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
<div id="project-metadata">
|
99
|
+
|
100
|
+
|
101
|
+
<div id="fileindex-section" class="section project-section">
|
102
|
+
<h3 class="section-header">Files</h3>
|
103
|
+
<ul>
|
104
|
+
|
105
|
+
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
106
|
+
|
107
|
+
</ul>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
|
111
|
+
<div id="classindex-section" class="section project-section">
|
112
|
+
<h3 class="section-header">Class Index
|
113
|
+
<span class="search-toggle"><img src="../images/find.png"
|
114
|
+
height="16" width="16" alt="[+]"
|
115
|
+
title="show/hide quicksearch" /></span></h3>
|
116
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
117
|
+
<fieldset>
|
118
|
+
<legend>Quicksearch</legend>
|
119
|
+
<input type="text" name="quicksearch" value=""
|
120
|
+
class="quicksearch-field" />
|
121
|
+
</fieldset>
|
122
|
+
</form>
|
123
|
+
|
124
|
+
<ul class="link-list">
|
125
|
+
|
126
|
+
<li><a href="../ABAnalyzer.html">ABAnalyzer</a></li>
|
127
|
+
|
128
|
+
<li><a href="../ABAnalyzer/ABTest.html">ABAnalyzer::ABTest</a></li>
|
129
|
+
|
130
|
+
<li><a href="../ABAnalyzer/InsufficientDataError.html">ABAnalyzer::InsufficientDataError</a></li>
|
131
|
+
|
132
|
+
<li><a href="../ABAnalyzer/Matrix.html">ABAnalyzer::Matrix</a></li>
|
133
|
+
|
134
|
+
<li><a href="../ABAnalyzer/MatrixFormatError.html">ABAnalyzer::MatrixFormatError</a></li>
|
135
|
+
|
136
|
+
</ul>
|
137
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<div id="documentation">
|
145
|
+
<h1 class="class">ABAnalyzer::Matrix</h1>
|
146
|
+
|
147
|
+
<div id="description">
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
<!-- Constants -->
|
152
|
+
|
153
|
+
|
154
|
+
<!-- Attributes -->
|
155
|
+
|
156
|
+
<div id="attribute-method-details" class="method-section section">
|
157
|
+
<h3 class="section-header">Attributes</h3>
|
158
|
+
|
159
|
+
|
160
|
+
<div id="columns-attribute-method" class="method-detail">
|
161
|
+
<a name="columns"></a>
|
162
|
+
|
163
|
+
<div class="method-heading attribute-method-heading">
|
164
|
+
<span class="method-name">columns</span><span
|
165
|
+
class="attribute-access-type">[R]</span>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
<div class="method-description">
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div id="rows-attribute-method" class="method-detail">
|
176
|
+
<a name="rows"></a>
|
177
|
+
|
178
|
+
<div class="method-heading attribute-method-heading">
|
179
|
+
<span class="method-name">rows</span><span
|
180
|
+
class="attribute-access-type">[R]</span>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div class="method-description">
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
</div>
|
191
|
+
|
192
|
+
|
193
|
+
<!-- Methods -->
|
194
|
+
|
195
|
+
<div id="public-class-method-details" class="method-section section">
|
196
|
+
<h3 class="section-header">Public Class Methods</h3>
|
197
|
+
|
198
|
+
|
199
|
+
<div id="new-method" class="method-detail ">
|
200
|
+
<a name="method-c-new"></a>
|
201
|
+
|
202
|
+
<div class="method-heading">
|
203
|
+
|
204
|
+
<span class="method-name">new</span><span
|
205
|
+
class="method-args">(values)</span>
|
206
|
+
<span class="method-click-advice">click to toggle source</span>
|
207
|
+
|
208
|
+
</div>
|
209
|
+
|
210
|
+
<div class="method-description">
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
<div class="method-source-code"
|
217
|
+
id="new-source">
|
218
|
+
<pre>
|
219
|
+
<span class="ruby-comment cmt"># File lib/abanalyzer/matrix.rb, line 5</span>
|
220
|
+
5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">values</span>)
|
221
|
+
6: <span class="ruby-ivar">@values</span> = <span class="ruby-identifier">values</span>
|
222
|
+
7: <span class="ruby-ivar">@columns</span> = <span class="ruby-identifier">values</span>.<span class="ruby-identifier">keys</span>
|
223
|
+
8: <span class="ruby-ivar">@rows</span> = <span class="ruby-identifier">values</span>[<span class="ruby-ivar">@columns</span>.<span class="ruby-identifier">first</span>].<span class="ruby-identifier">keys</span>
|
224
|
+
9: <span class="ruby-identifier">validate</span>
|
225
|
+
10: <span class="ruby-keyword kw">end</span></pre>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
</div>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
</div>
|
234
|
+
|
235
|
+
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div id="public-instance-method-details" class="method-section section">
|
239
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
240
|
+
|
241
|
+
|
242
|
+
<div id="column-sum-method" class="method-detail ">
|
243
|
+
<a name="method-i-column_sum"></a>
|
244
|
+
|
245
|
+
<div class="method-heading">
|
246
|
+
|
247
|
+
<span class="method-name">column_sum</span><span
|
248
|
+
class="method-args">(name)</span>
|
249
|
+
<span class="method-click-advice">click to toggle source</span>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div class="method-description">
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<div class="method-source-code"
|
260
|
+
id="column-sum-source">
|
261
|
+
<pre>
|
262
|
+
<span class="ruby-comment cmt"># File lib/abanalyzer/matrix.rb, line 45</span>
|
263
|
+
45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">column_sum</span>(<span class="ruby-identifier">name</span>)
|
264
|
+
46: <span class="ruby-identifier">get_column</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">inject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span> }
|
265
|
+
47: <span class="ruby-keyword kw">end</span></pre>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
</div>
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
<div id="each-cell-method" class="method-detail ">
|
277
|
+
<a name="method-i-each_cell"></a>
|
278
|
+
|
279
|
+
<div class="method-heading">
|
280
|
+
|
281
|
+
<span class="method-name">each_cell</span><span
|
282
|
+
class="method-args">()</span>
|
283
|
+
<span class="method-click-advice">click to toggle source</span>
|
284
|
+
|
285
|
+
</div>
|
286
|
+
|
287
|
+
<div class="method-description">
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
<div class="method-source-code"
|
294
|
+
id="each-cell-source">
|
295
|
+
<pre>
|
296
|
+
<span class="ruby-comment cmt"># File lib/abanalyzer/matrix.rb, line 33</span>
|
297
|
+
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_cell</span>
|
298
|
+
34: <span class="ruby-ivar">@columns</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">colname</span><span class="ruby-operator">|</span>
|
299
|
+
35: <span class="ruby-ivar">@rows</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">rowname</span><span class="ruby-operator">|</span>
|
300
|
+
36: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">colname</span>, <span class="ruby-identifier">rowname</span>, <span class="ruby-identifier">get</span>(<span class="ruby-identifier">colname</span>, <span class="ruby-identifier">rowname</span>)
|
301
|
+
37: }
|
302
|
+
38: }
|
303
|
+
39: <span class="ruby-keyword kw">end</span></pre>
|
304
|
+
</div>
|
305
|
+
|
306
|
+
</div>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
|
314
|
+
<div id="get-method" class="method-detail ">
|
315
|
+
<a name="method-i-get"></a>
|
316
|
+
|
317
|
+
<div class="method-heading">
|
318
|
+
|
319
|
+
<span class="method-name">get</span><span
|
320
|
+
class="method-args">(colname, rowname)</span>
|
321
|
+
<span class="method-click-advice">click to toggle source</span>
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
<div class="method-description">
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
<div class="method-source-code"
|
332
|
+
id="get-source">
|
333
|
+
<pre>
|
334
|
+
<span class="ruby-comment cmt"># File lib/abanalyzer/matrix.rb, line 41</span>
|
335
|
+
41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">colname</span>, <span class="ruby-identifier">rowname</span>)
|
336
|
+
42: <span class="ruby-ivar">@values</span>[<span class="ruby-identifier">colname</span>][<span class="ruby-identifier">rowname</span>]
|
337
|
+
43: <span class="ruby-keyword kw">end</span></pre>
|
338
|
+
</div>
|
339
|
+
|
340
|
+
</div>
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
</div>
|
346
|
+
|
347
|
+
|
348
|
+
<div id="get-column-method" class="method-detail ">
|
349
|
+
<a name="method-i-get_column"></a>
|
350
|
+
|
351
|
+
<div class="method-heading">
|
352
|
+
|
353
|
+
<span class="method-name">get_column</span><span
|
354
|
+
class="method-args">(name)</span>
|
355
|
+
<span class="method-click-advice">click to toggle source</span>
|
356
|
+
|
357
|
+
</div>
|
358
|
+
|
359
|
+
<div class="method-description">
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
<div class="method-source-code"
|
366
|
+
id="get-column-source">
|
367
|
+
<pre>
|
368
|
+
<span class="ruby-comment cmt"># File lib/abanalyzer/matrix.rb, line 23</span>
|
369
|
+
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_column</span>(<span class="ruby-identifier">name</span>)
|
370
|
+
24: <span class="ruby-ivar">@values</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">values</span>
|
371
|
+
25: <span class="ruby-keyword kw">end</span></pre>
|
372
|
+
</div>
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</div>
|
380
|
+
|
381
|
+
|
382
|
+
<div id="get-row-method" class="method-detail ">
|
383
|
+
<a name="method-i-get_row"></a>
|
384
|
+
|
385
|
+
<div class="method-heading">
|
386
|
+
|
387
|
+
<span class="method-name">get_row</span><span
|
388
|
+
class="method-args">(name)</span>
|
389
|
+
<span class="method-click-advice">click to toggle source</span>
|
390
|
+
|
391
|
+
</div>
|
392
|
+
|
393
|
+
<div class="method-description">
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
<div class="method-source-code"
|
400
|
+
id="get-row-source">
|
401
|
+
<pre>
|
402
|
+
<span class="ruby-comment cmt"># File lib/abanalyzer/matrix.rb, line 27</span>
|
403
|
+
27: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_row</span>(<span class="ruby-identifier">name</span>)
|
404
|
+
28: <span class="ruby-ivar">@values</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">colname</span>, <span class="ruby-identifier">rows</span><span class="ruby-operator">|</span>
|
405
|
+
29: <span class="ruby-identifier">rows</span>[<span class="ruby-identifier">name</span>]
|
406
|
+
30: }
|
407
|
+
31: <span class="ruby-keyword kw">end</span></pre>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
</div>
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
</div>
|
416
|
+
|
417
|
+
|
418
|
+
<div id="row-sum-method" class="method-detail ">
|
419
|
+
<a name="method-i-row_sum"></a>
|
420
|
+
|
421
|
+
<div class="method-heading">
|
422
|
+
|
423
|
+
<span class="method-name">row_sum</span><span
|
424
|
+
class="method-args">(name)</span>
|
425
|
+
<span class="method-click-advice">click to toggle source</span>
|
426
|
+
|
427
|
+
</div>
|
428
|
+
|
429
|
+
<div class="method-description">
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
<div class="method-source-code"
|
436
|
+
id="row-sum-source">
|
437
|
+
<pre>
|
438
|
+
<span class="ruby-comment cmt"># File lib/abanalyzer/matrix.rb, line 49</span>
|
439
|
+
49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">row_sum</span>(<span class="ruby-identifier">name</span>)
|
440
|
+
50: <span class="ruby-identifier">get_row</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">inject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span> }
|
441
|
+
51: <span class="ruby-keyword kw">end</span></pre>
|
442
|
+
</div>
|
443
|
+
|
444
|
+
</div>
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
</div>
|
450
|
+
|
451
|
+
|
452
|
+
<div id="total-sum-method" class="method-detail ">
|
453
|
+
<a name="method-i-total_sum"></a>
|
454
|
+
|
455
|
+
<div class="method-heading">
|
456
|
+
|
457
|
+
<span class="method-name">total_sum</span><span
|
458
|
+
class="method-args">()</span>
|
459
|
+
<span class="method-click-advice">click to toggle source</span>
|
460
|
+
|
461
|
+
</div>
|
462
|
+
|
463
|
+
<div class="method-description">
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
<div class="method-source-code"
|
470
|
+
id="total-sum-source">
|
471
|
+
<pre>
|
472
|
+
<span class="ruby-comment cmt"># File lib/abanalyzer/matrix.rb, line 53</span>
|
473
|
+
53: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">total_sum</span>
|
474
|
+
54: <span class="ruby-ivar">@columns</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">col</span><span class="ruby-operator">|</span> <span class="ruby-identifier">column_sum</span>(<span class="ruby-identifier">col</span>) }.<span class="ruby-identifier">inject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span> }
|
475
|
+
55: <span class="ruby-keyword kw">end</span></pre>
|
476
|
+
</div>
|
477
|
+
|
478
|
+
</div>
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
</div>
|
484
|
+
|
485
|
+
|
486
|
+
<div id="validate-method" class="method-detail ">
|
487
|
+
<a name="method-i-validate"></a>
|
488
|
+
|
489
|
+
<div class="method-heading">
|
490
|
+
|
491
|
+
<span class="method-name">validate</span><span
|
492
|
+
class="method-args">()</span>
|
493
|
+
<span class="method-click-advice">click to toggle source</span>
|
494
|
+
|
495
|
+
</div>
|
496
|
+
|
497
|
+
<div class="method-description">
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
<div class="method-source-code"
|
504
|
+
id="validate-source">
|
505
|
+
<pre>
|
506
|
+
<span class="ruby-comment cmt"># File lib/abanalyzer/matrix.rb, line 12</span>
|
507
|
+
12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate</span>
|
508
|
+
13: <span class="ruby-ivar">@values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">colname</span>, <span class="ruby-identifier">column</span><span class="ruby-operator">|</span>
|
509
|
+
14: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">column</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_s</span> }.<span class="ruby-identifier">sort</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@rows</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_s</span> }.<span class="ruby-identifier">sort</span>
|
510
|
+
15: <span class="ruby-identifier">raise</span> <span class="ruby-constant">MatrixFormatError</span>, <span class="ruby-node">"Column #{colname} has row names that don't match the first column's."</span>
|
511
|
+
16: <span class="ruby-keyword kw">end</span>
|
512
|
+
17: }
|
513
|
+
18: <span class="ruby-identifier">coltotal</span> = <span class="ruby-ivar">@columns</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">col</span><span class="ruby-operator">|</span> <span class="ruby-identifier">column_sum</span>(<span class="ruby-identifier">col</span>) }.<span class="ruby-identifier">inject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span> }
|
514
|
+
19: <span class="ruby-identifier">rowtotal</span> = <span class="ruby-ivar">@rows</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">col</span><span class="ruby-operator">|</span> <span class="ruby-identifier">row_sum</span>(<span class="ruby-identifier">col</span>) }.<span class="ruby-identifier">inject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span><span class="ruby-operator">+</span><span class="ruby-identifier">b</span> }
|
515
|
+
20: <span class="ruby-identifier">raise</span> <span class="ruby-constant">MatrixFormatError</span>, <span class="ruby-value str">"Column sums do not equal row sums"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">coltotal</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">rowtotal</span>
|
516
|
+
21: <span class="ruby-keyword kw">end</span></pre>
|
517
|
+
</div>
|
518
|
+
|
519
|
+
</div>
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
</div>
|
525
|
+
|
526
|
+
|
527
|
+
</div>
|
528
|
+
|
529
|
+
|
530
|
+
</div>
|
531
|
+
|
532
|
+
|
533
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
534
|
+
|
535
|
+
<p>Disabled; run with --debug to generate this.</p>
|
536
|
+
|
537
|
+
</div>
|
538
|
+
|
539
|
+
<div id="validator-badges">
|
540
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
541
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
542
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
543
|
+
</div>
|
544
|
+
|
545
|
+
</body>
|
546
|
+
</html>
|
547
|
+
|