RubMat 2.1.6 → 2.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Rakefile +2 -2
- data/bin/{rubmat.rb → rubmat} +0 -0
- data/doc/apple-touch-icon.png +0 -0
- data/doc/classes/Fixnum.html +394 -0
- data/doc/classes/Fixnum.src/M000019.html +18 -0
- data/doc/classes/Fixnum.src/M000020.html +18 -0
- data/doc/classes/Fixnum.src/M000021.html +18 -0
- data/doc/classes/Fixnum.src/M000022.html +18 -0
- data/doc/classes/Fixnum.src/M000023.html +18 -0
- data/doc/classes/GetOpt.html +135 -0
- data/doc/classes/Object.html +2636 -0
- data/doc/created.rid +1 -0
- data/doc/css/main.css +278 -0
- data/doc/css/panel.css +383 -0
- data/doc/css/reset.css +53 -0
- data/doc/favicon.ico +0 -0
- data/doc/files/LICENSE.html +74 -0
- data/doc/files/README.html +73 -0
- data/doc/files/README_md.html +73 -0
- data/doc/files/Rakefile.html +116 -0
- data/doc/files/bin/librbdiscrete_rb.html +93 -0
- data/doc/files/lib/fixnumexpand_rb.html +59 -0
- data/doc/files/lib/help_rb.html +52 -0
- data/doc/files/lib/librbdiscrete_rb.html +93 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000001.html +22 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000002.html +29 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000003.html +21 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000004.html +28 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000005.html +22 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000006.html +31 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000007.html +18 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000008.html +22 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000009.html +18 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000010.html +22 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000011.html +28 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000012.html +28 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000013.html +18 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000014.html +18 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000015.html +18 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000016.html +32 -0
- data/doc/files/lib/librbdiscrete_rb.src/M000017.html +22 -0
- data/doc/files/lib/main_rb.html +76 -0
- data/doc/files/lib/statics_yml.html +63 -0
- data/doc/files/nbproject/private/private_xml.html +67 -0
- data/doc/files/nbproject/private/rake-d_txt.html +62 -0
- data/doc/files/nbproject/project_properties.html +60 -0
- data/doc/files/nbproject/project_xml.html +79 -0
- data/doc/files/pkg/RubMat-2_1_5/LICENSE.html +74 -0
- data/doc/files/pkg/RubMat-2_1_5/README.html +73 -0
- data/doc/files/pkg/RubMat-2_1_5/Rakefile.html +116 -0
- data/doc/files/pkg/RubMat-2_1_5/bin/librbdiscrete_rb.html +86 -0
- data/doc/files/pkg/RubMat-2_1_5/lib/fixnumexpand_rb.html +59 -0
- data/doc/files/pkg/RubMat-2_1_5/lib/librbdiscrete_rb.html +86 -0
- data/doc/files/pkg/RubMat-2_1_5/lib/main_rb.html +77 -0
- data/doc/files/pkg/RubMat-2_1_5/lib/statics_yml.html +63 -0
- data/doc/files/test/testprocedure_rb.html +59 -0
- data/doc/files/test/testprocedure_rb.src/M000018.html +18 -0
- data/doc/fr_class_index.html +27 -0
- data/doc/fr_file_index.html +30 -0
- data/doc/fr_method_index.html +49 -0
- data/doc/i/arrows.png +0 -0
- data/doc/i/results_bg.png +0 -0
- data/doc/i/tree_bg.png +0 -0
- data/doc/index.html +14 -0
- data/doc/js/jquery-1.3.2.min.js +19 -0
- data/doc/js/jquery-effect.js +593 -0
- data/doc/js/main.js +22 -0
- data/doc/js/searchdoc.js +628 -0
- data/doc/panel/index.html +71 -0
- data/doc/panel/search_index.js +1 -0
- data/doc/panel/tree.js +1 -0
- data/doc/rdoc-style.css +208 -0
- data/pkg/RubMat-2.1.5.gem +0 -0
- data/pkg/RubMat-2.1.5/LICENSE +17 -0
- data/pkg/RubMat-2.1.5/README +11 -0
- data/pkg/RubMat-2.1.5/Rakefile +42 -0
- data/pkg/RubMat-2.1.5/RubMat.png +0 -0
- data/pkg/RubMat-2.1.5/gplv3.png +0 -0
- data/pkg/RubMat-2.1.5/lib/fixnumexpand.rb +35 -0
- data/pkg/RubMat-2.1.5/lib/librbdiscrete.rb +412 -0
- data/pkg/RubMat-2.1.5/lib/main.rb +13 -0
- data/pkg/RubMat-2.1.5/lib/statics.yml +4 -0
- data/rubmat.gemspec +22 -0
- data/test/testprocedure.rb +8 -0
- metadata +110 -16
@@ -0,0 +1,59 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>fixnumexpand.rb</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
<div class="banner">
|
17
|
+
<h1>
|
18
|
+
fixnumexpand.rb
|
19
|
+
</h1>
|
20
|
+
<ul class="files">
|
21
|
+
<li>lib/fixnumexpand.rb</li>
|
22
|
+
<li>Last modified: Wed Jun 22 00:51:00 +0300 2011</li>
|
23
|
+
</ul>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div id="bodyContent">
|
27
|
+
<div id="content">
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
<div class="sectiontitle">Classes and Modules</div>
|
44
|
+
<ul>
|
45
|
+
|
46
|
+
<li><span class="type">CLASS</span> <a href="../../classes/Fixnum.html">Fixnum</a></li>
|
47
|
+
|
48
|
+
</ul>
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
</body>
|
59
|
+
</html>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>help.rb</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
<div class="banner">
|
17
|
+
<h1>
|
18
|
+
help.rb
|
19
|
+
</h1>
|
20
|
+
<ul class="files">
|
21
|
+
<li>lib/help.rb</li>
|
22
|
+
<li>Last modified: Fri Jul 08 20:16:57 +0300 2011</li>
|
23
|
+
</ul>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div id="bodyContent">
|
27
|
+
<div id="content">
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</body>
|
52
|
+
</html>
|
@@ -0,0 +1,93 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>librbdiscrete.rb</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
<div class="banner">
|
17
|
+
<h1>
|
18
|
+
librbdiscrete.rb
|
19
|
+
</h1>
|
20
|
+
<ul class="files">
|
21
|
+
<li>lib/librbdiscrete.rb</li>
|
22
|
+
<li>Last modified: Fri Jul 08 20:25:45 +0300 2011</li>
|
23
|
+
</ul>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div id="bodyContent">
|
27
|
+
<div id="content">
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
<div class="sectiontitle">Required Files</div>
|
32
|
+
<ul>
|
33
|
+
|
34
|
+
<li>yaml</li>
|
35
|
+
|
36
|
+
</ul>
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
<div class="sectiontitle">Constants</div>
|
53
|
+
<table border='0' cellpadding='5'>
|
54
|
+
|
55
|
+
<tr valign='top'>
|
56
|
+
<td class="attr-name">EVALUE</td>
|
57
|
+
<td>=</td>
|
58
|
+
<td class="attr-value">2.718281828459045235360287471352662497757247093</td>
|
59
|
+
</tr>
|
60
|
+
|
61
|
+
<tr valign='top'>
|
62
|
+
<td> </td>
|
63
|
+
<td colspan="2" class="attr-desc"><p>
|
64
|
+
constants1 = YAML::load_file(‘statics.yml’)
|
65
|
+
</p>
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
|
69
|
+
|
70
|
+
<tr valign='top'>
|
71
|
+
<td class="attr-name">PIVALUE</td>
|
72
|
+
<td>=</td>
|
73
|
+
<td class="attr-value">3.141592653589793238462643383279502884197169399</td>
|
74
|
+
</tr>
|
75
|
+
|
76
|
+
|
77
|
+
<tr valign='top'>
|
78
|
+
<td class="attr-name">MAX_INTEGER</td>
|
79
|
+
<td>=</td>
|
80
|
+
<td class="attr-value">1073741823</td>
|
81
|
+
</tr>
|
82
|
+
|
83
|
+
|
84
|
+
</table>
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
</body>
|
93
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>factorial (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 22</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">factorial</span>( <span class="ruby-identifier">n</span> )
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator"><=</span> <span class="ruby-value">1</span>
|
16
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-value">1</span>
|
17
|
+
<span class="ruby-keyword kw">else</span>
|
18
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">n</span><span class="ruby-operator">*</span><span class="ruby-identifier">factorial</span>( <span class="ruby-identifier">n</span><span class="ruby-operator">-</span><span class="ruby-value">1</span> ).<span class="ruby-identifier">to_i</span>
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,29 @@
|
|
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>ui_pow (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 42</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ui_pow</span>(<span class="ruby-identifier">base</span>, <span class="ruby-identifier">exp</span>)
|
15
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-value">1</span>;
|
16
|
+
<span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">exp</span>)
|
17
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">exp</span> <span class="ruby-operator">&</span> <span class="ruby-value">1</span>)
|
18
|
+
<span class="ruby-identifier">result</span> <span class="ruby-operator">*=</span> <span class="ruby-identifier">base</span>
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
20
|
+
<span class="ruby-identifier">exp</span> <span class="ruby-operator">>>=</span> <span class="ruby-value">1</span>;
|
21
|
+
<span class="ruby-identifier">base</span> <span class="ruby-operator">*=</span> <span class="ruby-identifier">base</span>
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">exp</span><span class="ruby-operator">==</span><span class="ruby-value">0</span>)
|
24
|
+
<span class="ruby-identifier">result</span>=<span class="ruby-identifier">base</span>
|
25
|
+
<span class="ruby-keyword kw">end</span>
|
26
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
|
27
|
+
<span class="ruby-keyword kw">end</span></pre>
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
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>iterative_fact (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 67</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">iterative_fact</span>(<span class="ruby-identifier">itrtnum</span>)
|
15
|
+
<span class="ruby-identifier">itrtnum</span>.<span class="ruby-identifier">downto</span>(<span class="ruby-value">1</span>) <span class="ruby-keyword kw">do</span>
|
16
|
+
<span class="ruby-identifier">total</span> <span class="ruby-operator">*=</span> <span class="ruby-identifier">factorial</span>(<span class="ruby-identifier">itrtnum</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">total</span>
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,28 @@
|
|
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>subset (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 86</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">subset</span>(<span class="ruby-identifier">gen</span>, <span class="ruby-identifier">zerosbst</span>)
|
15
|
+
<span class="ruby-identifier">main</span> = <span class="ruby-keyword kw">case</span> (<span class="ruby-identifier">zerosbst</span>)
|
16
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">zerosbst</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'y'</span>
|
17
|
+
<span class="ruby-identifier">rslt</span> = <span class="ruby-identifier">ui_pow</span>(<span class="ruby-value">2</span>, <span class="ruby-identifier">gen</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
18
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">rslt</span>
|
19
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">zerosbst</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'n'</span>
|
20
|
+
<span class="ruby-identifier">rslt</span> = <span class="ruby-identifier">ui_pow</span>(<span class="ruby-value">2</span>, <span class="ruby-identifier">gen</span>)
|
21
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">rslt</span>
|
22
|
+
<span class="ruby-keyword kw">else</span>
|
23
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"Enter 'y' or 'n' char"</span>
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
25
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">main</span>
|
26
|
+
<span class="ruby-keyword kw">end</span></pre>
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>combinatorial (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 145</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">combinatorial</span>(<span class="ruby-identifier">glb</span>, <span class="ruby-identifier">ksb</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">glb</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">ksb</span>)
|
16
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"Global set cannot be greater than k-subsets"</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
<span class="ruby-identifier">sbst_given_size</span> = <span class="ruby-identifier">factorial</span>(<span class="ruby-identifier">glb</span>)<span class="ruby-operator">/</span>(<span class="ruby-identifier">factorial</span>(<span class="ruby-identifier">ksb</span>)<span class="ruby-operator">*</span><span class="ruby-identifier">factorial</span>(<span class="ruby-identifier">glb</span><span class="ruby-operator">-</span><span class="ruby-identifier">ksb</span>)).<span class="ruby-identifier">to_f</span>
|
19
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">sbst_given_size</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
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>sigma (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 169</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sigma</span>(<span class="ruby-identifier">inta</span>, <span class="ruby-identifier">intx</span>, <span class="ruby-identifier">intb</span>, <span class="ruby-identifier">pw</span>)
|
15
|
+
<span class="ruby-identifier">ttl</span> = <span class="ruby-value">0</span>
|
16
|
+
<span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">intx</span>
|
17
|
+
<span class="ruby-identifier">ttl</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">inta</span><span class="ruby-operator">*</span><span class="ruby-identifier">intx</span><span class="ruby-operator">+</span><span class="ruby-identifier">intb</span>)
|
18
|
+
<span class="ruby-keyword kw">end</span>
|
19
|
+
<span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">pw</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>)
|
20
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ttl</span>
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
<span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">pw</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span>)
|
23
|
+
<span class="ruby-identifier">ttl</span>=<span class="ruby-identifier">ui_pow</span>(<span class="ruby-identifier">ttl</span>, <span class="ruby-identifier">pw</span>)
|
24
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ttl</span>
|
25
|
+
<span class="ruby-keyword kw">end</span>
|
26
|
+
<span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">pw</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>)
|
27
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-value">1</span>
|
28
|
+
<span class="ruby-keyword kw">end</span>
|
29
|
+
<span class="ruby-keyword kw">end</span></pre>
|
30
|
+
</body>
|
31
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
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>stirling (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 197</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stirling</span>(<span class="ruby-identifier">strln</span>)
|
15
|
+
<span class="ruby-keyword kw">return</span> (<span class="ruby-identifier">strln</span><span class="ruby-operator">/</span><span class="ruby-identifier">constants1</span>.<span class="ruby-constant">EVALUE</span><span class="ruby-operator">**</span><span class="ruby-identifier">strln</span>)<span class="ruby-operator">*</span><span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-value">2</span><span class="ruby-operator">*</span><span class="ruby-identifier">constants1</span>.<span class="ruby-constant">PIVALUE</span><span class="ruby-operator">*</span><span class="ruby-identifier">strln</span>);
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>twin_prdx (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 212</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">twin_prdx</span>(<span class="ruby-identifier">mass</span>)
|
15
|
+
<span class="ruby-identifier">top</span>=<span class="ruby-value">1</span>
|
16
|
+
<span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">366</span><span class="ruby-operator">..</span><span class="ruby-value">366</span><span class="ruby-operator">-</span><span class="ruby-identifier">mass</span>
|
17
|
+
<span class="ruby-identifier">top</span> <span class="ruby-operator">*=</span> <span class="ruby-identifier">i</span>
|
18
|
+
<span class="ruby-keyword kw">end</span>
|
19
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">top</span><span class="ruby-operator">/</span><span class="ruby-identifier">ui_pow</span>(<span class="ruby-value">366</span>, <span class="ruby-identifier">mass</span>)
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
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>dist_pres (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 232</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dist_pres</span>(<span class="ruby-identifier">presnum</span>)
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">factorial</span>(<span class="ruby-identifier">presnum</span>)<span class="ruby-operator">/</span><span class="ruby-identifier">iterative_fact</span>(<span class="ruby-identifier">presnum</span>);
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>fib (lib/librbdiscrete.rb)</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/librbdiscrete.rb, line 247</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fib</span>(<span class="ruby-identifier">n</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">n</span> <span class="ruby-operator"><=</span> <span class="ruby-value">1</span>)
|
16
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">n</span>;
|
17
|
+
<span class="ruby-keyword kw">elsif</span>
|
18
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">fib</span>(<span class="ruby-identifier">n</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)<span class="ruby-operator">+</span><span class="ruby-identifier">fib</span>(<span class="ruby-identifier">n</span><span class="ruby-operator">-</span><span class="ruby-value">2</span>);
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|