linmeric 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +51 -0
  5. data/Rakefile +10 -0
  6. data/bin/help/Help.rb +184 -0
  7. data/bin/help/Help_inst.rb +244 -0
  8. data/bin/linguide +23 -0
  9. data/bin/linmeric +36 -70
  10. data/doc/Archive.html +352 -0
  11. data/doc/Calculator/Evaluator.html +477 -0
  12. data/doc/Calculator/Lexer.html +186 -0
  13. data/doc/Calculator/Token.html +257 -0
  14. data/doc/Calculator.html +181 -0
  15. data/doc/Dim.html +257 -0
  16. data/doc/Filename.html +246 -0
  17. data/doc/Fixnum.html +253 -0
  18. data/doc/Float.html +253 -0
  19. data/doc/Function.html +784 -0
  20. data/doc/InputError.html +102 -0
  21. data/doc/Instructions_en.txt +6 -7
  22. data/doc/Instructions_it.txt +6 -9
  23. data/doc/Integrators.html +436 -0
  24. data/doc/LU.html +435 -0
  25. data/doc/Lexer.html +261 -0
  26. data/doc/Linmeric.html +109 -0
  27. data/doc/Listener.html +605 -0
  28. data/doc/Matrix.html +1719 -0
  29. data/doc/MyArgError.html +102 -0
  30. data/doc/NilClass.html +202 -0
  31. data/doc/Numeric.html +251 -0
  32. data/doc/Parser.html +389 -0
  33. data/doc/PrintError.html +622 -0
  34. data/doc/README_md.html +142 -0
  35. data/doc/Scp.html +530 -0
  36. data/doc/Sizer.html +652 -0
  37. data/doc/String.html +540 -0
  38. data/doc/Token.html +341 -0
  39. data/doc/Tool.html +394 -0
  40. data/doc/created.rid +18 -0
  41. data/doc/css/fonts.css +167 -0
  42. data/doc/css/rdoc.css +590 -0
  43. data/doc/fonts/Lato-Light.ttf +0 -0
  44. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  45. data/doc/fonts/Lato-Regular.ttf +0 -0
  46. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  47. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  48. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  49. data/doc/images/add.png +0 -0
  50. data/doc/images/arrow_up.png +0 -0
  51. data/doc/images/brick.png +0 -0
  52. data/doc/images/brick_link.png +0 -0
  53. data/doc/images/bug.png +0 -0
  54. data/doc/images/bullet_black.png +0 -0
  55. data/doc/images/bullet_toggle_minus.png +0 -0
  56. data/doc/images/bullet_toggle_plus.png +0 -0
  57. data/doc/images/date.png +0 -0
  58. data/doc/images/delete.png +0 -0
  59. data/doc/images/find.png +0 -0
  60. data/doc/images/loadingAnimation.gif +0 -0
  61. data/doc/images/macFFBgHack.png +0 -0
  62. data/doc/images/package.png +0 -0
  63. data/doc/images/page_green.png +0 -0
  64. data/doc/images/page_white_text.png +0 -0
  65. data/doc/images/page_white_width.png +0 -0
  66. data/doc/images/plugin.png +0 -0
  67. data/doc/images/ruby.png +0 -0
  68. data/doc/images/tag_blue.png +0 -0
  69. data/doc/images/tag_green.png +0 -0
  70. data/doc/images/transparent.png +0 -0
  71. data/doc/images/wrench.png +0 -0
  72. data/doc/images/wrench_orange.png +0 -0
  73. data/doc/images/zoom.png +0 -0
  74. data/doc/index.html +190 -0
  75. data/doc/js/darkfish.js +161 -0
  76. data/doc/js/jquery.js +9404 -0
  77. data/doc/js/navigation.js +142 -0
  78. data/doc/js/navigation.js.gz +0 -0
  79. data/doc/js/search.js +109 -0
  80. data/doc/js/search_index.js +1 -0
  81. data/doc/js/search_index.js.gz +0 -0
  82. data/doc/js/searcher.js +228 -0
  83. data/doc/js/searcher.js.gz +0 -0
  84. data/doc/table_of_contents.html +834 -0
  85. data/lib/linmeric/Archive.rb +22 -1
  86. data/lib/linmeric/Calculator.rb +252 -0
  87. data/lib/linmeric/CnGal_Matrix_class.rb +130 -49
  88. data/lib/linmeric/CnGal_new_classes.rb +139 -37
  89. data/lib/linmeric/CnGal_tools.rb +23 -40
  90. data/lib/linmeric/Error_print.rb +35 -1
  91. data/lib/linmeric/Function_class.rb +70 -11
  92. data/lib/linmeric/Integrators.rb +81 -35
  93. data/lib/linmeric/LU.rb +26 -5
  94. data/lib/linmeric/Lexer.rb +19 -1
  95. data/lib/linmeric/Listener.rb +25 -5
  96. data/lib/linmeric/Parser.rb +23 -1
  97. data/lib/linmeric/Scopify.rb +52 -31
  98. data/lib/linmeric/Sizer.rb +43 -10
  99. data/lib/linmeric/Token.rb +23 -4
  100. data/lib/linmeric/version.rb +3 -0
  101. data/lib/linmeric.rb +10 -8
  102. data/lib/linmeric_bin.rb +12 -0
  103. metadata +126 -22
  104. data/doc/Instructions_en.html +0 -231
  105. data/doc/Instructions_it.html +0 -231
  106. data/doc/README_en.html +0 -177
  107. data/doc/README_en.txt +0 -30
  108. data/doc/README_it.html +0 -187
  109. data/doc/README_it.txt +0 -32
