p10lppt13 1.0.0 → 1.1.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.
- data/.gitignore +0 -2
- data/.travis.yml +0 -1
- data/Gemfile.lock +1 -1
- data/lib/doc/Densa.html +451 -0
- data/lib/doc/Dispersa.html +462 -0
- data/lib/doc/Fraccion.html +1023 -0
- data/lib/doc/Matriz.html +985 -0
- data/lib/doc/Object.html +349 -0
- data/lib/doc/P10lppt13.html +303 -0
- data/lib/doc/VectorDisperso.html +444 -0
- data/lib/doc/created.rid +89 -0
- data/lib/doc/doc/Densa_html.html +659 -0
- data/lib/doc/doc/Dispersa_html.html +669 -0
- data/lib/doc/doc/Fraccion_html.html +1193 -0
- data/lib/doc/doc/Matriz_html.html +1159 -0
- data/lib/doc/doc/Object_html.html +557 -0
- data/lib/doc/doc/P10lppt13_html.html +509 -0
- data/lib/doc/doc/VectorDisperso_html.html +646 -0
- data/lib/doc/doc/created_rid.html +336 -0
- data/lib/doc/doc/doc/Densa_html_html.html +908 -0
- data/lib/doc/doc/doc/Dispersa_html_html.html +949 -0
- data/lib/doc/doc/doc/Fraccion_html_html.html +1713 -0
- data/lib/doc/doc/doc/Matriz_html_html.html +1684 -0
- data/lib/doc/doc/doc/Object_html_html.html +816 -0
- data/lib/doc/doc/doc/P10lppt13_html_html.html +754 -0
- data/lib/doc/doc/doc/VectorDisperso_html_html.html +887 -0
- data/lib/doc/doc/doc/created_rid_html.html +536 -0
- data/lib/doc/doc/doc/doc/Densa_html_html_html.html +1191 -0
- data/lib/doc/doc/doc/doc/Dispersa_html_html_html.html +1260 -0
- data/lib/doc/doc/doc/doc/Fraccion_html_html_html.html +2174 -0
- data/lib/doc/doc/doc/doc/Matriz_html_html_html.html +2235 -0
- data/lib/doc/doc/doc/doc/Object_html_html_html.html +1099 -0
- data/lib/doc/doc/doc/doc/P10lppt13_html_html_html.html +1028 -0
- data/lib/doc/doc/doc/doc/VectorDisperso_html_html_html.html +1168 -0
- data/lib/doc/doc/doc/doc/created_rid_html_html.html +722 -0
- data/lib/doc/doc/doc/doc/doc/Densa_html_html_html_html.html +1424 -0
- data/lib/doc/doc/doc/doc/doc/Dispersa_html_html_html_html.html +1502 -0
- data/lib/doc/doc/doc/doc/doc/Fraccion_html_html_html_html.html +2619 -0
- data/lib/doc/doc/doc/doc/doc/Matriz_html_html_html_html.html +2764 -0
- data/lib/doc/doc/doc/doc/doc/Object_html_html_html_html.html +1315 -0
- data/lib/doc/doc/doc/doc/doc/P10lppt13_html_html_html_html.html +1227 -0
- data/lib/doc/doc/doc/doc/doc/VectorDisperso_html_html_html_html.html +1403 -0
- data/lib/doc/doc/doc/doc/doc/created_rid_html_html_html.html +920 -0
- data/lib/doc/doc/doc/doc/doc/doc/created_rid_html_html_html_html.html +1089 -0
- data/lib/doc/doc/doc/doc/doc/fraccion_rb~_html_html_html_html.html +1754 -0
- data/lib/doc/doc/doc/doc/doc/index_html_html_html_html.html +1086 -0
- data/lib/doc/doc/doc/doc/doc/js/darkfish_js_html_html_html.html +1207 -0
- data/lib/doc/doc/doc/doc/doc/js/jquery_js_html_html_html.html +3210 -0
- data/lib/doc/doc/doc/doc/doc/js/navigation_js_html_html_html.html +1122 -0
- data/lib/doc/doc/doc/doc/doc/js/search_index_js_html_html_html.html +1031 -0
- data/lib/doc/doc/doc/doc/doc/js/search_js_html_html_html.html +1058 -0
- data/lib/doc/doc/doc/doc/doc/js/searcher_js_html_html_html.html +1295 -0
- data/lib/doc/doc/doc/doc/doc/rdoc_css_html_html_html.html +1827 -0
- data/lib/doc/doc/doc/doc/doc/table_of_contents_html_html_html_html.html +1727 -0
- data/lib/doc/doc/doc/doc/fraccion_rb~_html_html_html.html +1509 -0
- data/lib/doc/doc/doc/doc/index_html_html_html.html +911 -0
- data/lib/doc/doc/doc/doc/js/darkfish_js_html_html.html +920 -0
- data/lib/doc/doc/doc/doc/js/jquery_js_html_html.html +2908 -0
- data/lib/doc/doc/doc/doc/js/navigation_js_html_html.html +852 -0
- data/lib/doc/doc/doc/doc/js/search_index_js_html_html.html +889 -0
- data/lib/doc/doc/doc/doc/js/search_js_html_html.html +802 -0
- data/lib/doc/doc/doc/doc/js/searcher_js_html_html.html +975 -0
- data/lib/doc/doc/doc/doc/p10lppt13_rb~_html_html_html.html +1996 -0
- data/lib/doc/doc/doc/doc/rdoc_css_html_html.html +1443 -0
- data/lib/doc/doc/doc/doc/table_of_contents_html_html_html.html +1503 -0
- data/lib/doc/doc/doc/fraccion_rb~_html_html.html +1052 -0
- data/lib/doc/doc/doc/index_html_html.html +669 -0
- data/lib/doc/doc/doc/js/darkfish_js_html.html +667 -0
- data/lib/doc/doc/doc/js/jquery_js_html.html +213 -0
- data/lib/doc/doc/doc/js/navigation_js_html.html +557 -0
- data/lib/doc/doc/doc/js/search_index_js_html.html +589 -0
- data/lib/doc/doc/doc/js/search_js_html.html +499 -0
- data/lib/doc/doc/doc/js/searcher_js_html.html +655 -0
- data/lib/doc/doc/doc/p10lppt13_rb~_html_html.html +1361 -0
- data/lib/doc/doc/doc/rdoc_css_html.html +1039 -0
- data/lib/doc/doc/doc/table_of_contents_html_html.html +1134 -0
- data/lib/doc/doc/fraccion_rb~_html.html +582 -0
- data/lib/doc/doc/index_html.html +389 -0
- data/lib/doc/doc/js/darkfish_js.html +386 -0
- data/lib/doc/doc/js/jquery_js.html +1611 -0
- data/lib/doc/doc/js/navigation_js.html +354 -0
- data/lib/doc/doc/js/search_index_js.html +427 -0
- data/lib/doc/doc/js/search_js.html +308 -0
- data/lib/doc/doc/js/searcher_js.html +441 -0
- data/lib/doc/doc/p10lppt13_rb~_html.html +810 -0
- data/lib/doc/doc/rdoc_css.html +939 -0
- data/lib/doc/doc/table_of_contents_html.html +489 -0
- data/lib/doc/fraccion_rb~.html +356 -0
- data/lib/doc/images/add.png +0 -0
- data/lib/doc/images/arrow_up.png +0 -0
- data/lib/doc/images/brick.png +0 -0
- data/lib/doc/images/brick_link.png +0 -0
- data/lib/doc/images/bug.png +0 -0
- data/lib/doc/images/bullet_black.png +0 -0
- data/lib/doc/images/bullet_toggle_minus.png +0 -0
- data/lib/doc/images/bullet_toggle_plus.png +0 -0
- data/lib/doc/images/date.png +0 -0
- data/lib/doc/images/delete.png +0 -0
- data/lib/doc/images/find.png +0 -0
- data/lib/doc/images/loadingAnimation.gif +0 -0
- data/lib/doc/images/macFFBgHack.png +0 -0
- data/lib/doc/images/package.png +0 -0
- data/lib/doc/images/page_green.png +0 -0
- data/lib/doc/images/page_white_text.png +0 -0
- data/lib/doc/images/page_white_width.png +0 -0
- data/lib/doc/images/plugin.png +0 -0
- data/lib/doc/images/ruby.png +0 -0
- data/lib/doc/images/tag_blue.png +0 -0
- data/lib/doc/images/tag_green.png +0 -0
- data/lib/doc/images/transparent.png +0 -0
- data/lib/doc/images/wrench.png +0 -0
- data/lib/doc/images/wrench_orange.png +0 -0
- data/lib/doc/images/zoom.png +0 -0
- data/lib/doc/index.html +248 -0
- data/lib/doc/js/darkfish.js +155 -0
- data/lib/doc/js/jquery.js +18 -0
- data/lib/doc/js/navigation.js +142 -0
- data/lib/doc/js/search.js +94 -0
- data/lib/doc/js/search_index.js +1 -0
- data/lib/doc/js/searcher.js +228 -0
- data/lib/doc/p10lppt13_rb~.html +522 -0
- data/lib/doc/rdoc.css +595 -0
- data/lib/doc/table_of_contents.html +360 -0
- data/lib/fraccion.rb +18 -3
- data/lib/p10lppt13.rb +71 -41
- data/lib/p10lppt13/version.rb +3 -1
- data/spec/p10lppt13_spec.rb +16 -6
- data/test/tc_p10lppt13.rb +2 -0
- metadata +166 -26
- checksums.yaml +0 -7
- data/lib/gcd.rb +0 -7
@@ -0,0 +1,1159 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>Matriz.html - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body class="file">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
<div id="project-metadata">
|
49
|
+
<nav id="fileindex-section" class="section project-section">
|
50
|
+
<h3 class="section-header">Pages</h3>
|
51
|
+
|
52
|
+
<ul>
|
53
|
+
|
54
|
+
<li class="file"><a href="../doc/Densa_html.html">Densa.html</a>
|
55
|
+
|
56
|
+
<li class="file"><a href="../doc/Dispersa_html.html">Dispersa.html</a>
|
57
|
+
|
58
|
+
<li class="file"><a href="../doc/Fraccion_html.html">Fraccion.html</a>
|
59
|
+
|
60
|
+
<li class="file"><a href="../doc/Matriz_html.html">Matriz.html</a>
|
61
|
+
|
62
|
+
<li class="file"><a href="../doc/Object_html.html">Object.html</a>
|
63
|
+
|
64
|
+
<li class="file"><a href="../doc/P10lppt13_html.html">P10lppt13.html</a>
|
65
|
+
|
66
|
+
<li class="file"><a href="../doc/VectorDisperso_html.html">VectorDisperso.html</a>
|
67
|
+
|
68
|
+
<li class="file"><a href="../doc/created_rid.html">created.rid</a>
|
69
|
+
|
70
|
+
<li class="file"><a href="../doc/doc/Densa_html_html.html">Densa_html.html</a>
|
71
|
+
|
72
|
+
<li class="file"><a href="../doc/doc/Dispersa_html_html.html">Dispersa_html.html</a>
|
73
|
+
|
74
|
+
<li class="file"><a href="../doc/doc/Fraccion_html_html.html">Fraccion_html.html</a>
|
75
|
+
|
76
|
+
<li class="file"><a href="../doc/doc/Matriz_html_html.html">Matriz_html.html</a>
|
77
|
+
|
78
|
+
<li class="file"><a href="../doc/doc/Object_html_html.html">Object_html.html</a>
|
79
|
+
|
80
|
+
<li class="file"><a href="../doc/doc/P10lppt13_html_html.html">P10lppt13_html.html</a>
|
81
|
+
|
82
|
+
<li class="file"><a href="../doc/doc/VectorDisperso_html_html.html">VectorDisperso_html.html</a>
|
83
|
+
|
84
|
+
<li class="file"><a href="../doc/doc/created_rid_html.html">created_rid.html</a>
|
85
|
+
|
86
|
+
<li class="file"><a href="../doc/doc/doc/Densa_html_html_html.html">Densa_html_html.html</a>
|
87
|
+
|
88
|
+
<li class="file"><a href="../doc/doc/doc/Dispersa_html_html_html.html">Dispersa_html_html.html</a>
|
89
|
+
|
90
|
+
<li class="file"><a href="../doc/doc/doc/Fraccion_html_html_html.html">Fraccion_html_html.html</a>
|
91
|
+
|
92
|
+
<li class="file"><a href="../doc/doc/doc/Matriz_html_html_html.html">Matriz_html_html.html</a>
|
93
|
+
|
94
|
+
<li class="file"><a href="../doc/doc/doc/Object_html_html_html.html">Object_html_html.html</a>
|
95
|
+
|
96
|
+
<li class="file"><a href="../doc/doc/doc/P10lppt13_html_html_html.html">P10lppt13_html_html.html</a>
|
97
|
+
|
98
|
+
<li class="file"><a href="../doc/doc/doc/VectorDisperso_html_html_html.html">VectorDisperso_html_html.html</a>
|
99
|
+
|
100
|
+
<li class="file"><a href="../doc/doc/doc/created_rid_html_html.html">created_rid_html.html</a>
|
101
|
+
|
102
|
+
<li class="file"><a href="../doc/doc/doc/doc/Densa_html_html_html_html.html">Densa_html_html_html.html</a>
|
103
|
+
|
104
|
+
<li class="file"><a href="../doc/doc/doc/doc/Dispersa_html_html_html_html.html">Dispersa_html_html_html.html</a>
|
105
|
+
|
106
|
+
<li class="file"><a href="../doc/doc/doc/doc/Fraccion_html_html_html_html.html">Fraccion_html_html_html.html</a>
|
107
|
+
|
108
|
+
<li class="file"><a href="../doc/doc/doc/doc/Matriz_html_html_html_html.html">Matriz_html_html_html.html</a>
|
109
|
+
|
110
|
+
<li class="file"><a href="../doc/doc/doc/doc/Object_html_html_html_html.html">Object_html_html_html.html</a>
|
111
|
+
|
112
|
+
<li class="file"><a href="../doc/doc/doc/doc/P10lppt13_html_html_html_html.html">P10lppt13_html_html_html.html</a>
|
113
|
+
|
114
|
+
<li class="file"><a href="../doc/doc/doc/doc/VectorDisperso_html_html_html_html.html">VectorDisperso_html_html_html.html</a>
|
115
|
+
|
116
|
+
<li class="file"><a href="../doc/doc/doc/doc/created_rid_html_html_html.html">created_rid_html_html.html</a>
|
117
|
+
|
118
|
+
<li class="file"><a href="../doc/doc/doc/doc/doc/created_rid_html_html_html_html.html">created_rid_html_html_html.html</a>
|
119
|
+
|
120
|
+
<li class="file"><a href="../doc/doc/doc/doc/fraccion_rb~_html_html_html_html.html">fraccion_rb~_html_html_html.html</a>
|
121
|
+
|
122
|
+
<li class="file"><a href="../doc/doc/doc/doc/index_html_html_html_html.html">index_html_html_html.html</a>
|
123
|
+
|
124
|
+
<li class="file"><a href="../doc/doc/doc/doc/js/darkfish_js_html_html_html.html">darkfish_js_html_html.html</a>
|
125
|
+
|
126
|
+
<li class="file"><a href="../doc/doc/doc/doc/js/jquery_js_html_html_html.html">jquery_js_html_html.html</a>
|
127
|
+
|
128
|
+
<li class="file"><a href="../doc/doc/doc/doc/js/navigation_js_html_html_html.html">navigation_js_html_html.html</a>
|
129
|
+
|
130
|
+
<li class="file"><a href="../doc/doc/doc/doc/js/search_index_js_html_html_html.html">search_index_js_html_html.html</a>
|
131
|
+
|
132
|
+
<li class="file"><a href="../doc/doc/doc/doc/js/search_js_html_html_html.html">search_js_html_html.html</a>
|
133
|
+
|
134
|
+
<li class="file"><a href="../doc/doc/doc/doc/js/searcher_js_html_html_html.html">searcher_js_html_html.html</a>
|
135
|
+
|
136
|
+
<li class="file"><a href="../doc/doc/doc/doc/rdoc_css_html_html_html.html">rdoc_css_html_html.html</a>
|
137
|
+
|
138
|
+
<li class="file"><a href="../doc/doc/doc/doc/table_of_contents_html_html_html_html.html">table_of_contents_html_html_html.html</a>
|
139
|
+
|
140
|
+
<li class="file"><a href="../doc/doc/doc/fraccion_rb~_html_html_html.html">fraccion_rb~_html_html.html</a>
|
141
|
+
|
142
|
+
<li class="file"><a href="../doc/doc/doc/index_html_html_html.html">index_html_html.html</a>
|
143
|
+
|
144
|
+
<li class="file"><a href="../doc/doc/doc/js/darkfish_js_html_html.html">darkfish_js_html.html</a>
|
145
|
+
|
146
|
+
<li class="file"><a href="../doc/doc/doc/js/jquery_js_html_html.html">jquery_js_html.html</a>
|
147
|
+
|
148
|
+
<li class="file"><a href="../doc/doc/doc/js/navigation_js_html_html.html">navigation_js_html.html</a>
|
149
|
+
|
150
|
+
<li class="file"><a href="../doc/doc/doc/js/search_index_js_html_html.html">search_index_js_html.html</a>
|
151
|
+
|
152
|
+
<li class="file"><a href="../doc/doc/doc/js/search_js_html_html.html">search_js_html.html</a>
|
153
|
+
|
154
|
+
<li class="file"><a href="../doc/doc/doc/js/searcher_js_html_html.html">searcher_js_html.html</a>
|
155
|
+
|
156
|
+
<li class="file"><a href="../doc/doc/doc/p10lppt13_rb~_html_html_html.html">p10lppt13_rb~_html_html.html</a>
|
157
|
+
|
158
|
+
<li class="file"><a href="../doc/doc/doc/rdoc_css_html_html.html">rdoc_css_html.html</a>
|
159
|
+
|
160
|
+
<li class="file"><a href="../doc/doc/doc/table_of_contents_html_html_html.html">table_of_contents_html_html.html</a>
|
161
|
+
|
162
|
+
<li class="file"><a href="../doc/doc/fraccion_rb~_html_html.html">fraccion_rb~_html.html</a>
|
163
|
+
|
164
|
+
<li class="file"><a href="../doc/doc/index_html_html.html">index_html.html</a>
|
165
|
+
|
166
|
+
<li class="file"><a href="../doc/doc/js/darkfish_js_html.html">darkfish_js.html</a>
|
167
|
+
|
168
|
+
<li class="file"><a href="../doc/doc/js/jquery_js_html.html">jquery_js.html</a>
|
169
|
+
|
170
|
+
<li class="file"><a href="../doc/doc/js/navigation_js_html.html">navigation_js.html</a>
|
171
|
+
|
172
|
+
<li class="file"><a href="../doc/doc/js/search_index_js_html.html">search_index_js.html</a>
|
173
|
+
|
174
|
+
<li class="file"><a href="../doc/doc/js/search_js_html.html">search_js.html</a>
|
175
|
+
|
176
|
+
<li class="file"><a href="../doc/doc/js/searcher_js_html.html">searcher_js.html</a>
|
177
|
+
|
178
|
+
<li class="file"><a href="../doc/doc/p10lppt13_rb~_html_html.html">p10lppt13_rb~_html.html</a>
|
179
|
+
|
180
|
+
<li class="file"><a href="../doc/doc/rdoc_css_html.html">rdoc_css.html</a>
|
181
|
+
|
182
|
+
<li class="file"><a href="../doc/doc/table_of_contents_html_html.html">table_of_contents_html.html</a>
|
183
|
+
|
184
|
+
<li class="file"><a href="../doc/fraccion_rb~_html.html">fraccion_rb~.html</a>
|
185
|
+
|
186
|
+
<li class="file"><a href="../doc/index_html.html">index.html</a>
|
187
|
+
|
188
|
+
<li class="file"><a href="../doc/js/darkfish_js.html">darkfish.js</a>
|
189
|
+
|
190
|
+
<li class="file"><a href="../doc/js/jquery_js.html">jquery.js</a>
|
191
|
+
|
192
|
+
<li class="file"><a href="../doc/js/navigation_js.html">navigation.js</a>
|
193
|
+
|
194
|
+
<li class="file"><a href="../doc/js/search_js.html">search.js</a>
|
195
|
+
|
196
|
+
<li class="file"><a href="../doc/js/search_index_js.html">search_index.js</a>
|
197
|
+
|
198
|
+
<li class="file"><a href="../doc/js/searcher_js.html">searcher.js</a>
|
199
|
+
|
200
|
+
<li class="file"><a href="../doc/p10lppt13_rb~_html.html">p10lppt13_rb~.html</a>
|
201
|
+
|
202
|
+
<li class="file"><a href="../doc/rdoc_css.html">rdoc.css</a>
|
203
|
+
|
204
|
+
<li class="file"><a href="../doc/table_of_contents_html.html">table_of_contents.html</a>
|
205
|
+
|
206
|
+
<li class="file"><a href="../fraccion_rb~.html">fraccion.rb~</a>
|
207
|
+
|
208
|
+
<li class="file"><a href="../gcd_rb~.html">gcd.rb~</a>
|
209
|
+
|
210
|
+
<li class="file"><a href="../p10lppt13_rb~.html">p10lppt13.rb~</a>
|
211
|
+
|
212
|
+
</ul>
|
213
|
+
</nav>
|
214
|
+
|
215
|
+
<nav id="classindex-section" class="section project-section">
|
216
|
+
<h3 class="section-header">Class and Module Index</h3>
|
217
|
+
|
218
|
+
<ul class="link-list">
|
219
|
+
|
220
|
+
<li><a href="../Densa.html">Densa</a>
|
221
|
+
|
222
|
+
<li><a href="../Dispersa.html">Dispersa</a>
|
223
|
+
|
224
|
+
<li><a href="../Fraccion.html">Fraccion</a>
|
225
|
+
|
226
|
+
<li><a href="../Matriz.html">Matriz</a>
|
227
|
+
|
228
|
+
<li><a href="../Object.html">Object</a>
|
229
|
+
|
230
|
+
<li><a href="../P10lppt13.html">P10lppt13</a>
|
231
|
+
|
232
|
+
<li><a href="../VectorDisperso.html">VectorDisperso</a>
|
233
|
+
|
234
|
+
</ul>
|
235
|
+
</nav>
|
236
|
+
|
237
|
+
</div>
|
238
|
+
</nav>
|
239
|
+
|
240
|
+
<div id="documentation" class="description">
|
241
|
+
|
242
|
+
<p><!DOCTYPE html></p>
|
243
|
+
|
244
|
+
<p><html> <head> <meta content=“text/html; charset=UTF-8”
|
245
|
+
http-equiv=“Content-Type”></p>
|
246
|
+
|
247
|
+
<p><title>class <a href="../Matriz.html">Matriz</a> - RDoc
|
248
|
+
Documentation</title></p>
|
249
|
+
|
250
|
+
<p><link type=“text/css” media=“screen” href=“./rdoc.css”
|
251
|
+
rel=“stylesheet”></p>
|
252
|
+
|
253
|
+
<p><script type=“text/javascript”></p>
|
254
|
+
|
255
|
+
<pre>var rdoc_rel_prefix = "./";</pre>
|
256
|
+
|
257
|
+
<p></script></p>
|
258
|
+
|
259
|
+
<p><script type=“text/javascript” charset=“utf-8”
|
260
|
+
src=“./js/jquery.js”></script> <script type=“text/javascript”
|
261
|
+
charset=“utf-8” src=“./js/navigation.js”></script> <script
|
262
|
+
type=“text/javascript” charset=“utf-8”
|
263
|
+
src=“./js/search_index.js”></script> <script
|
264
|
+
type=“text/javascript” charset=“utf-8”
|
265
|
+
src=“./js/search.js”></script> <script type=“text/javascript”
|
266
|
+
charset=“utf-8” src=“./js/searcher.js”></script> <script
|
267
|
+
type=“text/javascript” charset=“utf-8”
|
268
|
+
src=“./js/darkfish.js”></script></p>
|
269
|
+
|
270
|
+
<p><body id=“top” class=“class”> <nav id=“metadata”></p>
|
271
|
+
|
272
|
+
<pre><nav id="home-section" class="section">
|
273
|
+
<h3 class="section-header">
|
274
|
+
<a href="./index.html">Home</a>
|
275
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
276
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
277
|
+
</h3></pre>
|
278
|
+
|
279
|
+
<p></nav></p>
|
280
|
+
|
281
|
+
<pre><nav id="search-section" class="section project-section" class="initially-hidden">
|
282
|
+
<form action="#" method="get" accept-charset="utf-8">
|
283
|
+
<h3 class="section-header">
|
284
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
285
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
286
|
+
</h3>
|
287
|
+
</form>
|
288
|
+
|
289
|
+
<ul id="search-results" class="initially-hidden"></ul></pre>
|
290
|
+
|
291
|
+
<p></nav></p>
|
292
|
+
|
293
|
+
<pre><div id="file-metadata">
|
294
|
+
<nav id="file-list-section" class="section">
|
295
|
+
<h3 class="section-header">Defined In</h3>
|
296
|
+
<ul>
|
297
|
+
<li>p10lppt13.rb
|
298
|
+
</ul></pre>
|
299
|
+
|
300
|
+
<p></nav></p>
|
301
|
+
|
302
|
+
<pre></div>
|
303
|
+
|
304
|
+
<div id="class-metadata">
|
305
|
+
|
306
|
+
<nav id="parent-class-section" class="section">
|
307
|
+
<h3 class="section-header">Parent</h3>
|
308
|
+
|
309
|
+
<p class="link"><a href="Object.html">Object</a></pre>
|
310
|
+
|
311
|
+
<p></nav></p>
|
312
|
+
|
313
|
+
<pre><!-- Method Quickref --></pre>
|
314
|
+
|
315
|
+
<p><nav id=“method-list-section” class=“section”></p>
|
316
|
+
|
317
|
+
<pre><h3 class="section-header">Methods</h3>
|
318
|
+
|
319
|
+
<ul class="link-list">
|
320
|
+
|
321
|
+
<li ><a href="#method-c-new">::new</a>
|
322
|
+
|
323
|
+
<li ><a href="#method-i-2A">#*</a>
|
324
|
+
|
325
|
+
<li ><a href="#method-i-2B">#+</a>
|
326
|
+
|
327
|
+
<li ><a href="#method-i-2D">#-</a>
|
328
|
+
|
329
|
+
<li ><a href="#method-i-colum">#colum</a>
|
330
|
+
|
331
|
+
<li ><a href="#method-i-filas">#filas</a>
|
332
|
+
|
333
|
+
<li ><a href="#method-i-max">#max</a>
|
334
|
+
|
335
|
+
<li ><a href="#method-i-min">#min</a>
|
336
|
+
|
337
|
+
<li ><a href="#method-i-por">#por</a>
|
338
|
+
|
339
|
+
<li ><a href="#method-i-porf">#porf</a>
|
340
|
+
|
341
|
+
<li ><a href="#method-i-primervalor">#primervalor</a>
|
342
|
+
|
343
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
344
|
+
|
345
|
+
<li ><a href="#method-i-trasponer">#trasponer</a>
|
346
|
+
|
347
|
+
<li ><a href="#method-i-vectorizar">#vectorizar</a>
|
348
|
+
|
349
|
+
</ul></pre>
|
350
|
+
|
351
|
+
<p></nav></p>
|
352
|
+
|
353
|
+
<pre></div>
|
354
|
+
|
355
|
+
<div id="project-metadata">
|
356
|
+
<nav id="fileindex-section" class="section project-section">
|
357
|
+
<h3 class="section-header">Pages</h3>
|
358
|
+
|
359
|
+
<ul>
|
360
|
+
|
361
|
+
<li class="file"><a href="./doc/Densa_html.html">Densa.html</a>
|
362
|
+
|
363
|
+
<li class="file"><a href="./doc/Dispersa_html.html">Dispersa.html</a>
|
364
|
+
|
365
|
+
<li class="file"><a href="./doc/Fraccion_html.html">Fraccion.html</a>
|
366
|
+
|
367
|
+
<li class="file"><a href="./doc/Matriz_html.html">Matriz.html</a>
|
368
|
+
|
369
|
+
<li class="file"><a href="./doc/Object_html.html">Object.html</a>
|
370
|
+
|
371
|
+
<li class="file"><a href="./doc/P10lppt13_html.html">P10lppt13.html</a>
|
372
|
+
|
373
|
+
<li class="file"><a href="./doc/VectorDisperso_html.html">VectorDisperso.html</a>
|
374
|
+
|
375
|
+
<li class="file"><a href="./doc/created_rid.html">created.rid</a>
|
376
|
+
|
377
|
+
<li class="file"><a href="./doc/doc/Densa_html_html.html">Densa_html.html</a>
|
378
|
+
|
379
|
+
<li class="file"><a href="./doc/doc/Dispersa_html_html.html">Dispersa_html.html</a>
|
380
|
+
|
381
|
+
<li class="file"><a href="./doc/doc/Fraccion_html_html.html">Fraccion_html.html</a>
|
382
|
+
|
383
|
+
<li class="file"><a href="./doc/doc/Matriz_html_html.html">Matriz_html.html</a>
|
384
|
+
|
385
|
+
<li class="file"><a href="./doc/doc/Object_html_html.html">Object_html.html</a>
|
386
|
+
|
387
|
+
<li class="file"><a href="./doc/doc/P10lppt13_html_html.html">P10lppt13_html.html</a>
|
388
|
+
|
389
|
+
<li class="file"><a href="./doc/doc/VectorDisperso_html_html.html">VectorDisperso_html.html</a>
|
390
|
+
|
391
|
+
<li class="file"><a href="./doc/doc/created_rid_html.html">created_rid.html</a>
|
392
|
+
|
393
|
+
<li class="file"><a href="./doc/doc/doc/Densa_html_html_html.html">Densa_html_html.html</a>
|
394
|
+
|
395
|
+
<li class="file"><a href="./doc/doc/doc/Dispersa_html_html_html.html">Dispersa_html_html.html</a>
|
396
|
+
|
397
|
+
<li class="file"><a href="./doc/doc/doc/Fraccion_html_html_html.html">Fraccion_html_html.html</a>
|
398
|
+
|
399
|
+
<li class="file"><a href="./doc/doc/doc/Matriz_html_html_html.html">Matriz_html_html.html</a>
|
400
|
+
|
401
|
+
<li class="file"><a href="./doc/doc/doc/Object_html_html_html.html">Object_html_html.html</a>
|
402
|
+
|
403
|
+
<li class="file"><a href="./doc/doc/doc/P10lppt13_html_html_html.html">P10lppt13_html_html.html</a>
|
404
|
+
|
405
|
+
<li class="file"><a href="./doc/doc/doc/VectorDisperso_html_html_html.html">VectorDisperso_html_html.html</a>
|
406
|
+
|
407
|
+
<li class="file"><a href="./doc/doc/doc/created_rid_html_html.html">created_rid_html.html</a>
|
408
|
+
|
409
|
+
<li class="file"><a href="./doc/doc/doc/doc/created_rid_html_html_html.html">created_rid_html_html.html</a>
|
410
|
+
|
411
|
+
<li class="file"><a href="./doc/doc/doc/fraccion_rb~_html_html_html.html">fraccion_rb~_html_html.html</a>
|
412
|
+
|
413
|
+
<li class="file"><a href="./doc/doc/doc/index_html_html_html.html">index_html_html.html</a>
|
414
|
+
|
415
|
+
<li class="file"><a href="./doc/doc/doc/js/darkfish_js_html_html.html">darkfish_js_html.html</a>
|
416
|
+
|
417
|
+
<li class="file"><a href="./doc/doc/doc/js/jquery_js_html_html.html">jquery_js_html.html</a>
|
418
|
+
|
419
|
+
<li class="file"><a href="./doc/doc/doc/js/navigation_js_html_html.html">navigation_js_html.html</a>
|
420
|
+
|
421
|
+
<li class="file"><a href="./doc/doc/doc/js/search_index_js_html_html.html">search_index_js_html.html</a>
|
422
|
+
|
423
|
+
<li class="file"><a href="./doc/doc/doc/js/search_js_html_html.html">search_js_html.html</a>
|
424
|
+
|
425
|
+
<li class="file"><a href="./doc/doc/doc/js/searcher_js_html_html.html">searcher_js_html.html</a>
|
426
|
+
|
427
|
+
<li class="file"><a href="./doc/doc/doc/rdoc_css_html_html.html">rdoc_css_html.html</a>
|
428
|
+
|
429
|
+
<li class="file"><a href="./doc/doc/doc/table_of_contents_html_html_html.html">table_of_contents_html_html.html</a>
|
430
|
+
|
431
|
+
<li class="file"><a href="./doc/doc/fraccion_rb~_html_html.html">fraccion_rb~_html.html</a>
|
432
|
+
|
433
|
+
<li class="file"><a href="./doc/doc/index_html_html.html">index_html.html</a>
|
434
|
+
|
435
|
+
<li class="file"><a href="./doc/doc/js/darkfish_js_html.html">darkfish_js.html</a>
|
436
|
+
|
437
|
+
<li class="file"><a href="./doc/doc/js/jquery_js_html.html">jquery_js.html</a>
|
438
|
+
|
439
|
+
<li class="file"><a href="./doc/doc/js/navigation_js_html.html">navigation_js.html</a>
|
440
|
+
|
441
|
+
<li class="file"><a href="./doc/doc/js/search_index_js_html.html">search_index_js.html</a>
|
442
|
+
|
443
|
+
<li class="file"><a href="./doc/doc/js/search_js_html.html">search_js.html</a>
|
444
|
+
|
445
|
+
<li class="file"><a href="./doc/doc/js/searcher_js_html.html">searcher_js.html</a>
|
446
|
+
|
447
|
+
<li class="file"><a href="./doc/doc/p10lppt13_rb~_html_html.html">p10lppt13_rb~_html.html</a>
|
448
|
+
|
449
|
+
<li class="file"><a href="./doc/doc/rdoc_css_html.html">rdoc_css.html</a>
|
450
|
+
|
451
|
+
<li class="file"><a href="./doc/doc/table_of_contents_html_html.html">table_of_contents_html.html</a>
|
452
|
+
|
453
|
+
<li class="file"><a href="./doc/fraccion_rb~_html.html">fraccion_rb~.html</a>
|
454
|
+
|
455
|
+
<li class="file"><a href="./doc/index_html.html">index.html</a>
|
456
|
+
|
457
|
+
<li class="file"><a href="./doc/js/darkfish_js.html">darkfish.js</a>
|
458
|
+
|
459
|
+
<li class="file"><a href="./doc/js/jquery_js.html">jquery.js</a>
|
460
|
+
|
461
|
+
<li class="file"><a href="./doc/js/navigation_js.html">navigation.js</a>
|
462
|
+
|
463
|
+
<li class="file"><a href="./doc/js/search_js.html">search.js</a>
|
464
|
+
|
465
|
+
<li class="file"><a href="./doc/js/search_index_js.html">search_index.js</a>
|
466
|
+
|
467
|
+
<li class="file"><a href="./doc/js/searcher_js.html">searcher.js</a>
|
468
|
+
|
469
|
+
<li class="file"><a href="./doc/p10lppt13_rb~_html.html">p10lppt13_rb~.html</a>
|
470
|
+
|
471
|
+
<li class="file"><a href="./doc/rdoc_css.html">rdoc.css</a>
|
472
|
+
|
473
|
+
<li class="file"><a href="./doc/table_of_contents_html.html">table_of_contents.html</a>
|
474
|
+
|
475
|
+
<li class="file"><a href="./fraccion_rb~.html">fraccion.rb~</a>
|
476
|
+
|
477
|
+
<li class="file"><a href="./p10lppt13_rb~.html">p10lppt13.rb~</a>
|
478
|
+
|
479
|
+
</ul></pre>
|
480
|
+
|
481
|
+
<p></nav></p>
|
482
|
+
|
483
|
+
<pre> <nav id="classindex-section" class="section project-section">
|
484
|
+
<h3 class="section-header">Class and Module Index</h3>
|
485
|
+
|
486
|
+
<ul class="link-list">
|
487
|
+
|
488
|
+
<li><a href="./Densa.html">Densa</a>
|
489
|
+
|
490
|
+
<li><a href="./Dispersa.html">Dispersa</a>
|
491
|
+
|
492
|
+
<li><a href="./Fraccion.html">Fraccion</a>
|
493
|
+
|
494
|
+
<li><a href="./Matriz.html">Matriz</a>
|
495
|
+
|
496
|
+
<li><a href="./Object.html">Object</a>
|
497
|
+
|
498
|
+
<li><a href="./P10lppt13.html">P10lppt13</a>
|
499
|
+
|
500
|
+
<li><a href="./VectorDisperso.html">VectorDisperso</a>
|
501
|
+
|
502
|
+
</ul></pre>
|
503
|
+
|
504
|
+
<p></nav></p>
|
505
|
+
|
506
|
+
<pre></div></pre>
|
507
|
+
|
508
|
+
<p></nav></p>
|
509
|
+
|
510
|
+
<p><div id=“documentation”></p>
|
511
|
+
|
512
|
+
<pre class="ruby"><span class="ruby-operator"><</span><span class="ruby-identifier">h1</span> <span class="ruby-identifier">class</span>=<span class="ruby-string">"class"</span><span class="ruby-operator">></span><span class="ruby-keyword">class</span> <span class="ruby-constant">Matriz</span><span class="ruby-operator"><</span><span class="ruby-regexp">/h1>
|
513
|
+
|
514
|
+
<div id="description" class="description">
|
515
|
+
</span></pre>
|
516
|
+
|
517
|
+
<p><p>Clase base <a href=“Matriz.html”>Matriz</a>, que
|
518
|
+
guarda el numero de filas y columnas</p></p>
|
519
|
+
|
520
|
+
<pre></div><!-- description -->
|
521
|
+
|
522
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
523
|
+
|
524
|
+
<!-- Attributes -->
|
525
|
+
<section id="attribute-method-details" class="method-section section">
|
526
|
+
<h3 class="section-header">Attributes</h3>
|
527
|
+
|
528
|
+
<div id="attribute-i-ncol" class="method-detail">
|
529
|
+
<div class="method-heading attribute-method-heading">
|
530
|
+
<span class="method-name">ncol</span><span
|
531
|
+
class="attribute-access-type">[R]</span>
|
532
|
+
</div>
|
533
|
+
|
534
|
+
<div class="method-description">
|
535
|
+
|
536
|
+
<p>Variable que almacena el numero de columnas de la matriz</p>
|
537
|
+
|
538
|
+
</div>
|
539
|
+
</div>
|
540
|
+
|
541
|
+
<div id="attribute-i-nfil" class="method-detail">
|
542
|
+
<div class="method-heading attribute-method-heading">
|
543
|
+
<span class="method-name">nfil</span><span
|
544
|
+
class="attribute-access-type">[R]</span>
|
545
|
+
</div>
|
546
|
+
|
547
|
+
<div class="method-description">
|
548
|
+
|
549
|
+
<p>Variable que almacena el numero de filas de la matriz</p>
|
550
|
+
|
551
|
+
</div>
|
552
|
+
</div>
|
553
|
+
|
554
|
+
</section><!-- attribute-method-details -->
|
555
|
+
|
556
|
+
<!-- Methods -->
|
557
|
+
|
558
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
559
|
+
<h3 class="section-header">Public Class Methods</h3>
|
560
|
+
|
561
|
+
<div id="method-c-new" class="method-detail ">
|
562
|
+
|
563
|
+
<div class="method-heading">
|
564
|
+
<span class="method-name">new</span><span
|
565
|
+
class="method-args">(nfil, ncol)</span>
|
566
|
+
|
567
|
+
<span class="method-click-advice">click to toggle source</span>
|
568
|
+
|
569
|
+
</div>
|
570
|
+
|
571
|
+
<div class="method-description">
|
572
|
+
|
573
|
+
<p>Metodo initilize de la clase base</p>
|
574
|
+
|
575
|
+
<div class="method-source-code" id="new-source">
|
576
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 12</span></pre>
|
577
|
+
|
578
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
579
|
+
class=“ruby-identifier”>initialize</span>(<span
|
580
|
+
class=“ruby-identifier”>nfil</span>, <span
|
581
|
+
class=“ruby-identifier”>ncol</span>)</p>
|
582
|
+
|
583
|
+
<pre><span class="ruby-ivar">@nfil</span> = <span class="ruby-identifier">nfil</span>
|
584
|
+
<span class="ruby-ivar">@ncol</span> = <span class="ruby-identifier">ncol</span></pre>
|
585
|
+
|
586
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
587
|
+
|
588
|
+
<pre> </div><!-- new-source -->
|
589
|
+
|
590
|
+
</div>
|
591
|
+
|
592
|
+
</div><!-- new-method -->
|
593
|
+
|
594
|
+
</section><!-- public-class-method-details -->
|
595
|
+
|
596
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
597
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
598
|
+
|
599
|
+
<div id="method-i-2A" class="method-detail ">
|
600
|
+
|
601
|
+
<div class="method-heading">
|
602
|
+
<span class="method-name">*</span><span
|
603
|
+
class="method-args">(other)</span>
|
604
|
+
|
605
|
+
<span class="method-click-advice">click to toggle source</span>
|
606
|
+
|
607
|
+
</div>
|
608
|
+
|
609
|
+
<div class="method-description">
|
610
|
+
|
611
|
+
<p>Metodo para multiplicar una matriz por un escalar</p>
|
612
|
+
|
613
|
+
<div class="method-source-code" id="2A-source">
|
614
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 184</span></pre>
|
615
|
+
|
616
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
617
|
+
class=“ruby-operator”>*</span>(<span
|
618
|
+
class=“ruby-identifier”>other</span>)</p>
|
619
|
+
|
620
|
+
<pre><span class="ruby-identifier">elemento</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
621
|
+
<span class="ruby-ivar">@nfil</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
622
|
+
<span class="ruby-identifier">fila</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
623
|
+
<span class="ruby-ivar">@ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
624
|
+
<span class="ruby-keyword">if</span> (<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>)
|
625
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]<span class="ruby-operator">*</span><span class="ruby-identifier">other</span>
|
626
|
+
<span class="ruby-keyword">else</span>
|
627
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
628
|
+
<span class="ruby-keyword">end</span>
|
629
|
+
<span class="ruby-keyword">end</span>
|
630
|
+
<span class="ruby-identifier">elemento</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fila</span>
|
631
|
+
<span class="ruby-keyword">end</span>
|
632
|
+
<span class="ruby-constant">Densa</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@nfil</span>, <span class="ruby-ivar">@ncol</span>, <span class="ruby-identifier">elemento</span>)</pre>
|
633
|
+
|
634
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
635
|
+
|
636
|
+
<pre> </div><!-- 2A-source -->
|
637
|
+
|
638
|
+
</div>
|
639
|
+
|
640
|
+
</div><!-- 2A-method -->
|
641
|
+
|
642
|
+
<div id="method-i-2B" class="method-detail ">
|
643
|
+
|
644
|
+
<div class="method-heading">
|
645
|
+
<span class="method-name">+</span><span
|
646
|
+
class="method-args">(other)</span>
|
647
|
+
|
648
|
+
<span class="method-click-advice">click to toggle source</span>
|
649
|
+
|
650
|
+
</div>
|
651
|
+
|
652
|
+
<div class="method-description">
|
653
|
+
|
654
|
+
<p>Metodo para sumar dos matrices (si tienen la misma dimension)</p>
|
655
|
+
|
656
|
+
<div class="method-source-code" id="2B-source">
|
657
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 40</span></pre>
|
658
|
+
|
659
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
660
|
+
class=“ruby-operator”>+</span>(<span
|
661
|
+
class=“ruby-identifier”>other</span>)</p>
|
662
|
+
|
663
|
+
<pre><span class="ruby-comment"># Primero se comprueba si se pueden sumar (si tienen la misma dimension)</span>
|
664
|
+
<span class="ruby-keyword">if</span> ((<span class="ruby-ivar">@nfil</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">nfil</span>) <span class="ruby-operator">||</span> (<span class="ruby-ivar">@ncol</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ncol</span>))
|
665
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;No se pueden sumar las matrices&quot;</span>
|
666
|
+
<span class="ruby-keyword">else</span>
|
667
|
+
<span class="ruby-identifier">elemento</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
668
|
+
<span class="ruby-ivar">@nfil</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
669
|
+
<span class="ruby-identifier">fila</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
670
|
+
<span class="ruby-ivar">@ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
671
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
672
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
673
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
|
674
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
675
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
|
676
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">0</span>
|
677
|
+
<span class="ruby-keyword">else</span>
|
678
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
679
|
+
<span class="ruby-keyword">end</span>
|
680
|
+
<span class="ruby-keyword">end</span>
|
681
|
+
<span class="ruby-identifier">elemento</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fila</span>
|
682
|
+
<span class="ruby-keyword">end</span>
|
683
|
+
<span class="ruby-constant">Densa</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@nfil</span>, <span class="ruby-ivar">@ncol</span>, <span class="ruby-identifier">elemento</span>)
|
684
|
+
<span class="ruby-keyword">end</span></pre>
|
685
|
+
|
686
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
687
|
+
|
688
|
+
<pre> </div><!-- 2B-source -->
|
689
|
+
|
690
|
+
</div>
|
691
|
+
|
692
|
+
</div><!-- 2B-method -->
|
693
|
+
|
694
|
+
<div id="method-i-2D" class="method-detail ">
|
695
|
+
|
696
|
+
<div class="method-heading">
|
697
|
+
<span class="method-name">-</span><span
|
698
|
+
class="method-args">(other)</span>
|
699
|
+
|
700
|
+
<span class="method-click-advice">click to toggle source</span>
|
701
|
+
|
702
|
+
</div>
|
703
|
+
|
704
|
+
<div class="method-description">
|
705
|
+
|
706
|
+
<p>Metodo para restar dos matrices (si tienen la misma dimension)</p>
|
707
|
+
|
708
|
+
<div class="method-source-code" id="2D-source">
|
709
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 66</span></pre>
|
710
|
+
|
711
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
712
|
+
class=“ruby-operator”>-</span>(<span
|
713
|
+
class=“ruby-identifier”>other</span>)</p>
|
714
|
+
|
715
|
+
<pre><span class="ruby-comment"># Primero se comprueba si se pueden restar (si tienen la misma dimension)</span>
|
716
|
+
<span class="ruby-keyword">if</span> ((<span class="ruby-ivar">@nfil</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">nfil</span>) <span class="ruby-operator">||</span> (<span class="ruby-ivar">@ncol</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ncol</span>))
|
717
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;No se pueden restar las matrices&quot;</span>
|
718
|
+
<span class="ruby-keyword">else</span>
|
719
|
+
<span class="ruby-identifier">elemento</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
720
|
+
<span class="ruby-ivar">@nfil</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
721
|
+
<span class="ruby-identifier">fila</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
722
|
+
<span class="ruby-ivar">@ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
723
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
724
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-operator">-</span><span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
725
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
|
726
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
727
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
|
728
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">0</span>
|
729
|
+
<span class="ruby-keyword">else</span>
|
730
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
731
|
+
<span class="ruby-keyword">end</span>
|
732
|
+
<span class="ruby-keyword">end</span>
|
733
|
+
<span class="ruby-identifier">elemento</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fila</span>
|
734
|
+
<span class="ruby-keyword">end</span>
|
735
|
+
<span class="ruby-constant">Densa</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@nfil</span>, <span class="ruby-ivar">@ncol</span>, <span class="ruby-identifier">elemento</span>)
|
736
|
+
<span class="ruby-keyword">end</span></pre>
|
737
|
+
|
738
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
739
|
+
|
740
|
+
<pre> </div><!-- 2D-source -->
|
741
|
+
|
742
|
+
</div>
|
743
|
+
|
744
|
+
</div><!-- 2D-method -->
|
745
|
+
|
746
|
+
<div id="method-i-colum" class="method-detail ">
|
747
|
+
|
748
|
+
<div class="method-heading">
|
749
|
+
<span class="method-name">colum</span><span
|
750
|
+
class="method-args">()</span>
|
751
|
+
|
752
|
+
<span class="method-click-advice">click to toggle source</span>
|
753
|
+
|
754
|
+
</div>
|
755
|
+
|
756
|
+
<div class="method-description">
|
757
|
+
|
758
|
+
<p>Getter de ncol (devuelve el numero de columnas de la matriz)</p>
|
759
|
+
|
760
|
+
<div class="method-source-code" id="colum-source">
|
761
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 23</span></pre>
|
762
|
+
|
763
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
764
|
+
class=“ruby-identifier”>colum</span></p>
|
765
|
+
|
766
|
+
<pre><span class="ruby-ivar">@ncol</span></pre>
|
767
|
+
|
768
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
769
|
+
|
770
|
+
<pre> </div><!-- colum-source -->
|
771
|
+
|
772
|
+
</div>
|
773
|
+
|
774
|
+
</div><!-- colum-method -->
|
775
|
+
|
776
|
+
<div id="method-i-filas" class="method-detail ">
|
777
|
+
|
778
|
+
<div class="method-heading">
|
779
|
+
<span class="method-name">filas</span><span
|
780
|
+
class="method-args">()</span>
|
781
|
+
|
782
|
+
<span class="method-click-advice">click to toggle source</span>
|
783
|
+
|
784
|
+
</div>
|
785
|
+
|
786
|
+
<div class="method-description">
|
787
|
+
|
788
|
+
<p>Getter de nfil (devuelve el numero de filas de la matriz)</p>
|
789
|
+
|
790
|
+
<div class="method-source-code" id="filas-source">
|
791
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 18</span></pre>
|
792
|
+
|
793
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
794
|
+
class=“ruby-identifier”>filas</span></p>
|
795
|
+
|
796
|
+
<pre><span class="ruby-ivar">@nfil</span></pre>
|
797
|
+
|
798
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
799
|
+
|
800
|
+
<pre> </div><!-- filas-source -->
|
801
|
+
|
802
|
+
</div>
|
803
|
+
|
804
|
+
</div><!-- filas-method -->
|
805
|
+
|
806
|
+
<div id="method-i-max" class="method-detail ">
|
807
|
+
|
808
|
+
<div class="method-heading">
|
809
|
+
<span class="method-name">max</span><span
|
810
|
+
class="method-args">()</span>
|
811
|
+
|
812
|
+
<span class="method-click-advice">click to toggle source</span>
|
813
|
+
|
814
|
+
</div>
|
815
|
+
|
816
|
+
<div class="method-description">
|
817
|
+
|
818
|
+
<p>Metodo para hallar el valor maximo de los elementos de una matriz</p>
|
819
|
+
|
820
|
+
<div class="method-source-code" id="max-source">
|
821
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 103</span></pre>
|
822
|
+
|
823
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
824
|
+
class=“ruby-identifier”>max</span></p>
|
825
|
+
|
826
|
+
<pre><span class="ruby-identifier">acum</span> = <span class="ruby-identifier">pos</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
|
827
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">filas</span>
|
828
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">j</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">colum</span>
|
829
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
830
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">acum</span>
|
831
|
+
<span class="ruby-identifier">acum</span> = <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
832
|
+
<span class="ruby-keyword">end</span>
|
833
|
+
<span class="ruby-keyword">end</span>
|
834
|
+
<span class="ruby-keyword">end</span>
|
835
|
+
<span class="ruby-keyword">end</span>
|
836
|
+
<span class="ruby-identifier">acum</span></pre>
|
837
|
+
|
838
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
839
|
+
|
840
|
+
<pre> </div><!-- max-source -->
|
841
|
+
|
842
|
+
</div>
|
843
|
+
|
844
|
+
</div><!-- max-method -->
|
845
|
+
|
846
|
+
<div id="method-i-min" class="method-detail ">
|
847
|
+
|
848
|
+
<div class="method-heading">
|
849
|
+
<span class="method-name">min</span><span
|
850
|
+
class="method-args">()</span>
|
851
|
+
|
852
|
+
<span class="method-click-advice">click to toggle source</span>
|
853
|
+
|
854
|
+
</div>
|
855
|
+
|
856
|
+
<div class="method-description">
|
857
|
+
|
858
|
+
<p>Metodo para hallar el valor minimo de los elementos de una matriz</p>
|
859
|
+
|
860
|
+
<div class="method-source-code" id="min-source">
|
861
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 118</span></pre>
|
862
|
+
|
863
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
864
|
+
class=“ruby-identifier”>min</span></p>
|
865
|
+
|
866
|
+
<pre><span class="ruby-identifier">acum</span> = <span class="ruby-identifier">pos</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
|
867
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">filas</span>
|
868
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">j</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">colum</span>
|
869
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
870
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">acum</span>
|
871
|
+
<span class="ruby-identifier">acum</span> = <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
872
|
+
<span class="ruby-keyword">end</span>
|
873
|
+
<span class="ruby-keyword">end</span>
|
874
|
+
<span class="ruby-keyword">end</span>
|
875
|
+
<span class="ruby-keyword">end</span>
|
876
|
+
<span class="ruby-identifier">acum</span></pre>
|
877
|
+
|
878
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
879
|
+
|
880
|
+
<pre> </div><!-- min-source -->
|
881
|
+
|
882
|
+
</div>
|
883
|
+
|
884
|
+
</div><!-- min-method -->
|
885
|
+
|
886
|
+
<div id="method-i-por" class="method-detail ">
|
887
|
+
|
888
|
+
<div class="method-heading">
|
889
|
+
<span class="method-name">por</span><span
|
890
|
+
class="method-args">(other)</span>
|
891
|
+
|
892
|
+
<span class="method-click-advice">click to toggle source</span>
|
893
|
+
|
894
|
+
</div>
|
895
|
+
|
896
|
+
<div class="method-description">
|
897
|
+
|
898
|
+
<p>Metodo para multiplicacion dos matrices</p>
|
899
|
+
|
900
|
+
<div class="method-source-code" id="por-source">
|
901
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 133</span></pre>
|
902
|
+
|
903
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
904
|
+
class=“ruby-identifier”>por</span>(<span
|
905
|
+
class=“ruby-identifier”>other</span>)</p>
|
906
|
+
|
907
|
+
<pre><span class="ruby-comment"># Primero se comprueba si se pueden multiplicar (las dimensiones deben ser nxm y mxn)</span>
|
908
|
+
<span class="ruby-keyword">if</span> ((<span class="ruby-ivar">@nfil</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ncol</span>) <span class="ruby-operator">||</span> (<span class="ruby-ivar">@ncol</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">nfil</span>))
|
909
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;No se pueden multiplicarr las matrices&quot;</span>
|
910
|
+
<span class="ruby-keyword">else</span>
|
911
|
+
<span class="ruby-identifier">elemento</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
912
|
+
<span class="ruby-ivar">@nfil</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
913
|
+
<span class="ruby-identifier">fila</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
914
|
+
<span class="ruby-identifier">other</span>.<span class="ruby-identifier">ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
915
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-value">0</span>
|
916
|
+
<span class="ruby-ivar">@ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
|
917
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">k</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">k</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
918
|
+
<span class="ruby-identifier">aux</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">k</span>] <span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">k</span>][<span class="ruby-identifier">j</span>]
|
919
|
+
<span class="ruby-keyword">end</span>
|
920
|
+
<span class="ruby-keyword">end</span>
|
921
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">aux</span>
|
922
|
+
<span class="ruby-keyword">end</span>
|
923
|
+
<span class="ruby-identifier">elemento</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fila</span>
|
924
|
+
<span class="ruby-keyword">end</span>
|
925
|
+
<span class="ruby-keyword">end</span>
|
926
|
+
<span class="ruby-constant">Densa</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@nfil</span>, <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ncol</span>, <span class="ruby-identifier">elemento</span>)</pre>
|
927
|
+
|
928
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
929
|
+
|
930
|
+
<pre> </div><!-- por-source -->
|
931
|
+
|
932
|
+
</div>
|
933
|
+
|
934
|
+
</div><!-- por-method -->
|
935
|
+
|
936
|
+
<div id="method-i-porf" class="method-detail ">
|
937
|
+
|
938
|
+
<div class="method-heading">
|
939
|
+
<span class="method-name">porf</span><span
|
940
|
+
class="method-args">(other)</span>
|
941
|
+
|
942
|
+
<span class="method-click-advice">click to toggle source</span>
|
943
|
+
|
944
|
+
</div>
|
945
|
+
|
946
|
+
<div class="method-description">
|
947
|
+
|
948
|
+
<p>Metodo para multiplicacion dos matrices</p>
|
949
|
+
|
950
|
+
<div class="method-source-code" id="porf-source">
|
951
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 157</span></pre>
|
952
|
+
|
953
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
954
|
+
class=“ruby-identifier”>porf</span>(<span
|
955
|
+
class=“ruby-identifier”>other</span>)</p>
|
956
|
+
|
957
|
+
<pre><span class="ruby-comment"># Primero se comprueba si se pueden multiplicar (las dimensiones deben ser nxm y mxn)</span>
|
958
|
+
<span class="ruby-keyword">if</span> ((<span class="ruby-ivar">@nfil</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ncol</span>) <span class="ruby-operator">||</span> (<span class="ruby-ivar">@ncol</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">nfil</span>))
|
959
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;No se pueden multiplicarr las matrices&quot;</span>
|
960
|
+
<span class="ruby-keyword">else</span>
|
961
|
+
<span class="ruby-identifier">elemento</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
962
|
+
<span class="ruby-ivar">@nfil</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
963
|
+
<span class="ruby-identifier">fila</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
964
|
+
<span class="ruby-identifier">other</span>.<span class="ruby-identifier">ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
965
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-constant">Fraccion</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">1</span>,<span class="ruby-value">1</span>)
|
966
|
+
<span class="ruby-identifier">aux</span> = <span class="ruby-identifier">aux</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">aux</span>
|
967
|
+
<span class="ruby-ivar">@ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
|
968
|
+
<span class="ruby-keyword">if</span> (<span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">k</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">k</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>)
|
969
|
+
<span class="ruby-identifier">aux</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">k</span>] <span class="ruby-operator">*</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">k</span>][<span class="ruby-identifier">j</span>]
|
970
|
+
<span class="ruby-keyword">else</span>
|
971
|
+
<span class="ruby-identifier">aux</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
972
|
+
<span class="ruby-keyword">end</span>
|
973
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">aux</span>
|
974
|
+
<span class="ruby-keyword">end</span>
|
975
|
+
<span class="ruby-keyword">end</span>
|
976
|
+
<span class="ruby-identifier">elemento</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fila</span>
|
977
|
+
<span class="ruby-keyword">end</span>
|
978
|
+
<span class="ruby-keyword">end</span>
|
979
|
+
<span class="ruby-constant">Densa</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@nfil</span>, <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ncol</span>, <span class="ruby-identifier">elemento</span>)</pre>
|
980
|
+
|
981
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
982
|
+
|
983
|
+
<pre> </div><!-- porf-source -->
|
984
|
+
|
985
|
+
</div>
|
986
|
+
|
987
|
+
</div><!-- porf-method -->
|
988
|
+
|
989
|
+
<div id="method-i-primervalor" class="method-detail ">
|
990
|
+
|
991
|
+
<div class="method-heading">
|
992
|
+
<span class="method-name">primervalor</span><span
|
993
|
+
class="method-args">()</span>
|
994
|
+
|
995
|
+
<span class="method-click-advice">click to toggle source</span>
|
996
|
+
|
997
|
+
</div>
|
998
|
+
|
999
|
+
<div class="method-description">
|
1000
|
+
|
1001
|
+
<p>Metodo para hallar el primer valor no nulo de una matriz</p>
|
1002
|
+
|
1003
|
+
<div class="method-source-code" id="primervalor-source">
|
1004
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 92</span></pre>
|
1005
|
+
|
1006
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
1007
|
+
class=“ruby-identifier”>primervalor</span></p>
|
1008
|
+
|
1009
|
+
<pre><span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-ivar">@nfil</span>
|
1010
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">j</span> <span class="ruby-keyword">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-ivar">@nncol</span>
|
1011
|
+
<span class="ruby-keyword">if</span> (<span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>)
|
1012
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
1013
|
+
<span class="ruby-keyword">end</span>
|
1014
|
+
<span class="ruby-keyword">end</span>
|
1015
|
+
<span class="ruby-keyword">end</span></pre>
|
1016
|
+
|
1017
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
1018
|
+
|
1019
|
+
<pre> </div><!-- primervalor-source -->
|
1020
|
+
|
1021
|
+
</div>
|
1022
|
+
|
1023
|
+
</div><!-- primervalor-method -->
|
1024
|
+
|
1025
|
+
<div id="method-i-to_s" class="method-detail ">
|
1026
|
+
|
1027
|
+
<div class="method-heading">
|
1028
|
+
<span class="method-name">to_s</span><span
|
1029
|
+
class="method-args">()</span>
|
1030
|
+
|
1031
|
+
<span class="method-click-advice">click to toggle source</span>
|
1032
|
+
|
1033
|
+
</div>
|
1034
|
+
|
1035
|
+
<div class="method-description">
|
1036
|
+
|
1037
|
+
<p>Metodo para convertir la matriz a string (a una cadena)</p>
|
1038
|
+
|
1039
|
+
<div class="method-source-code" id="to_s-source">
|
1040
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 28</span></pre>
|
1041
|
+
|
1042
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
1043
|
+
class=“ruby-identifier”>to_s</span></p>
|
1044
|
+
|
1045
|
+
<pre><span class="ruby-identifier">aux</span> = <span class="ruby-string">&quot;&quot;</span>
|
1046
|
+
<span class="ruby-ivar">@nfil</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
1047
|
+
<span class="ruby-ivar">@ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
1048
|
+
<span class="ruby-identifier">aux</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{pos[i][j]}\t&quot;</span>
|
1049
|
+
<span class="ruby-keyword">end</span>
|
1050
|
+
<span class="ruby-identifier">aux</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span>
|
1051
|
+
<span class="ruby-keyword">end</span>
|
1052
|
+
<span class="ruby-identifier">aux</span></pre>
|
1053
|
+
|
1054
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
1055
|
+
|
1056
|
+
<pre> </div><!-- to_s-source -->
|
1057
|
+
|
1058
|
+
</div>
|
1059
|
+
|
1060
|
+
</div><!-- to_s-method -->
|
1061
|
+
|
1062
|
+
<div id="method-i-trasponer" class="method-detail ">
|
1063
|
+
|
1064
|
+
<div class="method-heading">
|
1065
|
+
<span class="method-name">trasponer</span><span
|
1066
|
+
class="method-args">()</span>
|
1067
|
+
|
1068
|
+
<span class="method-click-advice">click to toggle source</span>
|
1069
|
+
|
1070
|
+
</div>
|
1071
|
+
|
1072
|
+
<div class="method-description">
|
1073
|
+
|
1074
|
+
<p>Metodo para hallar la traspuesta de una matriz</p>
|
1075
|
+
|
1076
|
+
<div class="method-source-code" id="trasponer-source">
|
1077
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 201</span></pre>
|
1078
|
+
|
1079
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
1080
|
+
class=“ruby-identifier”>trasponer</span></p>
|
1081
|
+
|
1082
|
+
<pre><span class="ruby-identifier">elemento</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
1083
|
+
<span class="ruby-ivar">@ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
1084
|
+
<span class="ruby-identifier">fila</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
1085
|
+
<span class="ruby-ivar">@nfil</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
1086
|
+
<span class="ruby-identifier">fila</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">j</span>][<span class="ruby-identifier">i</span>]
|
1087
|
+
<span class="ruby-keyword">end</span>
|
1088
|
+
<span class="ruby-identifier">elemento</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fila</span>
|
1089
|
+
<span class="ruby-keyword">end</span>
|
1090
|
+
<span class="ruby-constant">Densa</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@ncol</span>, <span class="ruby-ivar">@nfil</span>, <span class="ruby-identifier">elemento</span>)</pre>
|
1091
|
+
|
1092
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
1093
|
+
|
1094
|
+
<pre> </div><!-- trasponer-source -->
|
1095
|
+
|
1096
|
+
</div>
|
1097
|
+
|
1098
|
+
</div><!-- trasponer-method -->
|
1099
|
+
|
1100
|
+
<div id="method-i-vectorizar" class="method-detail ">
|
1101
|
+
|
1102
|
+
<div class="method-heading">
|
1103
|
+
<span class="method-name">vectorizar</span><span
|
1104
|
+
class="method-args">()</span>
|
1105
|
+
|
1106
|
+
<span class="method-click-advice">click to toggle source</span>
|
1107
|
+
|
1108
|
+
</div>
|
1109
|
+
|
1110
|
+
<div class="method-description">
|
1111
|
+
|
1112
|
+
<p>Metodo para convertir la matriz en un vector</p>
|
1113
|
+
|
1114
|
+
<div class="method-source-code" id="vectorizar-source">
|
1115
|
+
<pre><span class="ruby-comment"># File p10lppt13.rb, line 215</span></pre>
|
1116
|
+
|
1117
|
+
<p><span class=“ruby-keyword”>def</span> <span
|
1118
|
+
class=“ruby-identifier”>vectorizar</span></p>
|
1119
|
+
|
1120
|
+
<pre><span class="ruby-identifier">aux</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>)
|
1121
|
+
<span class="ruby-ivar">@ncol</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
1122
|
+
<span class="ruby-ivar">@nfil</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">j</span><span class="ruby-operator">|</span>
|
1123
|
+
<span class="ruby-identifier">aux</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">pos</span>[<span class="ruby-identifier">i</span>][<span class="ruby-identifier">j</span>]
|
1124
|
+
<span class="ruby-keyword">end</span>
|
1125
|
+
<span class="ruby-keyword">end</span>
|
1126
|
+
<span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">aux</span>)</pre>
|
1127
|
+
|
1128
|
+
<p><span class=“ruby-keyword”>end</span></pre></p>
|
1129
|
+
|
1130
|
+
<pre> </div><!-- vectorizar-source -->
|
1131
|
+
|
1132
|
+
</div>
|
1133
|
+
|
1134
|
+
</div><!-- vectorizar-method -->
|
1135
|
+
|
1136
|
+
</section><!-- public-instance-method-details -->
|
1137
|
+
|
1138
|
+
</section><!-- 5Buntitled-5D --></pre>
|
1139
|
+
|
1140
|
+
<p></div><!– documentation –></p>
|
1141
|
+
|
1142
|
+
<p><footer id=“validator-badges”></p>
|
1143
|
+
|
1144
|
+
<pre><p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
1145
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
1146
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.</pre>
|
1147
|
+
|
1148
|
+
<p></footer></p>
|
1149
|
+
|
1150
|
+
</div>
|
1151
|
+
|
1152
|
+
|
1153
|
+
|
1154
|
+
<footer id="validator-badges">
|
1155
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
1156
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
1157
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
1158
|
+
</footer>
|
1159
|
+
|