classifier 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -1
- data/Rakefile +3 -4
- data/bin/bayes.rb +1 -1
- data/bin/summarize.rb +7 -2
- data/lib/classifier/extensions/string.rb +2 -2
- data/lib/classifier/extensions/vector_serialize.rb +2 -2
- data/lib/classifier/lsi.rb +2 -2
- data/lib/classifier/lsi/content_node.rb +1 -1
- metadata +73 -159
- data/doc/classes/Array.html +0 -139
- data/doc/classes/Array.src/M000003.html +0 -18
- data/doc/classes/Classifier.html +0 -140
- data/doc/classes/Classifier/Bayes.html +0 -317
- data/doc/classes/Classifier/Bayes.src/M000038.html +0 -20
- data/doc/classes/Classifier/Bayes.src/M000039.html +0 -23
- data/doc/classes/Classifier/Bayes.src/M000040.html +0 -30
- data/doc/classes/Classifier/Bayes.src/M000041.html +0 -27
- data/doc/classes/Classifier/Bayes.src/M000042.html +0 -18
- data/doc/classes/Classifier/Bayes.src/M000043.html +0 -25
- data/doc/classes/Classifier/Bayes.src/M000044.html +0 -18
- data/doc/classes/Classifier/ContentNode.html +0 -247
- data/doc/classes/Classifier/ContentNode.src/M000046.html +0 -19
- data/doc/classes/Classifier/ContentNode.src/M000047.html +0 -18
- data/doc/classes/Classifier/ContentNode.src/M000048.html +0 -18
- data/doc/classes/Classifier/ContentNode.src/M000049.html +0 -49
- data/doc/classes/Classifier/LSI.html +0 -539
- data/doc/classes/Classifier/LSI.src/M000022.html +0 -20
- data/doc/classes/Classifier/LSI.src/M000023.html +0 -18
- data/doc/classes/Classifier/LSI.src/M000024.html +0 -21
- data/doc/classes/Classifier/LSI.src/M000025.html +0 -18
- data/doc/classes/Classifier/LSI.src/M000026.html +0 -19
- data/doc/classes/Classifier/LSI.src/M000027.html +0 -21
- data/doc/classes/Classifier/LSI.src/M000028.html +0 -18
- data/doc/classes/Classifier/LSI.src/M000029.html +0 -19
- data/doc/classes/Classifier/LSI.src/M000030.html +0 -43
- data/doc/classes/Classifier/LSI.src/M000031.html +0 -23
- data/doc/classes/Classifier/LSI.src/M000032.html +0 -30
- data/doc/classes/Classifier/LSI.src/M000033.html +0 -30
- data/doc/classes/Classifier/LSI.src/M000034.html +0 -21
- data/doc/classes/Classifier/LSI.src/M000035.html +0 -21
- data/doc/classes/Classifier/LSI.src/M000036.html +0 -31
- data/doc/classes/Classifier/LSI.src/M000037.html +0 -21
- data/doc/classes/Classifier/WordList.html +0 -217
- data/doc/classes/Classifier/WordList.src/M000017.html +0 -18
- data/doc/classes/Classifier/WordList.src/M000018.html +0 -19
- data/doc/classes/Classifier/WordList.src/M000019.html +0 -19
- data/doc/classes/Classifier/WordList.src/M000020.html +0 -18
- data/doc/classes/Classifier/WordList.src/M000021.html +0 -18
- data/doc/classes/GSL.html +0 -112
- data/doc/classes/GSL/Matrix.html +0 -126
- data/doc/classes/GSL/Vector.html +0 -156
- data/doc/classes/GSL/Vector.src/M000015.html +0 -18
- data/doc/classes/GSL/Vector.src/M000016.html +0 -19
- data/doc/classes/Matrix.html +0 -184
- data/doc/classes/Matrix.src/M000004.html +0 -18
- data/doc/classes/Matrix.src/M000005.html +0 -76
- data/doc/classes/Matrix.src/M000006.html +0 -18
- data/doc/classes/Object.html +0 -139
- data/doc/classes/Object.src/M000007.html +0 -16
- data/doc/classes/String.html +0 -275
- data/doc/classes/String.src/M000008.html +0 -18
- data/doc/classes/String.src/M000009.html +0 -18
- data/doc/classes/String.src/M000010.html +0 -18
- data/doc/classes/String.src/M000011.html +0 -18
- data/doc/classes/String.src/M000012.html +0 -18
- data/doc/classes/String.src/M000013.html +0 -18
- data/doc/classes/String.src/M000014.html +0 -18
- data/doc/classes/Vector.html +0 -154
- data/doc/classes/Vector.src/M000001.html +0 -22
- data/doc/classes/Vector.src/M000002.html +0 -25
- data/doc/created.rid +0 -1
- data/doc/files/README.html +0 -252
- data/doc/files/lib/classifier/bayes_rb.html +0 -115
- data/doc/files/lib/classifier/extensions/string_rb.html +0 -122
- data/doc/files/lib/classifier/extensions/vector_rb.html +0 -120
- data/doc/files/lib/classifier/extensions/vector_serialize_rb.html +0 -101
- data/doc/files/lib/classifier/extensions/word_hash_rb.html +0 -115
- data/doc/files/lib/classifier/lsi/content_node_rb.html +0 -115
- data/doc/files/lib/classifier/lsi/summary_rb.html +0 -115
- data/doc/files/lib/classifier/lsi/word_list_rb.html +0 -115
- data/doc/files/lib/classifier/lsi_rb.html +0 -127
- data/doc/files/lib/classifier_rb.html +0 -125
- data/doc/fr_class_index.html +0 -39
- data/doc/fr_file_index.html +0 -37
- data/doc/fr_method_index.html +0 -75
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
@@ -1,18 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html>
|
7
|
-
<head>
|
8
|
-
<title>_dump (GSL::Vector)</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
-
</head>
|
12
|
-
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/classifier/extensions/vector_serialize.rb, line 4</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_dump</span>(<span class="ruby-identifier">v</span>)
|
15
|
-
<span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>( <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_a</span> )
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html>
|
7
|
-
<head>
|
8
|
-
<title>_load (GSL::Vector)</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
-
</head>
|
12
|
-
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/classifier/extensions/vector_serialize.rb, line 8</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">_load</span>(<span class="ruby-identifier">arr</span>)
|
15
|
-
<span class="ruby-identifier">arry</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">arr</span>)
|
16
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">GSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Vector</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">arry</span>)
|
17
|
-
<span class="ruby-keyword kw">end</span></pre>
|
18
|
-
</body>
|
19
|
-
</html>
|
data/doc/classes/Matrix.html
DELETED
@@ -1,184 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: Matrix</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Matrix</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../files/lib/classifier/extensions/vector_rb.html">
|
59
|
-
lib/classifier/extensions/vector.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="Object.html">
|
69
|
-
Object
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
<div id="method-list">
|
88
|
-
<h3 class="section-bar">Methods</h3>
|
89
|
-
|
90
|
-
<div class="name-list">
|
91
|
-
<a href="#M000005">SV_decomp</a>
|
92
|
-
<a href="#M000006">[]=</a>
|
93
|
-
<a href="#M000004">diag</a>
|
94
|
-
</div>
|
95
|
-
</div>
|
96
|
-
|
97
|
-
</div>
|
98
|
-
|
99
|
-
|
100
|
-
<!-- if includes -->
|
101
|
-
|
102
|
-
<div id="section">
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
<div id="aliases-list">
|
107
|
-
<h3 class="section-bar">External Aliases</h3>
|
108
|
-
|
109
|
-
<div class="name-list">
|
110
|
-
<table summary="aliases">
|
111
|
-
<tr class="top-aligned-row context-row">
|
112
|
-
<td class="context-item-name">transpose</td>
|
113
|
-
<td>-></td>
|
114
|
-
<td class="context-item-value">trans</td>
|
115
|
-
</tr>
|
116
|
-
</table>
|
117
|
-
</div>
|
118
|
-
</div>
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
<!-- if method_list -->
|
125
|
-
<div id="methods">
|
126
|
-
<h3 class="section-bar">Public Class methods</h3>
|
127
|
-
|
128
|
-
<div id="method-M000004" class="method-detail">
|
129
|
-
<a name="M000004"></a>
|
130
|
-
|
131
|
-
<div class="method-heading">
|
132
|
-
<a href="Matrix.src/M000004.html" target="Code" class="method-signature"
|
133
|
-
onclick="popupCode('Matrix.src/M000004.html');return false;">
|
134
|
-
<span class="method-name">diag</span><span class="method-args">(s)</span>
|
135
|
-
</a>
|
136
|
-
</div>
|
137
|
-
|
138
|
-
<div class="method-description">
|
139
|
-
</div>
|
140
|
-
</div>
|
141
|
-
|
142
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
143
|
-
|
144
|
-
<div id="method-M000005" class="method-detail">
|
145
|
-
<a name="M000005"></a>
|
146
|
-
|
147
|
-
<div class="method-heading">
|
148
|
-
<a href="Matrix.src/M000005.html" target="Code" class="method-signature"
|
149
|
-
onclick="popupCode('Matrix.src/M000005.html');return false;">
|
150
|
-
<span class="method-name">SV_decomp</span><span class="method-args">(maxSweeps = 20)</span>
|
151
|
-
</a>
|
152
|
-
</div>
|
153
|
-
|
154
|
-
<div class="method-description">
|
155
|
-
</div>
|
156
|
-
</div>
|
157
|
-
|
158
|
-
<div id="method-M000006" class="method-detail">
|
159
|
-
<a name="M000006"></a>
|
160
|
-
|
161
|
-
<div class="method-heading">
|
162
|
-
<a href="Matrix.src/M000006.html" target="Code" class="method-signature"
|
163
|
-
onclick="popupCode('Matrix.src/M000006.html');return false;">
|
164
|
-
<span class="method-name">[]=</span><span class="method-args">(i,j,val)</span>
|
165
|
-
</a>
|
166
|
-
</div>
|
167
|
-
|
168
|
-
<div class="method-description">
|
169
|
-
</div>
|
170
|
-
</div>
|
171
|
-
|
172
|
-
|
173
|
-
</div>
|
174
|
-
|
175
|
-
|
176
|
-
</div>
|
177
|
-
|
178
|
-
|
179
|
-
<div id="validator-badges">
|
180
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
181
|
-
</div>
|
182
|
-
|
183
|
-
</body>
|
184
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html>
|
7
|
-
<head>
|
8
|
-
<title>diag (Matrix)</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
-
</head>
|
12
|
-
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/classifier/extensions/vector.rb, line 36</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Matrix</span>.<span class="ruby-identifier">diag</span>(<span class="ruby-identifier">s</span>)
|
15
|
-
<span class="ruby-constant">Matrix</span>.<span class="ruby-identifier">diagonal</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">s</span>)
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,76 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html>
|
7
|
-
<head>
|
8
|
-
<title>SV_decomp (Matrix)</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
-
</head>
|
12
|
-
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/classifier/extensions/vector.rb, line 42</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">SV_decomp</span>(<span class="ruby-identifier">maxSweeps</span> = <span class="ruby-value">20</span>)
|
15
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">row_size</span> <span class="ruby-operator">>=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">column_size</span>
|
16
|
-
<span class="ruby-identifier">q</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">trans</span> <span class="ruby-operator">*</span> <span class="ruby-keyword kw">self</span>
|
17
|
-
<span class="ruby-keyword kw">else</span>
|
18
|
-
<span class="ruby-identifier">q</span> = <span class="ruby-keyword kw">self</span> <span class="ruby-operator">*</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">trans</span>
|
19
|
-
<span class="ruby-keyword kw">end</span>
|
20
|
-
|
21
|
-
<span class="ruby-identifier">qrot</span> = <span class="ruby-identifier">q</span>.<span class="ruby-identifier">dup</span>
|
22
|
-
<span class="ruby-identifier">v</span> = <span class="ruby-constant">Matrix</span>.<span class="ruby-identifier">identity</span>(<span class="ruby-identifier">q</span>.<span class="ruby-identifier">row_size</span>)
|
23
|
-
<span class="ruby-identifier">azrot</span> = <span class="ruby-keyword kw">nil</span>
|
24
|
-
<span class="ruby-identifier">mzrot</span> = <span class="ruby-keyword kw">nil</span>
|
25
|
-
<span class="ruby-identifier">cnt</span> = <span class="ruby-value">0</span>
|
26
|
-
<span class="ruby-identifier">s_old</span> = <span class="ruby-keyword kw">nil</span>
|
27
|
-
<span class="ruby-identifier">mu</span> = <span class="ruby-keyword kw">nil</span>
|
28
|
-
|
29
|
-
<span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">do</span>
|
30
|
-
<span class="ruby-identifier">cnt</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
31
|
-
<span class="ruby-keyword kw">for</span> <span class="ruby-identifier">row</span> <span class="ruby-keyword kw">in</span> (<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">qrot</span>.<span class="ruby-identifier">row_size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>) <span class="ruby-keyword kw">do</span>
|
32
|
-
<span class="ruby-keyword kw">for</span> <span class="ruby-identifier">col</span> <span class="ruby-keyword kw">in</span> (<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">qrot</span>.<span class="ruby-identifier">row_size</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>) <span class="ruby-keyword kw">do</span>
|
33
|
-
<span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">row</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">col</span>
|
34
|
-
<span class="ruby-identifier">h</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">atan</span>((<span class="ruby-value">2</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">qrot</span>[<span class="ruby-identifier">row</span>,<span class="ruby-identifier">col</span>])<span class="ruby-operator">/</span>(<span class="ruby-identifier">qrot</span>[<span class="ruby-identifier">row</span>,<span class="ruby-identifier">row</span>]<span class="ruby-operator">-</span><span class="ruby-identifier">qrot</span>[<span class="ruby-identifier">col</span>,<span class="ruby-identifier">col</span>]))<span class="ruby-operator">/</span><span class="ruby-value">2.0</span>
|
35
|
-
<span class="ruby-identifier">hcos</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">cos</span>(<span class="ruby-identifier">h</span>)
|
36
|
-
<span class="ruby-identifier">hsin</span> = <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sin</span>(<span class="ruby-identifier">h</span>)
|
37
|
-
<span class="ruby-identifier">mzrot</span> = <span class="ruby-constant">Matrix</span>.<span class="ruby-identifier">identity</span>(<span class="ruby-identifier">qrot</span>.<span class="ruby-identifier">row_size</span>)
|
38
|
-
<span class="ruby-identifier">mzrot</span>[<span class="ruby-identifier">row</span>,<span class="ruby-identifier">row</span>] = <span class="ruby-identifier">hcos</span>
|
39
|
-
<span class="ruby-identifier">mzrot</span>[<span class="ruby-identifier">row</span>,<span class="ruby-identifier">col</span>] = <span class="ruby-operator">-</span><span class="ruby-identifier">hsin</span>
|
40
|
-
<span class="ruby-identifier">mzrot</span>[<span class="ruby-identifier">col</span>,<span class="ruby-identifier">row</span>] = <span class="ruby-identifier">hsin</span>
|
41
|
-
<span class="ruby-identifier">mzrot</span>[<span class="ruby-identifier">col</span>,<span class="ruby-identifier">col</span>] = <span class="ruby-identifier">hcos</span>
|
42
|
-
<span class="ruby-identifier">qrot</span> = <span class="ruby-identifier">mzrot</span>.<span class="ruby-identifier">trans</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">qrot</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">mzrot</span>
|
43
|
-
<span class="ruby-identifier">v</span> = <span class="ruby-identifier">v</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">mzrot</span>
|
44
|
-
<span class="ruby-keyword kw">end</span>
|
45
|
-
<span class="ruby-keyword kw">end</span>
|
46
|
-
<span class="ruby-identifier">s_old</span> = <span class="ruby-identifier">qrot</span>.<span class="ruby-identifier">dup</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cnt</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
47
|
-
<span class="ruby-identifier">sum_qrot</span> = <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
48
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cnt</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span>
|
49
|
-
<span class="ruby-identifier">qrot</span>.<span class="ruby-identifier">row_size</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
50
|
-
<span class="ruby-identifier">sum_qrot</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">qrot</span>[<span class="ruby-identifier">r</span>,<span class="ruby-identifier">r</span>]<span class="ruby-operator">-</span><span class="ruby-identifier">s_old</span>[<span class="ruby-identifier">r</span>,<span class="ruby-identifier">r</span>]).<span class="ruby-identifier">abs</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">qrot</span>[<span class="ruby-identifier">r</span>,<span class="ruby-identifier">r</span>]<span class="ruby-operator">-</span><span class="ruby-identifier">s_old</span>[<span class="ruby-identifier">r</span>,<span class="ruby-identifier">r</span>]).<span class="ruby-identifier">abs</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span><span class="ruby-value">.001</span>
|
51
|
-
<span class="ruby-keyword kw">end</span>
|
52
|
-
<span class="ruby-identifier">s_old</span> = <span class="ruby-identifier">qrot</span>.<span class="ruby-identifier">dup</span>
|
53
|
-
<span class="ruby-keyword kw">end</span>
|
54
|
-
<span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">sum_qrot</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span><span class="ruby-value">.001</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">cnt</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">cnt</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">maxSweeps</span>
|
55
|
-
<span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># of do while true</span>
|
56
|
-
<span class="ruby-identifier">s</span> = []
|
57
|
-
<span class="ruby-identifier">qrot</span>.<span class="ruby-identifier">row_size</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
58
|
-
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">qrot</span>[<span class="ruby-identifier">r</span>,<span class="ruby-identifier">r</span>])
|
59
|
-
<span class="ruby-keyword kw">end</span>
|
60
|
-
<span class="ruby-comment cmt">#puts "cnt = #{cnt}"</span>
|
61
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">row_size</span> <span class="ruby-operator">>=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">column_size</span>
|
62
|
-
<span class="ruby-identifier">mu</span> = <span class="ruby-keyword kw">self</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">*</span> <span class="ruby-constant">Matrix</span>.<span class="ruby-identifier">diagonal</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">s</span>).<span class="ruby-identifier">inverse</span>
|
63
|
-
<span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">mu</span>, <span class="ruby-identifier">v</span>, <span class="ruby-identifier">s</span>]
|
64
|
-
<span class="ruby-keyword kw">else</span>
|
65
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">row_size</span>
|
66
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">column_size</span>
|
67
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">row_size</span>
|
68
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">column_size</span>
|
69
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">size</span>
|
70
|
-
|
71
|
-
<span class="ruby-identifier">mu</span> = (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">trans</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">*</span> <span class="ruby-constant">Matrix</span>.<span class="ruby-identifier">diagonal</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">s</span>).<span class="ruby-identifier">inverse</span>)
|
72
|
-
<span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">mu</span>, <span class="ruby-identifier">v</span>, <span class="ruby-identifier">s</span>]
|
73
|
-
<span class="ruby-keyword kw">end</span>
|
74
|
-
<span class="ruby-keyword kw">end</span></pre>
|
75
|
-
</body>
|
76
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html>
|
7
|
-
<head>
|
8
|
-
<title>[]= (Matrix)</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
-
</head>
|
12
|
-
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/classifier/extensions/vector.rb, line 103</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">i</span>,<span class="ruby-identifier">j</span>,<span class="ruby-identifier">val</span>)
|
15
|
-
<span class="ruby-ivar">@rows</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] = <span class="ruby-identifier">val</span>
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
data/doc/classes/Object.html
DELETED
@@ -1,139 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: Object</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Object</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../files/lib/classifier/extensions/string_rb.html">
|
59
|
-
lib/classifier/extensions/string.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="Object.html">
|
69
|
-
Object
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
<div id="method-list">
|
88
|
-
<h3 class="section-bar">Methods</h3>
|
89
|
-
|
90
|
-
<div class="name-list">
|
91
|
-
<a href="#M000007">prepare_category_name</a>
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
|
95
|
-
</div>
|
96
|
-
|
97
|
-
|
98
|
-
<!-- if includes -->
|
99
|
-
|
100
|
-
<div id="section">
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
<!-- if method_list -->
|
110
|
-
<div id="methods">
|
111
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
112
|
-
|
113
|
-
<div id="method-M000007" class="method-detail">
|
114
|
-
<a name="M000007"></a>
|
115
|
-
|
116
|
-
<div class="method-heading">
|
117
|
-
<a href="Object.src/M000007.html" target="Code" class="method-signature"
|
118
|
-
onclick="popupCode('Object.src/M000007.html');return false;">
|
119
|
-
<span class="method-name">prepare_category_name</span><span class="method-args">()</span>
|
120
|
-
</a>
|
121
|
-
</div>
|
122
|
-
|
123
|
-
<div class="method-description">
|
124
|
-
</div>
|
125
|
-
</div>
|
126
|
-
|
127
|
-
|
128
|
-
</div>
|
129
|
-
|
130
|
-
|
131
|
-
</div>
|
132
|
-
|
133
|
-
|
134
|
-
<div id="validator-badges">
|
135
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
136
|
-
</div>
|
137
|
-
|
138
|
-
</body>
|
139
|
-
</html>
|