@@ -0,0 +1,257 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Calculator::Token - RDoc Documentation</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "../";
11
+ </script>
12
+
13
+ <script src="../js/jquery.js"></script>
14
+ <script src="../js/darkfish.js"></script>
15
+
16
+ <link href="../css/fonts.css" rel="stylesheet">
17
+ <link href="../css/rdoc.css" rel="stylesheet">
18
+
19
+
20
+
21
+ <body id="top" role="document" class="class">
22
+ <nav role="navigation">
23
+ <div id="project-navigation">
24
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
25
+ <h2>
26
+ <a href="../index.html" rel="home">Home</a>
27
+ </h2>
28
+
29
+ <div id="table-of-contents-navigation">
30
+ <a href="../table_of_contents.html#pages">Pages</a>
31
+ <a href="../table_of_contents.html#classes">Classes</a>
32
+ <a href="../table_of_contents.html#methods">Methods</a>
33
+ </div>
34
+ </div>
35
+
36
+ <div id="search-section" role="search" class="project-section initially-hidden">
37
+ <form action="#" method="get" accept-charset="utf-8">
38
+ <div id="search-field-wrapper">
39
+ <input id="search-field" role="combobox" aria-label="Search"
40
+ aria-autocomplete="list" aria-controls="search-results"
41
+ type="text" name="search" placeholder="Search" spellcheck="false"
42
+ title="Type to search, Up and Down to navigate, Enter to load">
43
+ </div>
44
+
45
+ <ul id="search-results" aria-label="Search Results"
46
+ aria-busy="false" aria-expanded="false"
47
+ aria-atomic="false" class="initially-hidden"></ul>
48
+ </form>
49
+ </div>
50
+
51
+ </div>
52
+
53
+
54
+
55
+ <div id="class-metadata">
56
+
57
+ <div id="parent-class-section" class="nav-section">
58
+ <h3>Parent</h3>
59
+
60
+
61
+ <p class="link">Object
62
+
63
+ </div>
64
+
65
+
66
+
67
+ <!-- Method Quickref -->
68
+ <div id="method-list-section" class="nav-section">
69
+ <h3>Methods</h3>
70
+
71
+ <ul class="link-list" role="directory">
72
+
73
+ <li ><a href="#method-c-new">::new</a>
74
+
75
+ <li ><a href="#method-i-tag">#tag</a>
76
+
77
+ <li ><a href="#method-i-value">#value</a>
78
+
79
+ </ul>
80
+ </div>
81
+
82
+ </div>
83
+ </nav>
84
+
85
+ <main role="main" aria-labelledby="class-Calculator::Token">
86
+ <h1 id="class-Calculator::Token" class="class">
87
+ class Calculator::Token
88
+ </h1>
89
+
90
+ <section class="description">
91
+
92
+ <p>Definition of a simple token with an attribute (@tag) and a value (@val)</p>
93
+ <dl class="rdoc-list note-list"><dt>Author
94
+ <dd>
95
+ <p>Massimiliano Dal Mas (<a
96
+ href="mailto:max.codeware@gmail.com">max.codeware@gmail.com</a>)</p>
97
+ </dd><dt>License
98
+ <dd>
99
+ <p>Distributed under MIT license</p>
100
+ </dd></dl>
101
+
102
+ </section>
103
+
104
+
105
+
106
+
107
+ <section id="5Buntitled-5D" class="documentation-section">
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
118
+ <header>
119
+ <h3>Public Class Methods</h3>
120
+ </header>
121
+
122
+
123
+ <div id="method-c-new" class="method-detail ">
124
+
125
+ <div class="method-heading">
126
+ <span class="method-name">new</span><span
127
+ class="method-args">(value)</span>
128
+
129
+ <span class="method-click-advice">click to toggle source</span>
130
+
131
+ </div>
132
+
133
+
134
+ <div class="method-description">
135
+
136
+ <ul><li>
137
+ <p>*<strong>argument</strong>*: value to tokenize (String)</p>
138
+ </li></ul>
139
+
140
+
141
+
142
+
143
+ <div class="method-source-code" id="new-source">
144
+ <pre><span class="ruby-comment"># File lib/linmeric/Calculator.rb, line 25</span>
145
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">value</span>)
146
+ <span class="ruby-ivar">@val</span> = <span class="ruby-identifier">value</span>
147
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">OP</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">value</span> <span class="ruby-keyword">then</span>
148
+ <span class="ruby-ivar">@tag</span> = <span class="ruby-value">:OPERATOR</span>
149
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">number?</span> <span class="ruby-keyword">then</span>
150
+ <span class="ruby-ivar">@tag</span> = <span class="ruby-value">:NUMBER</span>
151
+ <span class="ruby-ivar">@val</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_n</span>
152
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;(&quot;</span> <span class="ruby-keyword">then</span>
153
+ <span class="ruby-ivar">@tag</span> = <span class="ruby-value">:L_PAR</span>
154
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;)&quot;</span> <span class="ruby-keyword">then</span>
155
+ <span class="ruby-ivar">@tag</span> = <span class="ruby-value">:R_PAR</span>
156
+ <span class="ruby-keyword">end</span>
157
+ <span class="ruby-keyword">end</span></pre>
158
+ </div>
159
+
160
+ </div>
161
+
162
+
163
+
164
+
165
+ </div>
166
+
167
+
168
+ </section>
169
+
170
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
171
+ <header>
172
+ <h3>Public Instance Methods</h3>
173
+ </header>
174
+
175
+
176
+ <div id="method-i-tag" class="method-detail ">
177
+
178
+ <div class="method-heading">
179
+ <span class="method-name">tag</span><span
180
+ class="method-args">()</span>
181
+
182
+ <span class="method-click-advice">click to toggle source</span>
183
+
184
+ </div>
185
+
186
+
187
+ <div class="method-description">
188
+
189
+ <ul><li>
190
+ <p>*<strong>returns</strong>*: tag of the token</p>
191
+ </li></ul>
192
+
193
+
194
+
195
+
196
+ <div class="method-source-code" id="tag-source">
197
+ <pre><span class="ruby-comment"># File lib/linmeric/Calculator.rb, line 45</span>
198
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">tag</span>
199
+ <span class="ruby-keyword">return</span> <span class="ruby-ivar">@tag</span>
200
+ <span class="ruby-keyword">end</span></pre>
201
+ </div>
202
+
203
+ </div>
204
+
205
+
206
+
207
+
208
+ </div>
209
+
210
+
211
+ <div id="method-i-value" class="method-detail ">
212
+
213
+ <div class="method-heading">
214
+ <span class="method-name">value</span><span
215
+ class="method-args">()</span>
216
+
217
+ <span class="method-click-advice">click to toggle source</span>
218
+
219
+ </div>
220
+
221
+
222
+ <div class="method-description">
223
+
224
+ <ul><li>
225
+ <p>*<strong>returns</strong>*: value of the token</p>
226
+ </li></ul>
227
+
228
+
229
+
230
+
231
+ <div class="method-source-code" id="value-source">
232
+ <pre><span class="ruby-comment"># File lib/linmeric/Calculator.rb, line 40</span>
233
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">value</span>
234
+ <span class="ruby-keyword">return</span> <span class="ruby-ivar">@val</span>
235
+ <span class="ruby-keyword">end</span></pre>
236
+ </div>
237
+
238
+ </div>
239
+
240
+
241
+
242
+
243
+ </div>
244
+
245
+
246
+ </section>
247
+
248
+ </section>
249
+ </main>
250
+
251
+
252
+ <footer id="validator-badges" role="contentinfo">
253
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
254
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
255
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
256
+ </footer>
257
+
@@ -0,0 +1,181 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>module Calculator - RDoc Documentation</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "./";
11
+ </script>
12
+
13
+ <script src="./js/jquery.js"></script>
14
+ <script src="./js/darkfish.js"></script>
15
+
16
+ <link href="./css/fonts.css" rel="stylesheet">
17
+ <link href="./css/rdoc.css" rel="stylesheet">
18
+
19
+
20
+
21
+ <body id="top" role="document" class="module">
22
+ <nav role="navigation">
23
+ <div id="project-navigation">
24
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
25
+ <h2>
26
+ <a href="./index.html" rel="home">Home</a>
27
+ </h2>
28
+
29
+ <div id="table-of-contents-navigation">
30
+ <a href="./table_of_contents.html#pages">Pages</a>
31
+ <a href="./table_of_contents.html#classes">Classes</a>
32
+ <a href="./table_of_contents.html#methods">Methods</a>
33
+ </div>
34
+ </div>
35
+
36
+ <div id="search-section" role="search" class="project-section initially-hidden">
37
+ <form action="#" method="get" accept-charset="utf-8">
38
+ <div id="search-field-wrapper">
39
+ <input id="search-field" role="combobox" aria-label="Search"
40
+ aria-autocomplete="list" aria-controls="search-results"
41
+ type="text" name="search" placeholder="Search" spellcheck="false"
42
+ title="Type to search, Up and Down to navigate, Enter to load">
43
+ </div>
44
+
45
+ <ul id="search-results" aria-label="Search Results"
46
+ aria-busy="false" aria-expanded="false"
47
+ aria-atomic="false" class="initially-hidden"></ul>
48
+ </form>
49
+ </div>
50
+
51
+ </div>
52
+
53
+
54
+
55
+ <div id="class-metadata">
56
+
57
+
58
+
59
+
60
+ <!-- Method Quickref -->
61
+ <div id="method-list-section" class="nav-section">
62
+ <h3>Methods</h3>
63
+
64
+ <ul class="link-list" role="directory">
65
+
66
+ <li ><a href="#method-c-solve">::solve</a>
67
+
68
+ </ul>
69
+ </div>
70
+
71
+ </div>
72
+ </nav>
73
+
74
+ <main role="main" aria-labelledby="module-Calculator">
75
+ <h1 id="module-Calculator" class="module">
76
+ module Calculator
77
+ </h1>
78
+
79
+ <section class="description">
80
+
81
+ <p>This file contains a simple expression evaluator to convert math binary
82
+ operations in a result. It is simply a calculator</p>
83
+ <dl class="rdoc-list note-list"><dt>Author
84
+ <dd>
85
+ <p>Massimiliano Dal Mas (<a
86
+ href="mailto:max.codeware@gmail.com">max.codeware@gmail.com</a>)</p>
87
+ </dd><dt>License
88
+ <dd>
89
+ <p>Distributed under MIT license</p>
90
+ </dd></dl>
91
+
92
+ </section>
93
+
94
+
95
+
96
+
97
+ <section id="5Buntitled-5D" class="documentation-section">
98
+
99
+
100
+
101
+
102
+
103
+ <section class="constants-list">
104
+ <header>
105
+ <h3>Constants</h3>
106
+ </header>
107
+ <dl>
108
+
109
+ <dt id="OP">OP
110
+
111
+ <dd>
112
+
113
+
114
+ </dl>
115
+ </section>
116
+
117
+
118
+
119
+
120
+
121
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
122
+ <header>
123
+ <h3>Public Class Methods</h3>
124
+ </header>
125
+
126
+
127
+ <div id="method-c-solve" class="method-detail ">
128
+
129
+ <div class="method-heading">
130
+ <span class="method-name">solve</span><span
131
+ class="method-args">(exp)</span>
132
+
133
+ <span class="method-click-advice">click to toggle source</span>
134
+
135
+ </div>
136
+
137
+
138
+ <div class="method-description">
139
+
140
+ <p>It solves the expression in string format</p>
141
+ <ul><li>
142
+ <p>*<strong>argument</strong>*: expression to evaluate</p>
143
+ </li><li>
144
+ <p>*<strong>returns</strong>*: result of the expression; <code>nil</code> if
145
+ an error occourred</p>
146
+ </li></ul>
147
+
148
+
149
+
150
+
151
+ <div class="method-source-code" id="solve-source">
152
+ <pre><span class="ruby-comment"># File lib/linmeric/Calculator.rb, line 232</span>
153
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">solve</span>(<span class="ruby-identifier">exp</span>)
154
+ <span class="ruby-identifier">lexer</span> = <span class="ruby-constant">Lexer</span>.<span class="ruby-identifier">new</span>
155
+ <span class="ruby-identifier">evaluator</span> = <span class="ruby-constant">Evaluator</span>.<span class="ruby-identifier">new</span>
156
+ <span class="ruby-identifier">stream</span> = <span class="ruby-identifier">lexer</span>.<span class="ruby-identifier">tokenize</span>(<span class="ruby-identifier">exp</span>)
157
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">stream</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
158
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">evaluator</span>.<span class="ruby-identifier">evaluate</span>(<span class="ruby-identifier">stream</span>)
159
+ <span class="ruby-keyword">end</span></pre>
160
+ </div>
161
+
162
+ </div>
163
+
164
+
165
+
166
+
167
+ </div>
168
+
169
+
170
+ </section>
171
+
172
+ </section>
173
+ </main>
174
+
175
+
176
+ <footer id="validator-badges" role="contentinfo">
177
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
178
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
179
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
180
+ </footer>
181
+