1 | <html xmlns:o="urn:schemas-microsoft-com:office:office" |
---|
2 | xmlns:w="urn:schemas-microsoft-com:office:word" |
---|
3 | xmlns="http://www.w3.org/TR/REC-html40"> |
---|
4 | |
---|
5 | <head> |
---|
6 | <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> |
---|
7 | <meta name=ProgId content=Word.Document> |
---|
8 | <meta name=Generator content="Microsoft Word 9"> |
---|
9 | <meta name=Originator content="Microsoft Word 9"> |
---|
10 | <link rel=File-List href="./la_files/filelist.xml"> |
---|
11 | <title>The Hume Linear Algebra Tcl Package</title> |
---|
12 | <!--[if gte mso 9]><xml> |
---|
13 | <o:DocumentProperties> |
---|
14 | <o:Author>Edward C. Hume, III</o:Author> |
---|
15 | <o:LastAuthor>Edward C. Hume, III</o:LastAuthor> |
---|
16 | <o:Revision>50</o:Revision> |
---|
17 | <o:TotalTime>3209</o:TotalTime> |
---|
18 | <o:Created>2001-07-08T13:41:00Z</o:Created> |
---|
19 | <o:LastSaved>2001-07-12T23:59:00Z</o:LastSaved> |
---|
20 | <o:Pages>15</o:Pages> |
---|
21 | <o:Words>4856</o:Words> |
---|
22 | <o:Characters>27681</o:Characters> |
---|
23 | <o:Company>Hume Integration Services</o:Company> |
---|
24 | <o:Lines>230</o:Lines> |
---|
25 | <o:Paragraphs>55</o:Paragraphs> |
---|
26 | <o:CharactersWithSpaces>33994</o:CharactersWithSpaces> |
---|
27 | <o:Version>9.2720</o:Version> |
---|
28 | </o:DocumentProperties> |
---|
29 | </xml><![endif]--><!--[if gte mso 9]><xml> |
---|
30 | <w:WordDocument> |
---|
31 | <w:View>Print</w:View> |
---|
32 | <w:ActiveWritingStyle Lang="EN-US" VendorID="64" DLLVersion="131077" |
---|
33 | NLCheck="1">1</w:ActiveWritingStyle> |
---|
34 | </w:WordDocument> |
---|
35 | </xml><![endif]--> |
---|
36 | <style> |
---|
37 | <!-- |
---|
38 | /* Font Definitions */ |
---|
39 | @font-face |
---|
40 | {font-family:"MS Mincho"; |
---|
41 | panose-1:2 2 6 9 4 2 5 8 3 4; |
---|
42 | mso-font-alt:"\FF2D\FF33 \660E\671D"; |
---|
43 | mso-font-charset:128; |
---|
44 | mso-generic-font-family:modern; |
---|
45 | mso-font-pitch:fixed; |
---|
46 | mso-font-signature:-1610612033 1757936891 16 0 131231 0;} |
---|
47 | @font-face |
---|
48 | {font-family:"\@MS Mincho"; |
---|
49 | panose-1:2 2 6 9 4 2 5 8 3 4; |
---|
50 | mso-font-charset:128; |
---|
51 | mso-generic-font-family:modern; |
---|
52 | mso-font-pitch:fixed; |
---|
53 | mso-font-signature:-1610612033 1757936891 16 0 131231 0;} |
---|
54 | /* Style Definitions */ |
---|
55 | p.MsoNormal, li.MsoNormal, div.MsoNormal |
---|
56 | {mso-style-parent:""; |
---|
57 | margin:0in; |
---|
58 | margin-bottom:.0001pt; |
---|
59 | mso-pagination:widow-orphan; |
---|
60 | font-size:12.0pt; |
---|
61 | font-family:"Times New Roman"; |
---|
62 | mso-fareast-font-family:"Times New Roman";} |
---|
63 | h1 |
---|
64 | {mso-style-next:Normal; |
---|
65 | margin-top:12.0pt; |
---|
66 | margin-right:0in; |
---|
67 | margin-bottom:3.0pt; |
---|
68 | margin-left:0in; |
---|
69 | mso-pagination:widow-orphan; |
---|
70 | page-break-after:avoid; |
---|
71 | mso-outline-level:1; |
---|
72 | font-size:16.0pt; |
---|
73 | font-family:Arial; |
---|
74 | mso-font-kerning:16.0pt;} |
---|
75 | h2 |
---|
76 | {mso-style-next:Normal; |
---|
77 | margin-top:12.0pt; |
---|
78 | margin-right:0in; |
---|
79 | margin-bottom:3.0pt; |
---|
80 | margin-left:0in; |
---|
81 | mso-pagination:widow-orphan; |
---|
82 | page-break-after:avoid; |
---|
83 | mso-outline-level:2; |
---|
84 | font-size:14.0pt; |
---|
85 | font-family:Arial; |
---|
86 | font-style:italic;} |
---|
87 | h3 |
---|
88 | {mso-style-next:Normal; |
---|
89 | margin-top:12.0pt; |
---|
90 | margin-right:0in; |
---|
91 | margin-bottom:3.0pt; |
---|
92 | margin-left:0in; |
---|
93 | mso-pagination:widow-orphan; |
---|
94 | page-break-after:avoid; |
---|
95 | mso-outline-level:3; |
---|
96 | font-size:13.0pt; |
---|
97 | font-family:Arial;} |
---|
98 | p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent |
---|
99 | {margin-top:0in; |
---|
100 | margin-right:0in; |
---|
101 | margin-bottom:0in; |
---|
102 | margin-left:.5in; |
---|
103 | margin-bottom:.0001pt; |
---|
104 | mso-pagination:widow-orphan; |
---|
105 | font-size:12.0pt; |
---|
106 | font-family:"Times New Roman"; |
---|
107 | mso-fareast-font-family:"MS Mincho";} |
---|
108 | a:link, span.MsoHyperlink |
---|
109 | {color:blue; |
---|
110 | text-decoration:underline; |
---|
111 | text-underline:single;} |
---|
112 | a:visited, span.MsoHyperlinkFollowed |
---|
113 | {color:purple; |
---|
114 | text-decoration:underline; |
---|
115 | text-underline:single;} |
---|
116 | p.MsoPlainText, li.MsoPlainText, div.MsoPlainText |
---|
117 | {margin:0in; |
---|
118 | margin-bottom:.0001pt; |
---|
119 | mso-pagination:widow-orphan; |
---|
120 | font-size:10.0pt; |
---|
121 | font-family:"Courier New"; |
---|
122 | mso-fareast-font-family:"MS Mincho";} |
---|
123 | pre |
---|
124 | {margin:0in; |
---|
125 | margin-bottom:.0001pt; |
---|
126 | mso-pagination:widow-orphan; |
---|
127 | font-size:10.0pt; |
---|
128 | font-family:"Courier New"; |
---|
129 | mso-fareast-font-family:"Courier New";} |
---|
130 | @page Section1 |
---|
131 | {size:8.5in 11.0in; |
---|
132 | margin:1.0in 65.95pt 1.0in 65.95pt; |
---|
133 | mso-header-margin:.5in; |
---|
134 | mso-footer-margin:.5in; |
---|
135 | mso-paper-source:0;} |
---|
136 | div.Section1 |
---|
137 | {page:Section1;} |
---|
138 | --> |
---|
139 | </style> |
---|
140 | </head> |
---|
141 | |
---|
142 | <body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'> |
---|
143 | |
---|
144 | <div class=Section1> |
---|
145 | |
---|
146 | <h1><span style='mso-fareast-font-family:"MS Mincho"'>The Hume Linear Algebra |
---|
147 | Tcl Package, La<o:p></o:p></span></h1> |
---|
148 | |
---|
149 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
150 | |
---|
151 | <h2><a name=features><span style='mso-fareast-font-family:"MS Mincho"'>Feature</span></a><span |
---|
152 | style='mso-fareast-font-family:"MS Mincho"'> Summary<o:p></o:p></span></h2> |
---|
153 | |
---|
154 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
155 | |
---|
156 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The |
---|
157 | package consists of Tcl procedures for the manipulation of vectors and |
---|
158 | matrices.<span style="mso-spacerun: yes"> </span>The functionality spans |
---|
159 | scaling, normalization, concatenation by rows or columns, subsetting by rows or |
---|
160 | columns, formatted printing, transpose, dot product, matrix multiplication, |
---|
161 | solution of linear equation sets, matrix inversion, eigenvalue/eigenvector |
---|
162 | solutions,<span style="mso-spacerun: yes"> </span>singular value |
---|
163 | decomposition, and solution of linear least squares.<span style="mso-spacerun: |
---|
164 | yes"> </span>The singular value decomposition can be used to perform the |
---|
165 | principle components analysis of multivariate statistical process control and |
---|
166 | avoid the possibly ill-conditioned multiplication of the XX<sup>t </sup><span |
---|
167 | style="mso-spacerun: yes"> </span>matrix of<span style="mso-spacerun: yes"> |
---|
168 | </span>observations.<o:p></o:p></span></p> |
---|
169 | |
---|
170 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
171 | |
---|
172 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The user can |
---|
173 | mix vectors and arrays in linear algebra operations.<span style="mso-spacerun: |
---|
174 | yes"> </span>The logic does reasonable conversion of types.<span |
---|
175 | style="mso-spacerun: yes"> </span>Sophisticated operations such as evaluating |
---|
176 | a custom procedure against each element of a matrix are easily possible.<span |
---|
177 | style="mso-spacerun: yes"> </span>Data is represented as ordinary Tcl list |
---|
178 | variables so that the usual commands of Tcl are useable, and efficient access |
---|
179 | to the data elements using compiled extensions is possible.<o:p></o:p></span></p> |
---|
180 | |
---|
181 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
182 | |
---|
183 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>This |
---|
184 | document and the package are ©Copyright 2001, Hume Integration Services.<span |
---|
185 | style="mso-spacerun: yes"> </span>You may use the package without licensing |
---|
186 | fees according to the <a href="#_License_Terms">License Terms</a>.<o:p></o:p></span></p> |
---|
187 | |
---|
188 | <h1><a name=userguide><span style='mso-fareast-font-family:"MS Mincho"'>User |
---|
189 | Guide</span></a><span style='mso-fareast-font-family:"MS Mincho"'><o:p></o:p></span></h1> |
---|
190 | |
---|
191 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
192 | |
---|
193 | <h2><a name=Obtaining><span style='mso-fareast-font-family:"MS Mincho"'>Obtaining |
---|
194 | the Package</span></a><span style='mso-fareast-font-family:"MS Mincho"'><o:p></o:p></span></h2> |
---|
195 | |
---|
196 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
197 | |
---|
198 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The |
---|
199 | package may be obtained from the webpage <a href="http://www.hume.com/la" |
---|
200 | target="_blank">http://www.hume.com/la</a>.<span style="mso-spacerun: yes"> |
---|
201 | </span>The package uses the "string is" Tcl command which was new |
---|
202 | with Tcl 8.1.<span style="mso-spacerun: yes"> </span>So unless you are |
---|
203 | comfortable making minor changes to the Tcl source code, you should only use |
---|
204 | the package with Tcl version 8.1 and newer.<span style="mso-spacerun: yes"> |
---|
205 | </span>The version 1.0 package only consists of text files, there are no binary |
---|
206 | files.<span style="mso-spacerun: yes"> </span>The only difference between the |
---|
207 | Windows archive and the POSIX archive is the difference in line feed / carriage |
---|
208 | return characters at the end of each line of text.<span style="mso-spacerun: |
---|
209 | yes"> </span>The package is distributed as zip archives.<span |
---|
210 | style="mso-spacerun: yes"> </span>You are expected to use your own software to |
---|
211 | unpack the archive files.<span style="mso-spacerun: yes"> </span><o:p></o:p></span></p> |
---|
212 | |
---|
213 | <h2><a name=Installation><span style='mso-fareast-font-family:"MS Mincho"'>Installation</span></a><span |
---|
214 | style='mso-fareast-font-family:"MS Mincho"'><o:p></o:p></span></h2> |
---|
215 | |
---|
216 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
217 | |
---|
218 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The |
---|
219 | package is installed by extracting from the zip archive file, the package |
---|
220 | directory and files.<span style="mso-spacerun: yes"> </span>The package |
---|
221 | directory should be added into the base directory of the Tcl runtime libraries.<span |
---|
222 | style="mso-spacerun: yes"> </span>So if your Tcl runtime library directory is |
---|
223 | /usr/local/lib/tcl8.3, copy or extract the la1.0 directory and files to |
---|
224 | /usr/local/lib so that you have the directory /usr/local/lib/la1.0 and the |
---|
225 | package files are found as /usr/local/lib/la1.0/*.* .<span style="mso-spacerun: |
---|
226 | yes"> </span>The Tcl code should be compatible with Tcl version 8.1 and later |
---|
227 | for any architecture, but we have only tested it with Tcl 8.3.<span |
---|
228 | style="mso-spacerun: yes"> </span>You can run the package regression tests by |
---|
229 | navigating to the package directory and sourcing the file la.test.<o:p></o:p></span></p> |
---|
230 | |
---|
231 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
232 | |
---|
233 | <h2><a name=runtime><span style='mso-fareast-font-family:"MS Mincho"'>Runtime </span></a><span |
---|
234 | style='mso-fareast-font-family:"MS Mincho"'>Usage<o:p></o:p></span></h2> |
---|
235 | |
---|
236 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
237 | |
---|
238 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The software |
---|
239 | is found and made useable by your Tcl/Tk interpreter after you execute package |
---|
240 | require La.<span style="mso-spacerun: yes"> </span>You typically import the |
---|
241 | package procedure names into your global namespace to save yourself from having |
---|
242 | to qualify the procedure names using the package name.<span |
---|
243 | style="mso-spacerun: yes"> </span>So typical initialization code looks like:<o:p></o:p></span></p> |
---|
244 | |
---|
245 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
246 | |
---|
247 | <p class=MsoPlainText style='margin-left:.5in'>% package require La</p> |
---|
248 | |
---|
249 | <p class=MsoPlainText style='margin-left:.5in'>1.0</p> |
---|
250 | |
---|
251 | <p class=MsoPlainText style='margin-left:.5in'>% namespace import La::*</p> |
---|
252 | |
---|
253 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
254 | |
---|
255 | <h2><a name=Operand><span style='mso-fareast-font-family:"MS Mincho"'>Operand</span></a><span |
---|
256 | style='mso-fareast-font-family:"MS Mincho"'> Formats<o:p></o:p></span></h2> |
---|
257 | |
---|
258 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The |
---|
259 | package uses ordinary Tcl variables to represent scalars, vectors, and |
---|
260 | arrays.<span style="mso-spacerun: yes"> </span>This means that the ordinary |
---|
261 | Tcl commands are useable.<span style="mso-spacerun: yes"> </span>For example, |
---|
262 | the Tcl set command can be used to copy a matrix:<o:p></o:p></span></p> |
---|
263 | |
---|
264 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
265 | |
---|
266 | <p class=MsoPlainText style='margin-left:.5in'>set A [mident 5]<span |
---|
267 | style="mso-spacerun: yes"> </span>;# A is assigned a 5x5 identity matrix </p> |
---|
268 | |
---|
269 | <p class=MsoPlainText style='margin-left:.5in'>set B $A<span |
---|
270 | style="mso-spacerun: yes"> </span>;# B is assigned the value of A</p> |
---|
271 | |
---|
272 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><span |
---|
273 | style="mso-spacerun: yes"> </span><o:p></o:p></span></p> |
---|
274 | |
---|
275 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Tcl list |
---|
276 | formats are used for better performance than arrays and for better |
---|
277 | compatibility with C/C++ code.<span style="mso-spacerun: yes"> |
---|
278 | </span>Dimension information is added in a simple way at the front of the list, |
---|
279 | for vectors, matrices, and higher dimensional variables.<o:p></o:p></span></p> |
---|
280 | |
---|
281 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
282 | |
---|
283 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>Scalar Format<span |
---|
284 | style="mso-spacerun: yes"> </span><o:p></o:p></span></h3> |
---|
285 | |
---|
286 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>If the |
---|
287 | list length of a variable is 1 the operand is a scalar, eg., |
---|
288 | "6.02e23".<span style="mso-spacerun: yes"> </span>The Tcl command |
---|
289 | llength can be used to determine the list length.<o:p></o:p></span></p> |
---|
290 | |
---|
291 | <h3>Vector Format</h3> |
---|
292 | |
---|
293 | <p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
294 | |
---|
295 | <p class=MsoBodyTextIndent style='margin-left:0in'>A vector of length N has the |
---|
296 | representation as a Tcl list of:</p> |
---|
297 | |
---|
298 | <p class=MsoBodyTextIndent><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
299 | |
---|
300 | <p class=MsoPlainText style='margin-left:1.0in'>2 N 0 v[0] v[1] v[2] ... v[N-1]</p> |
---|
301 | |
---|
302 | <p class=MsoPlainText style='margin-left:1.0in'><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
303 | |
---|
304 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The first |
---|
305 | element in the list, the value 2, signifies that there are two additional |
---|
306 | elements of size information; the number of rows, and the number of |
---|
307 | columns.<span style="mso-spacerun: yes"> </span>When the number of columns is |
---|
308 | 0, the operand is defined to be a</span> one dimensional vector.<span |
---|
309 | style="mso-spacerun: yes"> </span>So the Tcl list sequence of {2 4 0 1 2 3 4} |
---|
310 | represents the vector <span style='font-size:10.0pt'>{1 2 3 4}</span>.<span |
---|
311 | style="mso-spacerun: yes"> </span>A vector of length N has the same number of |
---|
312 | elements as an Nx1 or 1xN matrix so they can be efficiently converted in place, |
---|
313 | and indexing operations are simplified.</p> |
---|
314 | |
---|
315 | <p class=MsoBodyTextIndent><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
316 | |
---|
317 | <p class=MsoBodyTextIndent style='margin-left:0in'>The index into the |
---|
318 | underlying Tcl list for vector <span style='font-size:10.0pt;font-family:"Courier New"; |
---|
319 | mso-fareast-font-family:"Times New Roman"'>v[i]</span> is</p> |
---|
320 | |
---|
321 | <p class=MsoPlainText><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
322 | |
---|
323 | <p class=MsoPlainText style='margin-left:1.0in'>set index [expr {3 + $i}]</p> |
---|
324 | |
---|
325 | <p class=MsoPlainText style='margin-left:1.0in'><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
326 | |
---|
327 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>A vector |
---|
328 | of length N is promoted to an N rows by 1 column matrix if used in an operation |
---|
329 | where a matrix argument is expected.<o:p></o:p></span></p> |
---|
330 | |
---|
331 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
332 | "MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
333 | |
---|
334 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The |
---|
335 | transpose of a vector of length N is a 1 row by N columns matrix.<o:p></o:p></span></p> |
---|
336 | |
---|
337 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>Matrix Format<o:p></o:p></span></h3> |
---|
338 | |
---|
339 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
340 | |
---|
341 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The Tcl |
---|
342 | list data used to represent two dimensional matrix a[R,C], has the format:<o:p></o:p></span></p> |
---|
343 | |
---|
344 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
345 | |
---|
346 | <p class=MsoPlainText style='margin-left:.5in'>2 R C a[0,0] a[0,1] a[0,2] ... |
---|
347 | a[0,C-1] \</p> |
---|
348 | |
---|
349 | <p class=MsoPlainText style='margin-left:1.0in'>a[1,0] a[1,1] ... a[1,C-1] \</p> |
---|
350 | |
---|
351 | <p class=MsoPlainText style='margin-left:1.0in'>... a[R-1,C-1]<span |
---|
352 | style="mso-spacerun: yes"> </span></p> |
---|
353 | |
---|
354 | <p class=MsoPlainText style='margin-left:1.0in'><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
355 | |
---|
356 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>where R is |
---|
357 | the number of rows, and C is the number of columns, and the backslash character |
---|
358 | has been used to indicate that the multiple lines of text constitute a single |
---|
359 | list sequence.<span style="mso-spacerun: yes"> </span>The format itself is |
---|
360 | independent of whether the user thinks that indexing starts from 0 or 1.<span |
---|
361 | style="mso-spacerun: yes"> </span>In Tcl, indexing of lists always starts with |
---|
362 | 0 so we have chosen to consistently start indexing with 0.<o:p></o:p></span></p> |
---|
363 | |
---|
364 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
365 | |
---|
366 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>For a |
---|
367 | valid matrix, both the number of rows and the number of columns are positive |
---|
368 | integers.<span style="mso-spacerun: yes"> </span>The data elements following |
---|
369 | the {2 R C} dimension information can also be thought of as first row, second |
---|
370 | row,
, last row.<span style="mso-spacerun: yes"> </span>The index into the |
---|
371 | underlying Tcl list for </span><span style='font-size:10.0pt;font-family:"Courier New"'>a[i,j]</span><span |
---|
372 | style='mso-fareast-font-family:"MS Mincho"'> is:<o:p></o:p></span></p> |
---|
373 | |
---|
374 | <p class=MsoPlainText style='margin-left:.5in'><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
375 | |
---|
376 | <p class=MsoPlainText style='margin-left:.5in'>set index [expr {3 + $i * $C + |
---|
377 | $j}]</p> |
---|
378 | |
---|
379 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><span |
---|
380 | style="mso-spacerun: yes"> </span><o:p></o:p></span></p> |
---|
381 | |
---|
382 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>Higher Dimensions<o:p></o:p></span></h3> |
---|
383 | |
---|
384 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
385 | |
---|
386 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>If the |
---|
387 | first element in a Tcl list is > 2, the package assumes the list represents |
---|
388 | a higher dimensional operand.<span style="mso-spacerun: yes"> </span>Logic for |
---|
389 | higher dimension operands is not currently part of the package.<span |
---|
390 | style="mso-spacerun: yes"> </span><o:p></o:p></span></p> |
---|
391 | |
---|
392 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
393 | |
---|
394 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The |
---|
395 | candidate structure for 3-D data is:<o:p></o:p></span></p> |
---|
396 | |
---|
397 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
398 | |
---|
399 | <p class=MsoPlainText style='margin-left:.5in'>3 P R C a[0,0,0] a[0,0,1] |
---|
400 | a[0,0,2] ... a[0,0,C-1] ... a[P-1,R-1,C-1]</p> |
---|
401 | |
---|
402 | <p class=MsoPlainText style='margin-left:.5in'><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
403 | |
---|
404 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>where |
---|
405 | P=planes, R=rows, C=columns.<span style="mso-spacerun: yes"> </span>An |
---|
406 | intuitive view is that the data is multiple 2-D planes of rows and columns |
---|
407 | listed in order from the 0 plane to the P-1 plane.<span style="mso-spacerun: |
---|
408 | yes"> </span><o:p></o:p></span></p> |
---|
409 | |
---|
410 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
411 | |
---|
412 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The index |
---|
413 | into the underlying Tcl list for </span>a[i,j,k]<span style='mso-fareast-font-family: |
---|
414 | "MS Mincho"'> is<o:p></o:p></span></p> |
---|
415 | |
---|
416 | <p class=MsoPlainText style='margin-left:.5in'><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
417 | |
---|
418 | <p class=MsoPlainText style='margin-left:.5in'>set index [expr 4 + $i*$R*$c + |
---|
419 | $j*$c + $k]</p> |
---|
420 | |
---|
421 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
422 | |
---|
423 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>Operand Examples<o:p></o:p></span></h3> |
---|
424 | |
---|
425 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
426 | |
---|
427 | <p class=MsoPlainText>set pi 3.1415<span style='mso-tab-count:1'> </span><span |
---|
428 | style='mso-tab-count:1'> </span>;# a scalar</p> |
---|
429 | |
---|
430 | <p class=MsoPlainText>set v {2 1 0 3.1415}<span style="mso-spacerun: yes"> |
---|
431 | </span>;# v[1] with value 3.1415</p> |
---|
432 | |
---|
433 | <p class=MsoPlainText># vectors should use the first dimension of 2</p> |
---|
434 | |
---|
435 | <p class=MsoPlainText>set v {2 0 1 3.1415}<span style="mso-spacerun: yes"> |
---|
436 | </span>;# error - vector should use first dimension only</p> |
---|
437 | |
---|
438 | <p class=MsoPlainText>set v {2 3 0 1 2 3 4}<span style="mso-spacerun: yes"> |
---|
439 | </span>;# error - vector has an additional element</p> |
---|
440 | |
---|
441 | <p class=MsoPlainText>set m {2 2 3 1 2 3 4 5 6}<span style="mso-spacerun: |
---|
442 | yes"> </span>;# m[2,3]</p> |
---|
443 | |
---|
444 | <p class=MsoPlainText>show $m</p> |
---|
445 | |
---|
446 | <p class=MsoPlainText>1 2 3</p> |
---|
447 | |
---|
448 | <p class=MsoPlainText>4 5 6</p> |
---|
449 | |
---|
450 | <p class=MsoPlainText>show [transpose $m]</p> |
---|
451 | |
---|
452 | <p class=MsoPlainText>1 4</p> |
---|
453 | |
---|
454 | <p class=MsoPlainText>2 5</p> |
---|
455 | |
---|
456 | <p class=MsoPlainText>3 6</p> |
---|
457 | |
---|
458 | <p class=MsoPlainText><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
459 | |
---|
460 | <h2><a name=Passing><span style='mso-fareast-font-family:"MS Mincho"'>Argument</span></a><span |
---|
461 | style='mso-fareast-font-family:"MS Mincho"'> Passing By Value and By Reference <o:p></o:p></span></h2> |
---|
462 | |
---|
463 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>There are |
---|
464 | typically two procedures defined for an algorithm.<span style="mso-spacerun: |
---|
465 | yes"> </span>A plainly named procedure such as "transpose", and |
---|
466 | another procedure with the suffix <b>_br</b> such as |
---|
467 | "transpose_br".<span style="mso-spacerun: yes"> </span>The plainly |
---|
468 | named procedures expect their data arguments to be passed by value, which is |
---|
469 | the usual argument passing convention with Tcl programming.<span |
---|
470 | style="mso-spacerun: yes"> </span>The plain calls are designed for ease of |
---|
471 | interactive use, and in general have been coded to perform more conversion of |
---|
472 | arguments, more error checking, and to trade off efficiency for |
---|
473 | convenience.<span style="mso-spacerun: yes"> </span>The <b>_br</b> procedures |
---|
474 | are intended for efficent use, with the <b>_br</b> indicating that data |
---|
475 | arguments are passed "By Reference" to avoid copying the data.<span |
---|
476 | style="mso-spacerun: yes"> </span>In Tcl, to pass by reference means that the |
---|
477 | caller has the data in a named variable, and the caller passes the name of the |
---|
478 | variable instead of a copy of the data.<span style="mso-spacerun: yes"> |
---|
479 | </span>You can see that passing by reference is more efficient for larger |
---|
480 | vectors and arrays.<span style="mso-spacerun: yes"> </span>The <b>_br</b> |
---|
481 | procedures in general assume that the data arguments have the correct |
---|
482 | structure, so the caller may need to use the <b>promote</b>, <b>demote</b>, and |
---|
483 | <b>transpose</b> calls to prepare arguments for a <b>_br</b> call.<o:p></o:p></span></p> |
---|
484 | |
---|
485 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
486 | |
---|
487 | <h2><a name=performance><span style='mso-fareast-font-family:"MS Mincho"'>A |
---|
488 | Note on Performance</span></a><span style='mso-fareast-font-family:"MS Mincho"'><o:p></o:p></span></h2> |
---|
489 | |
---|
490 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
491 | |
---|
492 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Number |
---|
493 | crunching in Tcl?<span style="mso-spacerun: yes"> </span>The conventional |
---|
494 | wisdom is that computationally intensive tasks such as numerical analysis are |
---|
495 | high on the list of things that you should not do in a scripting language.<span |
---|
496 | style="mso-spacerun: yes"> </span>It is true that you can obtain better |
---|
497 | performance using a traditional compiled language such as Fortran, or C |
---|
498 | code.<span style="mso-spacerun: yes"> </span>But nowadays, the performance |
---|
499 | gain that you will obtain by switching languages is similar to the performance |
---|
500 | gain you will see between a new computer and a computer from two years |
---|
501 | ago.<span style="mso-spacerun: yes"> </span>In many situations, the actual |
---|
502 | time spent processing numbers is a small portion of the overall project.<span |
---|
503 | style="mso-spacerun: yes"> </span>The time it takes the researcher to explore |
---|
504 | his data, decide on the desired approach, and develop the software for his |
---|
505 | desired analysis is the only performance time that really matters.<span |
---|
506 | style="mso-spacerun: yes"> </span>Here, a high-level development environment |
---|
507 | such as Tcl or MATLAB wins over C++ or Java hands down.<span |
---|
508 | style="mso-spacerun: yes"> </span>Actual performance numbers for the Tcl |
---|
509 | package are nothing to be ashamed about.<span style="mso-spacerun: yes"> |
---|
510 | </span>Using a 900Mhz Pentium III notebook computer, the following times were |
---|
511 | obtained for inverting an NxN matrix using Gauss elimination with partial |
---|
512 | pivoting.<span style="mso-spacerun: yes"> </span>This is something of a worst |
---|
513 | case since most numerical algorithms avoid the direct inversion of a full |
---|
514 | matrix.<span style="mso-spacerun: yes"> </span>Often a major performance |
---|
515 | improvement is made by choosing a better algorithm.<o:p></o:p></span></p> |
---|
516 | |
---|
517 | <p class=MsoPlainText><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
518 | |
---|
519 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
520 | |
---|
521 | <table border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse; |
---|
522 | border:none;mso-border-alt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt'> |
---|
523 | <tr> |
---|
524 | <td width=655 colspan=2 valign=top style='width:490.9pt;border:solid windowtext .5pt; |
---|
525 | padding:0in 5.4pt 0in 5.4pt'> |
---|
526 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Inversion |
---|
527 | of an NxN matrix. <o:p></o:p></span></p> |
---|
528 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
529 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Development |
---|
530 | time for the following timed benchmark: 15 seconds.<span style="mso-spacerun: |
---|
531 | yes"> </span>It worked properly on the first attempt.<span |
---|
532 | style="mso-spacerun: yes"> </span>The flush and update commands are not |
---|
533 | needed except to show progress before completion.<span style="mso-spacerun: |
---|
534 | yes"> </span>The benchmark:<o:p></o:p></span></p> |
---|
535 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
536 | <p class=MsoPlainText>% source la.tcl</p> |
---|
537 | <p class=MsoPlainText>% namespace import La::*</p> |
---|
538 | <p class=MsoPlainText>% foreach n {10 20 50 100} {</p> |
---|
539 | <p class=MsoPlainText><span style="mso-spacerun: yes"> </span>puts [time |
---|
540 | {msolve [mdingdong $n] [mident $n]}]</p> |
---|
541 | <p class=MsoPlainText><span style="mso-spacerun: yes"> </span>flush stdout</p> |
---|
542 | <p class=MsoPlainText><span style="mso-spacerun: yes"> </span>update</p> |
---|
543 | <p class=MsoPlainText><span style="mso-spacerun: yes"> </span>}<span |
---|
544 | style='font-size:12.0pt'><o:p></o:p></span></p> |
---|
545 | </td> |
---|
546 | </tr> |
---|
547 | <tr> |
---|
548 | <td width=327 valign=top style='width:245.45pt;border:solid windowtext .5pt; |
---|
549 | border-top:none;mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
550 | <p class=MsoNormal><b><span style='mso-fareast-font-family:"MS Mincho"'>Matrix |
---|
551 | Dimension (N)<o:p></o:p></span></b></p> |
---|
552 | </td> |
---|
553 | <td width=327 valign=top style='width:245.45pt;border-top:none;border-left: |
---|
554 | none;border-bottom:solid windowtext .5pt;border-right:solid windowtext .5pt; |
---|
555 | mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; |
---|
556 | padding:0in 5.4pt 0in 5.4pt'> |
---|
557 | <p class=MsoNormal><b><span style='mso-fareast-font-family:"MS Mincho"'>Inversion |
---|
558 | Time (seconds)<o:p></o:p></span></b></p> |
---|
559 | </td> |
---|
560 | </tr> |
---|
561 | <tr> |
---|
562 | <td width=327 valign=top style='width:245.45pt;border:solid windowtext .5pt; |
---|
563 | border-top:none;mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
564 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>10<o:p></o:p></span></p> |
---|
565 | </td> |
---|
566 | <td width=327 valign=top style='width:245.45pt;border-top:none;border-left: |
---|
567 | none;border-bottom:solid windowtext .5pt;border-right:solid windowtext .5pt; |
---|
568 | mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; |
---|
569 | padding:0in 5.4pt 0in 5.4pt'> |
---|
570 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>0.020<o:p></o:p></span></p> |
---|
571 | </td> |
---|
572 | </tr> |
---|
573 | <tr> |
---|
574 | <td width=327 valign=top style='width:245.45pt;border:solid windowtext .5pt; |
---|
575 | border-top:none;mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
576 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>20<o:p></o:p></span></p> |
---|
577 | </td> |
---|
578 | <td width=327 valign=top style='width:245.45pt;border-top:none;border-left: |
---|
579 | none;border-bottom:solid windowtext .5pt;border-right:solid windowtext .5pt; |
---|
580 | mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; |
---|
581 | padding:0in 5.4pt 0in 5.4pt'> |
---|
582 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>0.140<o:p></o:p></span></p> |
---|
583 | </td> |
---|
584 | </tr> |
---|
585 | <tr> |
---|
586 | <td width=327 valign=top style='width:245.45pt;border:solid windowtext .5pt; |
---|
587 | border-top:none;mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
588 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>50<o:p></o:p></span></p> |
---|
589 | </td> |
---|
590 | <td width=327 valign=top style='width:245.45pt;border-top:none;border-left: |
---|
591 | none;border-bottom:solid windowtext .5pt;border-right:solid windowtext .5pt; |
---|
592 | mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; |
---|
593 | padding:0in 5.4pt 0in 5.4pt'> |
---|
594 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>1.973<o:p></o:p></span></p> |
---|
595 | </td> |
---|
596 | </tr> |
---|
597 | <tr> |
---|
598 | <td width=327 valign=top style='width:245.45pt;border:solid windowtext .5pt; |
---|
599 | border-top:none;mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
600 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>100<o:p></o:p></span></p> |
---|
601 | </td> |
---|
602 | <td width=327 valign=top style='width:245.45pt;border-top:none;border-left: |
---|
603 | none;border-bottom:solid windowtext .5pt;border-right:solid windowtext .5pt; |
---|
604 | mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt; |
---|
605 | padding:0in 5.4pt 0in 5.4pt'> |
---|
606 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>15.43<o:p></o:p></span></p> |
---|
607 | </td> |
---|
608 | </tr> |
---|
609 | </table> |
---|
610 | |
---|
611 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
612 | |
---|
613 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Here are |
---|
614 | some tips for efficient coding.<span style="mso-spacerun: yes"> </span>In Tcl |
---|
615 | the <a href="..\mann\expr.html">expr</a> command is used for the evaluation of |
---|
616 | numeric expressions.<span style="mso-spacerun: yes"> </span>You should almost |
---|
617 | always surround the arguments to <b>expr</b> with braces to prevent the Tcl |
---|
618 | interpreter from substituting the arguments.<span style="mso-spacerun: yes"> |
---|
619 | </span>The <b>expr</b> command itself is able to substitute variable references |
---|
620 | directly and avoid re-interpreting their string representation.<span |
---|
621 | style="mso-spacerun: yes"> </span>For example:<o:p></o:p></span></p> |
---|
622 | |
---|
623 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
624 | |
---|
625 | <p class=MsoPlainText style='margin-left:.5in'>set index [expr {3 + $i * $C + |
---|
626 | $j}]<span style="mso-spacerun: yes"> </span>;# good example</p> |
---|
627 | |
---|
628 | <p class=MsoPlainText style='margin-left:.5in'>set index [expr 3 + $i*$C + |
---|
629 | $j]<span style="mso-spacerun: yes"> </span>;# less efficient example</p> |
---|
630 | |
---|
631 | <p class=MsoPlainText style='margin-left:.5in'><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
632 | |
---|
633 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The |
---|
634 | Windows NT/Windows 2000 Tk console does not perform very well when large text |
---|
635 | strings are displayed.<span style="mso-spacerun: yes"> </span>You may find it |
---|
636 | preferable to print results by separate rows for large output sets, or to write |
---|
637 | large output results to a file.<span style="mso-spacerun: yes"> </span>Another |
---|
638 | alternative to the Windows Tk console, is to use tclsh83.exe from a command |
---|
639 | window.<o:p></o:p></span></p> |
---|
640 | |
---|
641 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
642 | |
---|
643 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Tcl |
---|
644 | maintains an internal binary representation for variable values, and computes a |
---|
645 | string representation for a variable value only when needed.<span |
---|
646 | style="mso-spacerun: yes"> </span>If your logic is inconsistent and sometimes |
---|
647 | treats a variable as a string, and sometimes treats it as a list of numbers, |
---|
648 | you can cause inefficient shimmering of the internal representation.<span |
---|
649 | style="mso-spacerun: yes"> </span>For best efficiency use list oriented |
---|
650 | commands to manipulate your vector and matrix variables, and dont mix string |
---|
651 | oriented commands.<span style="mso-spacerun: yes"> </span>For example:<o:p></o:p></span></p> |
---|
652 | |
---|
653 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
654 | |
---|
655 | <p class=MsoPlainText><span style='mso-tab-count:1'> </span>lappend m |
---|
656 | $newvalue<span style="mso-spacerun: yes"> </span>;# good lappend is a list |
---|
657 | oriented procedure</p> |
---|
658 | |
---|
659 | <p class=MsoPlainText><span style="mso-spacerun: yes"> </span>append m |
---|
660 | " $newvalue"<span style="mso-spacerun: yes"> </span>;# bad, this |
---|
661 | causes conversion to a string</p> |
---|
662 | |
---|
663 | <p class=MsoPlainText><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
664 | |
---|
665 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The last |
---|
666 | tip is that it is very easy to use the built-in <a href="..\mann\time.html">time</a> |
---|
667 | command to analyze actual performance of your code.<span style="mso-spacerun: |
---|
668 | yes"> </span><o:p></o:p></span></p> |
---|
669 | |
---|
670 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
671 | |
---|
672 | <h2><a name="pca_example"><span style='mso-fareast-font-family:"MS Mincho"'>A PCA |
---|
673 | Example</span></a><span style='mso-fareast-font-family:"MS Mincho"'><o:p></o:p></span></h2> |
---|
674 | |
---|
675 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
676 | |
---|
677 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The |
---|
678 | package contains a worked Principle Components Analysis problem based on |
---|
679 | Section 6.5 of the SEMATECH/NIST Statistics Handbook, <a |
---|
680 | href="http://www.itl.nist.gov/div898/handbook" target="_blank">http://www.itl.nist.gov/div898/handbook</a>.<o:p></o:p></span></p> |
---|
681 | |
---|
682 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
683 | |
---|
684 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>See the |
---|
685 | file <a href="NIST.html" target="_blank">NIST.tcl</a>.<o:p></o:p></span></p> |
---|
686 | |
---|
687 | <h1><a name=reference><span style='mso-fareast-font-family:"MS Mincho"'>Reference</span></a><span |
---|
688 | style='mso-fareast-font-family:"MS Mincho"'><o:p></o:p></span></h1> |
---|
689 | |
---|
690 | <p class=MsoPlainText><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
691 | |
---|
692 | <h2><span style='mso-fareast-font-family:"MS Mincho"'>Alphabetical Procedure |
---|
693 | Table<o:p></o:p></span></h2> |
---|
694 | |
---|
695 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
696 | |
---|
697 | <table border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse; |
---|
698 | border:none;mso-border-alt:solid windowtext .5pt;mso-padding-alt:0in 5.4pt 0in 5.4pt'> |
---|
699 | <tr> |
---|
700 | <td valign=top style='border:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
701 | <p class=MsoNormal><b><span style='mso-fareast-font-family:"MS Mincho"'>Procedure |
---|
702 | Name(s)<o:p></o:p></span></b></p> |
---|
703 | </td> |
---|
704 | <td valign=top style='border:solid windowtext .5pt;border-left:none; |
---|
705 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
706 | <p class=MsoNormal><b><span style='mso-fareast-font-family:"MS Mincho"'>Description<o:p></o:p></span></b></p> |
---|
707 | </td> |
---|
708 | </tr> |
---|
709 | <tr> |
---|
710 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
711 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
712 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
713 | href="#demote">demote, demote_br</a><o:p></o:p></span></p> |
---|
714 | </td> |
---|
715 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
716 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
717 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
718 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Demote |
---|
719 | an Nx1 or 1xN matrix to a vector[N].<span style="mso-spacerun: yes"> |
---|
720 | </span>Demote a vector[1] to a scalar.<span style="mso-spacerun: yes"> |
---|
721 | </span>Call twice to demote a 1x1 matrix to scalar.<o:p></o:p></span></p> |
---|
722 | </td> |
---|
723 | </tr> |
---|
724 | <tr> |
---|
725 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
726 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
727 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
728 | href="#dim">dim, dim_br</a><o:p></o:p></span></p> |
---|
729 | </td> |
---|
730 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
731 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
732 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
733 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Return |
---|
734 | the dimension of the argument,<span style="mso-spacerun: yes"> </span>and to |
---|
735 | some degree verify a proper format.<o:p></o:p></span></p> |
---|
736 | </td> |
---|
737 | </tr> |
---|
738 | <tr> |
---|
739 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
740 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
741 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
742 | href="#dotprod">dotprod, dotprod_br</a><o:p></o:p></span></p> |
---|
743 | </td> |
---|
744 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
745 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
746 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
747 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Dot Product |
---|
748 | = sum over i, Ai * Bi<o:p></o:p></span></p> |
---|
749 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Can work |
---|
750 | columns or rows in matrices because indexing increments are optional |
---|
751 | arguments.<o:p></o:p></span></p> |
---|
752 | </td> |
---|
753 | </tr> |
---|
754 | <tr> |
---|
755 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
756 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
757 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
758 | href="#join_cols">join_cols, join_cols_br</a><o:p></o:p></span></p> |
---|
759 | </td> |
---|
760 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
761 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
762 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
763 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Combine |
---|
764 | vector or matrices as added columns.<o:p></o:p></span></p> |
---|
765 | </td> |
---|
766 | </tr> |
---|
767 | <tr> |
---|
768 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
769 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
770 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
771 | href="#join_rows">join_rows, join_rows_br</a><o:p></o:p></span></p> |
---|
772 | </td> |
---|
773 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
774 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
775 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
776 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Combine |
---|
777 | vector or matrices as added rows.<o:p></o:p></span></p> |
---|
778 | </td> |
---|
779 | </tr> |
---|
780 | <tr> |
---|
781 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
782 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
783 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
784 | href="#lassign">lassign, lassign_br</a><o:p></o:p></span></p> |
---|
785 | </td> |
---|
786 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
787 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
788 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
789 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Replace |
---|
790 | a single value in a Tcl list.<o:p></o:p></span></p> |
---|
791 | </td> |
---|
792 | </tr> |
---|
793 | <tr> |
---|
794 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
795 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
796 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
797 | href="#madd">madd</a><o:p></o:p></span></p> |
---|
798 | </td> |
---|
799 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
800 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
801 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
802 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Computes |
---|
803 | a new matrix or vector from the addition of corresponding elements in two |
---|
804 | operands.<o:p></o:p></span></p> |
---|
805 | </td> |
---|
806 | </tr> |
---|
807 | <tr> |
---|
808 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
809 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
810 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
811 | href="#madjust">madjust</a><o:p></o:p></span></p> |
---|
812 | </td> |
---|
813 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
814 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
815 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
816 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Apply a |
---|
817 | scale factor and offset to the operands elements.<o:p></o:p></span></p> |
---|
818 | </td> |
---|
819 | </tr> |
---|
820 | <tr> |
---|
821 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
822 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
823 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
824 | href="#mat_binary_op">mat_binary_op, mat_binary_op_br</a><o:p></o:p></span></p> |
---|
825 | </td> |
---|
826 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
827 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
828 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
829 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Perform |
---|
830 | binary operations such as addition on corresponding elements of vectors or |
---|
831 | matrices.<o:p></o:p></span></p> |
---|
832 | </td> |
---|
833 | </tr> |
---|
834 | <tr> |
---|
835 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
836 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
837 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
838 | href="#mat_unary_op">mat_unary_op, mat_unary_op_br</a><o:p></o:p></span></p> |
---|
839 | </td> |
---|
840 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
841 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
842 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
843 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Perform |
---|
844 | unary operations on elements like scaling.<o:p></o:p></span></p> |
---|
845 | </td> |
---|
846 | </tr> |
---|
847 | <tr> |
---|
848 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
849 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
850 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
851 | href="#mathprec">mathprec</a><o:p></o:p></span></p> |
---|
852 | </td> |
---|
853 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
854 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
855 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
856 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Returns |
---|
857 | the smallest number epsilon, such that 1+epsilon > 1.<o:p></o:p></span></p> |
---|
858 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Also |
---|
859 | reports on the machine radix, digits, and rounding behavior<o:p></o:p></span></p> |
---|
860 | </td> |
---|
861 | </tr> |
---|
862 | <tr> |
---|
863 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
864 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
865 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
866 | href="#mcols">mcols, mcols_br</a><o:p></o:p></span></p> |
---|
867 | </td> |
---|
868 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
869 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
870 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
871 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Return |
---|
872 | the number of columns in a matrix or vector.<span style="mso-spacerun: yes"> |
---|
873 | </span>You can use mrows and mcols to keep your software isolated from the |
---|
874 | details of the data representation.<o:p></o:p></span></p> |
---|
875 | </td> |
---|
876 | </tr> |
---|
877 | <tr> |
---|
878 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
879 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
880 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
881 | href="#mdiag">mdiag</a><o:p></o:p></span></p> |
---|
882 | </td> |
---|
883 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
884 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
885 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
886 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Creates |
---|
887 | a diagonal matrix from a vector, an Nx1 matrix, or a 1XN matrix.<o:p></o:p></span></p> |
---|
888 | </td> |
---|
889 | </tr> |
---|
890 | <tr> |
---|
891 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
892 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
893 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
894 | href="#mdingdong">mdingdong</a><o:p></o:p></span></p> |
---|
895 | </td> |
---|
896 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
897 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
898 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
899 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Create |
---|
900 | the Ding Dong test matrix, a Cauchy matrix that is represented inexactly in |
---|
901 | the machine, but very stable for inversion by elimination methods.<o:p></o:p></span></p> |
---|
902 | </td> |
---|
903 | </tr> |
---|
904 | <tr> |
---|
905 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
906 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
907 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
908 | href="#mdiv">mdiv</a><o:p></o:p></span></p> |
---|
909 | </td> |
---|
910 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
911 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
912 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
913 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Computes |
---|
914 | a new matrix or vector from the division of corresponding elements in two |
---|
915 | operands.<o:p></o:p></span></p> |
---|
916 | </td> |
---|
917 | </tr> |
---|
918 | <tr> |
---|
919 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
920 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
921 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
922 | href="#mevsvd">mevsvd, mevsvd_br</a><o:p></o:p></span></p> |
---|
923 | </td> |
---|
924 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
925 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
926 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
927 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Solve |
---|
928 | for the eigenvectors and eigenvalues of a real symmetric matrix by singular |
---|
929 | value decomposition.<o:p></o:p></span></p> |
---|
930 | </td> |
---|
931 | </tr> |
---|
932 | <tr> |
---|
933 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
934 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
935 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
936 | href="#mhilbert">mhilbert</a><o:p></o:p></span></p> |
---|
937 | </td> |
---|
938 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
939 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
940 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
941 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Create |
---|
942 | the Hilbert test matrix which is notorious for being<span |
---|
943 | style="mso-spacerun: yes"> </span>ill conditioned for eigenvector/eigenvalue |
---|
944 | solutions.<o:p></o:p></span></p> |
---|
945 | </td> |
---|
946 | </tr> |
---|
947 | <tr> |
---|
948 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
949 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
950 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
951 | href="#mident">mident</a><o:p></o:p></span></p> |
---|
952 | </td> |
---|
953 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
954 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
955 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
956 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Create |
---|
957 | an identity matrix of order N.<o:p></o:p></span></p> |
---|
958 | </td> |
---|
959 | </tr> |
---|
960 | <tr> |
---|
961 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
962 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
963 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
964 | href="#mlssvd">mlssvd</a><o:p></o:p></span></p> |
---|
965 | </td> |
---|
966 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
967 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
968 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
969 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Linear |
---|
970 | least squares solution for over-determined linear equations using singular |
---|
971 | value decomposition.<o:p></o:p></span></p> |
---|
972 | </td> |
---|
973 | </tr> |
---|
974 | <tr> |
---|
975 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
976 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
977 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
978 | href="#mmult">mmult, mmult_br</a><o:p></o:p></span></p> |
---|
979 | </td> |
---|
980 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
981 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
982 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
983 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Ordinary |
---|
984 | matrix multiplication.<o:p></o:p></span></p> |
---|
985 | </td> |
---|
986 | </tr> |
---|
987 | <tr> |
---|
988 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
989 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
990 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
991 | href="#mnorms">mnorms, mnorms_br</a><o:p></o:p></span></p> |
---|
992 | </td> |
---|
993 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
994 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
995 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
996 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Compute |
---|
997 | the means and standard deviations of each column.<o:p></o:p></span></p> |
---|
998 | </td> |
---|
999 | </tr> |
---|
1000 | <tr> |
---|
1001 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1002 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1003 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1004 | href="#mnormalize">mnormalize, mnormalize_br</a><o:p></o:p></span></p> |
---|
1005 | </td> |
---|
1006 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1007 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1008 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1009 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Normalize |
---|
1010 | each column by subtracting the corresponding mean and then dividing by the |
---|
1011 | corresponding standard deviation.<o:p></o:p></span></p> |
---|
1012 | </td> |
---|
1013 | </tr> |
---|
1014 | <tr> |
---|
1015 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1016 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1017 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1018 | href="#moffset">moffset</a><o:p></o:p></span></p> |
---|
1019 | </td> |
---|
1020 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1021 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1022 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1023 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Add a |
---|
1024 | constant to the elements of an operand.<o:p></o:p></span></p> |
---|
1025 | </td> |
---|
1026 | </tr> |
---|
1027 | <tr> |
---|
1028 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1029 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1030 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1031 | href="#mprod">mprod</a><o:p></o:p></span></p> |
---|
1032 | </td> |
---|
1033 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1034 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1035 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1036 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Computes |
---|
1037 | a new matrix or vector from the product of corresponding elements in two |
---|
1038 | operands.<o:p></o:p></span></p> |
---|
1039 | </td> |
---|
1040 | </tr> |
---|
1041 | <tr> |
---|
1042 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1043 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1044 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1045 | href="#mrange">mrange, mrange_br</a><o:p></o:p></span></p> |
---|
1046 | </td> |
---|
1047 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1048 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1049 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1050 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Return a |
---|
1051 | subset of selected columns, selected rows as a new matrix.<span |
---|
1052 | style="mso-spacerun: yes"> </span>Also can be used to reverse the ordering |
---|
1053 | when the start index > end index.<o:p></o:p></span></p> |
---|
1054 | </td> |
---|
1055 | </tr> |
---|
1056 | <tr> |
---|
1057 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1058 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1059 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1060 | href="#mround">mround, mround_br</a><o:p></o:p></span></p> |
---|
1061 | </td> |
---|
1062 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1063 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1064 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1065 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Round |
---|
1066 | off elements in a matrix if they are close to integers.<o:p></o:p></span></p> |
---|
1067 | </td> |
---|
1068 | </tr> |
---|
1069 | <tr> |
---|
1070 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1071 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1072 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1073 | href="#mrows">mrows, mrows_br</a><o:p></o:p></span></p> |
---|
1074 | </td> |
---|
1075 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1076 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1077 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1078 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Return |
---|
1079 | the number of rows in a matrix or vector.<span style="mso-spacerun: yes"> |
---|
1080 | </span>You can use mrows and mcols to keep your software isolated from the |
---|
1081 | details of the data representation.<o:p></o:p></span></p> |
---|
1082 | </td> |
---|
1083 | </tr> |
---|
1084 | <tr> |
---|
1085 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1086 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1087 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1088 | href="#mscale">mscale</a><o:p></o:p></span></p> |
---|
1089 | </td> |
---|
1090 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1091 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1092 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1093 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Multiply |
---|
1094 | each element in an operand by a factor.<o:p></o:p></span></p> |
---|
1095 | </td> |
---|
1096 | </tr> |
---|
1097 | <tr> |
---|
1098 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1099 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1100 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1101 | href="#msolve">msolve, msolve_br</a><o:p></o:p></span></p> |
---|
1102 | </td> |
---|
1103 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1104 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1105 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1106 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Solve |
---|
1107 | the matrix problem Ax = p for x, where p may be multiple columns.<span |
---|
1108 | style="mso-spacerun: yes"> </span>When p is the identity matrix, the |
---|
1109 | solution x, is the inverse of A.<span style="mso-spacerun: yes"> </span>Uses |
---|
1110 | Gauss elimination with partial pivoting.<o:p></o:p></span></p> |
---|
1111 | </td> |
---|
1112 | </tr> |
---|
1113 | <tr> |
---|
1114 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1115 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1116 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1117 | href="#msub">msub</a><o:p></o:p></span></p> |
---|
1118 | </td> |
---|
1119 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1120 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1121 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1122 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Computes |
---|
1123 | a new matrix or vector from the subtraction of corresponding elements in two |
---|
1124 | operands.<o:p></o:p></span></p> |
---|
1125 | </td> |
---|
1126 | </tr> |
---|
1127 | <tr> |
---|
1128 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1129 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1130 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1131 | href="#msum">msum, msum_br</a><o:p></o:p></span></p> |
---|
1132 | </td> |
---|
1133 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1134 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1135 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1136 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Compute |
---|
1137 | the sums of each column, returning a vector or scalar result.<span |
---|
1138 | style="mso-spacerun: yes"> </span>Call twice to get the total sum of columns |
---|
1139 | and rows (set total [msum [msum $a]]).<o:p></o:p></span></p> |
---|
1140 | </td> |
---|
1141 | </tr> |
---|
1142 | <tr> |
---|
1143 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1144 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1145 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1146 | href="#msvd">msvd</a><o:p></o:p></span></p> |
---|
1147 | </td> |
---|
1148 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1149 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1150 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1151 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Perform |
---|
1152 | the Singular Value Decomposition of a matrix.<o:p></o:p></span></p> |
---|
1153 | </td> |
---|
1154 | </tr> |
---|
1155 | <tr> |
---|
1156 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1157 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1158 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1159 | href="#promote">promote, promote_br</a><o:p></o:p></span></p> |
---|
1160 | </td> |
---|
1161 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1162 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1163 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1164 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Promote |
---|
1165 | a scalar or vector to an array.<span style="mso-spacerun: yes"> |
---|
1166 | </span>Vector[N] is promoted to an Nx1 array.<o:p></o:p></span></p> |
---|
1167 | </td> |
---|
1168 | </tr> |
---|
1169 | <tr> |
---|
1170 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1171 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1172 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1173 | href="#show">show, show_br</a><o:p></o:p></span></p> |
---|
1174 | </td> |
---|
1175 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1176 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1177 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1178 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Return a |
---|
1179 | formatted string representation for an operand.<span style="mso-spacerun: |
---|
1180 | yes"> </span>Options allow for specify the format of numbers, and the |
---|
1181 | strings used to separate column and row elements.<o:p></o:p></span></p> |
---|
1182 | </td> |
---|
1183 | </tr> |
---|
1184 | <tr> |
---|
1185 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1186 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1187 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1188 | href="#transpose">transpose, transpose_br</a><o:p></o:p></span></p> |
---|
1189 | </td> |
---|
1190 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1191 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1192 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1193 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Performs |
---|
1194 | the matrix transpose, exchanging [i,j] with [j,i].<span style="mso-spacerun: |
---|
1195 | yes"> </span>A vector is promoted to a 1xN array by transpose.<o:p></o:p></span></p> |
---|
1196 | </td> |
---|
1197 | </tr> |
---|
1198 | <tr> |
---|
1199 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1200 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1201 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1202 | href="#vdiag">vdiag, vdiag_br</a><o:p></o:p></span></p> |
---|
1203 | </td> |
---|
1204 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1205 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1206 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1207 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Create a |
---|
1208 | vector from the diagonal elements of a matrix.<o:p></o:p></span></p> |
---|
1209 | </td> |
---|
1210 | </tr> |
---|
1211 | <tr> |
---|
1212 | <td valign=top style='border:solid windowtext .5pt;border-top:none; |
---|
1213 | mso-border-top-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1214 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><a |
---|
1215 | href="#vtrim">vtrim, vtrim_br</a><o:p></o:p></span></p> |
---|
1216 | </td> |
---|
1217 | <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext .5pt; |
---|
1218 | border-right:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; |
---|
1219 | mso-border-left-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'> |
---|
1220 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>For a |
---|
1221 | vector or matrix operand, just return the actual data elements by trimming |
---|
1222 | away the dimension and size data in the front<o:p></o:p></span></p> |
---|
1223 | </td> |
---|
1224 | </tr> |
---|
1225 | </table> |
---|
1226 | |
---|
1227 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1228 | |
---|
1229 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1230 | |
---|
1231 | <h3><a name=demote><span style='mso-fareast-font-family:"MS Mincho"'>demote</span></a><span |
---|
1232 | style='mso-fareast-font-family:"MS Mincho"'> x<o:p></o:p></span></h3> |
---|
1233 | |
---|
1234 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>demote_br name_x_in |
---|
1235 | {name_out {}}<o:p></o:p></span></h3> |
---|
1236 | |
---|
1237 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1238 | |
---|
1239 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1240 | "MS Mincho"'>Demote an Nx1 or 1xN matrix to a vector[n].<span |
---|
1241 | style="mso-spacerun: yes"> </span>Demote a vector[1] to a scalar.<span |
---|
1242 | style="mso-spacerun: yes"> </span>Call twice to demote a 1x1 matrix to |
---|
1243 | scalar.<span style="mso-spacerun: yes"> </span>For the _br procedure, the |
---|
1244 | default output destination is to overwrite the input.<o:p></o:p></span></p> |
---|
1245 | |
---|
1246 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1247 | "MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1248 | |
---|
1249 | <h3 style='mso-pagination:widow-orphan lines-together'><a name=dim><span |
---|
1250 | style='mso-fareast-font-family:"MS Mincho"'>dim</span></a><span |
---|
1251 | style='mso-fareast-font-family:"MS Mincho"'> x<o:p></o:p></span></h3> |
---|
1252 | |
---|
1253 | <h3 style='mso-pagination:widow-orphan lines-together'><span style='mso-fareast-font-family: |
---|
1254 | "MS Mincho"'>dim_br name_x<o:p></o:p></span></h3> |
---|
1255 | |
---|
1256 | <p class=MsoNormal style='margin-left:.5in;mso-pagination:widow-orphan lines-together'><span |
---|
1257 | style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1258 | |
---|
1259 | <p class=MsoBodyTextIndent style='mso-pagination:widow-orphan lines-together'>Return |
---|
1260 | the dimension of the argument,<span style="mso-spacerun: yes"> </span>and to |
---|
1261 | some degree verify a proper format.<span style="mso-spacerun: yes"> </span>Returns |
---|
1262 | 0 for a scalar, 1 for a vector, 2 for a matrix, and an empty string, {}, for an |
---|
1263 | empty input value.<span style="mso-spacerun: yes"> </span>Most improper |
---|
1264 | formats will result in an error.</p> |
---|
1265 | |
---|
1266 | <h3><a name=dotprod>dotprod</a> a b {N {}} {a0index 3} {b0index 3} {ainc 1} |
---|
1267 | {binc 1}</h3> |
---|
1268 | |
---|
1269 | <h3>dotprod_br a_name b_name {N {}} {a0index 3} {b0index 3} {ainc 1} {binc 1}</h3> |
---|
1270 | |
---|
1271 | <p class=MsoBodyTextIndent>Perform the dot product of two operands, <b>a</b> |
---|
1272 | and <b>b</b>, returning a scalar result.<span style="mso-spacerun: yes"> |
---|
1273 | </span>The default arguments will correctly process vector and conformable 1xN |
---|
1274 | or Nx1 matrices.<span style="mso-spacerun: yes"> </span>The argument <b>N</b> |
---|
1275 | is the number of element pairs to multiply when computing the sum of pair |
---|
1276 | products.<span style="mso-spacerun: yes"> </span>The <b>a0index</b> and <b>b0index</b> |
---|
1277 | optional arguments are the offset of the first element in the <b>a</b> and <b>b</b> |
---|
1278 | operands, respectively.<span style="mso-spacerun: yes"> </span>The <b>ainc</b> |
---|
1279 | and <b>binc</b> optional arguments are the index increment values to be added |
---|
1280 | to the indexes into <b>a</b> and <b>b</b> to obtain subsequent elements.</p> |
---|
1281 | |
---|
1282 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1283 | "MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1284 | |
---|
1285 | <h3><a name="join_cols"><span style='mso-fareast-font-family:"MS Mincho"'>join_cols</span></a><span |
---|
1286 | style='mso-fareast-font-family:"MS Mincho"'> a b<o:p></o:p></span></h3> |
---|
1287 | |
---|
1288 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>join_cols_br {a_in b_in |
---|
1289 | {c_out {}}<o:p></o:p></span></h3> |
---|
1290 | |
---|
1291 | <p class=MsoBodyTextIndent>Combine vector or matrices as added columns, |
---|
1292 | returning a matrix result.<span style="mso-spacerun: yes"> </span>The |
---|
1293 | arguments must have the same number of rows.<span style="mso-spacerun: yes"> |
---|
1294 | </span>The default output for the <b>join_cols_br</b> call is to overwrite the<b> |
---|
1295 | a</b> input.</p> |
---|
1296 | |
---|
1297 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1298 | |
---|
1299 | <h3><a name="join_rows"><span style='mso-fareast-font-family:"MS Mincho"'>join_rows</span></a><span |
---|
1300 | style='mso-fareast-font-family:"MS Mincho"'> a b<o:p></o:p></span></h3> |
---|
1301 | |
---|
1302 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>join_rows_br {a_in b_in |
---|
1303 | {c_out {}}<o:p></o:p></span></h3> |
---|
1304 | |
---|
1305 | <p class=MsoBodyTextIndent>Combine vector or matrices as added rows, returning |
---|
1306 | a matrix result.<span style="mso-spacerun: yes"> </span>The arguments must |
---|
1307 | have the same number of columns.<span style="mso-spacerun: yes"> </span>The |
---|
1308 | default output for the <b>join_rows_br</b> call is to overwrite the <b>a</b> |
---|
1309 | input.</p> |
---|
1310 | |
---|
1311 | <h3><a name=lassign><span style='mso-fareast-font-family:"MS Mincho"'>lassign</span></a><span |
---|
1312 | style='mso-fareast-font-family:"MS Mincho"'> list index value<o:p></o:p></span></h3> |
---|
1313 | |
---|
1314 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>lassign_br listname index |
---|
1315 | value<o:p></o:p></span></h3> |
---|
1316 | |
---|
1317 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1318 | "MS Mincho"'>Replace a single element in a Tcl list.<span style="mso-spacerun: |
---|
1319 | yes"> </span>There is conditional logic in the package so that the <b>lassign_br</b> |
---|
1320 | could be replaced by a C code version that would be able to update the list |
---|
1321 | directly without copying the data the way <a href="..\mann\lreplace.html">lreplace</a> |
---|
1322 | does.<o:p></o:p></span></p> |
---|
1323 | |
---|
1324 | <h3><a name=madd><span style='mso-fareast-font-family:"MS Mincho"'>madd</span></a><span |
---|
1325 | style='mso-fareast-font-family:"MS Mincho"'> a b<o:p></o:p></span></h3> |
---|
1326 | |
---|
1327 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1328 | "MS Mincho"'>This procedure uses <b>mat_binary_op</b> to return a matrix or |
---|
1329 | vector result from the addition of corresponding elements in two operands.<o:p></o:p></span></p> |
---|
1330 | |
---|
1331 | <h3><a name=madjust><span style='mso-fareast-font-family:"MS Mincho"'>madjust</span></a><span |
---|
1332 | style='mso-fareast-font-family:"MS Mincho"'> a scale offset<o:p></o:p></span></h3> |
---|
1333 | |
---|
1334 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1335 | "MS Mincho"'>This procedure uses <b>mat_unary_op</b> to return a matrix or |
---|
1336 | vector where the elements have been multiplied by a common factor, <b>scale</b>, |
---|
1337 | and then the <b>offset</b> value has been added.<o:p></o:p></span></p> |
---|
1338 | |
---|
1339 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1340 | "MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1341 | |
---|
1342 | <h3><a name="mat_binary_op"><span style='mso-fareast-font-family:"MS Mincho"'>mat_binary_op</span></a><span |
---|
1343 | style='mso-fareast-font-family:"MS Mincho"'> a b {op +}<o:p></o:p></span></h3> |
---|
1344 | |
---|
1345 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>mat_binary_op_br a_in |
---|
1346 | b_in op {c_out {}}<o:p></o:p></span></h3> |
---|
1347 | |
---|
1348 | <p class=MsoBodyTextIndent>This procedure is used to execute binary operations |
---|
1349 | such as addition on corresponding elements of vector or matrix operands.<span |
---|
1350 | style="mso-spacerun: yes"> </span>The default output for the _br call is to |
---|
1351 | overwrite the <b>a</b> input.</p> |
---|
1352 | |
---|
1353 | <h3><a name=mathprec>mathprec</a> {puts puts}</h3> |
---|
1354 | |
---|
1355 | <p class=MsoBodyTextIndent>Returns the smallest number epsilon, such that |
---|
1356 | 1+epsilon > 1.<span style="mso-spacerun: yes"> </span>Also reports on the |
---|
1357 | machine radix, digits, and rounding behavior, by using $puts as a command with |
---|
1358 | a single string argument, of the format radix=2.0 digits=53 |
---|
1359 | epsilon=2.22044604925e-016 method=truncation.<span style="mso-spacerun: yes"> |
---|
1360 | </span>The default value of the puts argument causes the string to be printed |
---|
1361 | at the console.</p> |
---|
1362 | |
---|
1363 | <h3><a name=mcols>mcols</a> m</h3> |
---|
1364 | |
---|
1365 | <h3>mcols_br m_name</h3> |
---|
1366 | |
---|
1367 | <p class=MsoBodyTextIndent>Return the number of columns in a matrix or |
---|
1368 | vector.<span style="mso-spacerun: yes"> </span>You can use <a href="#mrows">mrows</a> |
---|
1369 | and <b>mcols</b> to keep your software isolated from the details of the data |
---|
1370 | representation.</p> |
---|
1371 | |
---|
1372 | <p class=MsoBodyTextIndent><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
1373 | |
---|
1374 | <h3><a name=mdiag><span style='mso-fareast-font-family:"MS Mincho"'>mdiag</span></a><span |
---|
1375 | style='mso-fareast-font-family:"MS Mincho"'> v<o:p></o:p></span></h3> |
---|
1376 | |
---|
1377 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1378 | "MS Mincho"'>Creates a diagonal matrix from a vector, an Nx1 matrix, or a 1xN |
---|
1379 | matrix.<o:p></o:p></span></p> |
---|
1380 | |
---|
1381 | <h3><a name=mdingdong><span style='mso-fareast-font-family:"MS Mincho"'>mdingdong</span></a><span |
---|
1382 | style='mso-fareast-font-family:"MS Mincho"'> N<o:p></o:p></span></h3> |
---|
1383 | |
---|
1384 | <p class=MsoBodyTextIndent>Create the Ding Dong test matrix of size NxN.<span |
---|
1385 | style="mso-spacerun: yes"> </span>The matrix is a Cauchy matrix that is represented |
---|
1386 | inexactly in the machine, but very stable for inversion by elimination |
---|
1387 | methods.<span style="mso-spacerun: yes"> </span>Created by Dr. F. N. Ris |
---|
1388 | (Nash, 1979).</p> |
---|
1389 | |
---|
1390 | <h3><a name=mdiv><span style='mso-fareast-font-family:"MS Mincho"'>mdiv</span></a><span |
---|
1391 | style='mso-fareast-font-family:"MS Mincho"'> a b<o:p></o:p></span></h3> |
---|
1392 | |
---|
1393 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1394 | "MS Mincho"'>Uses <b>mat_binary_op</b> to compute a new matrix or vector from |
---|
1395 | the division of corresponding elements in two operands.<span |
---|
1396 | style="mso-spacerun: yes"> </span><o:p></o:p></span></p> |
---|
1397 | |
---|
1398 | <h3><a name=mevsvd><span style='mso-fareast-font-family:"MS Mincho"'>mevsvd</span></a><span |
---|
1399 | style='mso-fareast-font-family:"MS Mincho"'> A {epsilon 2.3e-16}<o:p></o:p></span></h3> |
---|
1400 | |
---|
1401 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>mevsvd_br A_in_out |
---|
1402 | evals_out {epsilon 2.3e-16}<o:p></o:p></span></h3> |
---|
1403 | |
---|
1404 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1405 | "MS Mincho"'>Solve for the eigenvectors and eigenvalues of a real symmetric |
---|
1406 | matrix by singular value decomposition.<span style="mso-spacerun: yes"> |
---|
1407 | </span>The eigenvectors of the solution are returned as the columns of A.<span |
---|
1408 | style="mso-spacerun: yes"> </span>The epsilon argument is expected to be the |
---|
1409 | value returned by the <b>mathprec</b> procedure for your platform.<o:p></o:p></span></p> |
---|
1410 | |
---|
1411 | <h3><a name=mhilbert><span style='mso-fareast-font-family:"MS Mincho"'>mhilbert</span></a><span |
---|
1412 | style='mso-fareast-font-family:"MS Mincho"'> N<o:p></o:p></span></h3> |
---|
1413 | |
---|
1414 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1415 | "MS Mincho"'>Create the Hilbert test matrix which is notorious for being<span |
---|
1416 | style="mso-spacerun: yes"> </span>ill conditioned for eigenvector/eigenvalue |
---|
1417 | solutions. (Nash, 1979)<o:p></o:p></span></p> |
---|
1418 | |
---|
1419 | <h3><a name=mident><span style='mso-fareast-font-family:"MS Mincho"'>mident</span></a><span |
---|
1420 | style='mso-fareast-font-family:"MS Mincho"'> N<o:p></o:p></span></h3> |
---|
1421 | |
---|
1422 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1423 | "MS Mincho"'>Create an identity matrix of order N.<o:p></o:p></span></p> |
---|
1424 | |
---|
1425 | <h3><a name=mlssvd><span style='mso-fareast-font-family:"MS Mincho"'>mlssvd</span></a><span |
---|
1426 | style='mso-fareast-font-family:"MS Mincho"'> A y {q 0.0} {puts puts} {epsilon |
---|
1427 | 2.3e-16}<o:p></o:p></span></h3> |
---|
1428 | |
---|
1429 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1430 | "MS Mincho"'>Solve the linear least squares solution for over-determined linear |
---|
1431 | equations using singular value decomposition.<span style="mso-spacerun: yes"> |
---|
1432 | </span>Solves the problem <b>A</b>[m,n]<b>x</b>[n] ~ <b>y</b>[m] for <b>x</b>[n] |
---|
1433 | where each row of <b>A</b> is a set of dependent variable values, <b>x</b>[n] |
---|
1434 | is the vector of independent variables, and <b>y</b>[m] is the set of dependent |
---|
1435 | values such as measured outcome values.<span style="mso-spacerun: yes"> |
---|
1436 | </span>The first column of <b>A</b> is usually all ones to compute a constant |
---|
1437 | term in the regression equation.<span style="mso-spacerun: yes"> </span>The value |
---|
1438 | <b>q</b> is specified such that singular values less than <b>q</b> are treated |
---|
1439 | as zero.<span style="mso-spacerun: yes"> </span>Typically a judgment is made |
---|
1440 | as to what variation is significant, and what is just noise.<span |
---|
1441 | style="mso-spacerun: yes"> </span>The significance level varies by |
---|
1442 | application.<span style="mso-spacerun: yes"> </span>For example, a small value |
---|
1443 | of <b>q</b> might be appropriate to detect a new planet from orbital data, |
---|
1444 | whereas larger values would be used to regress socio-economic statistics.<span |
---|
1445 | style="mso-spacerun: yes"> </span>The default value of the <b>puts</b> |
---|
1446 | argument causes the singular values to be printed at the console after the |
---|
1447 | matrix is factored.<span style="mso-spacerun: yes"> </span>The <b>epsilon</b> |
---|
1448 | argument is expected to be the result of the <b>mathprec</b> procedure for your |
---|
1449 | platform.<o:p></o:p></span></p> |
---|
1450 | |
---|
1451 | <h3><a name=mmult><span style='mso-fareast-font-family:"MS Mincho"'>mmult</span></a><span |
---|
1452 | style='mso-fareast-font-family:"MS Mincho"'> A B<o:p></o:p></span></h3> |
---|
1453 | |
---|
1454 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>mmult_br name_A name_B |
---|
1455 | C_out<o:p></o:p></span></h3> |
---|
1456 | |
---|
1457 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1458 | "MS Mincho"'>Ordinary matrix multiplication, <b>A</b>[p,q] x <b>B</b>[q,r] = <b>C</b>[p,r].<span |
---|
1459 | style="mso-spacerun: yes"> </span>Vector arguments are<span |
---|
1460 | style="mso-spacerun: yes"> </span>promoted to Nx1 arrays, so chances are if |
---|
1461 | you are using one as a left operand you probably intend to use the transpose of |
---|
1462 | it (1xN), which is easily done using the <a href="#transpose">transpose</a> |
---|
1463 | procedure.<span style="mso-spacerun: yes"> </span>The <b>mmult</b> procedure |
---|
1464 | returns the value of the matrix product.<span style="mso-spacerun: yes"> |
---|
1465 | </span>The <b>mmult_br</b> procedure writes the matrix product into the |
---|
1466 | variable whose name is <b>C_out</b>.<span style="mso-spacerun: yes"> |
---|
1467 | </span>The variable name <b>C_out </b>should specify a different variable than |
---|
1468 | either of the input variables specified by <b>name_A</b> or <b>name_B</b>.<o:p></o:p></span></p> |
---|
1469 | |
---|
1470 | <h3><a name=mnorms><span style='mso-fareast-font-family:"MS Mincho"'>mnorms</span></a><span |
---|
1471 | style='mso-fareast-font-family:"MS Mincho"'> a<o:p></o:p></span></h3> |
---|
1472 | |
---|
1473 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>mnorms_br name_a |
---|
1474 | means_out sigmas_out<o:p></o:p></span></h3> |
---|
1475 | |
---|
1476 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1477 | "MS Mincho"'>Compute the means and standard deviations of each column of the |
---|
1478 | input matrix.<span style="mso-spacerun: yes"> </span>Vector results are |
---|
1479 | returned.<span style="mso-spacerun: yes"> </span>If the number of rows is less |
---|
1480 | than 2, the standard deviations cannot be calculated and an error is returned.<o:p></o:p></span></p> |
---|
1481 | |
---|
1482 | <h3><a name=mnormalize><span style='mso-fareast-font-family:"MS Mincho"'>mnormalize</span></a><span |
---|
1483 | style='mso-fareast-font-family:"MS Mincho"'> a means sigmas<o:p></o:p></span></h3> |
---|
1484 | |
---|
1485 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>mnormalize_br name_a means_in |
---|
1486 | sigmas_in {c_out {}}<o:p></o:p></span></h3> |
---|
1487 | |
---|
1488 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1489 | "MS Mincho"'>Normalize each column of a matrix by subtracting the corresponding |
---|
1490 | mean and then dividing by the corresponding standard deviation.<span |
---|
1491 | style="mso-spacerun: yes"> </span>The default output matrix for <b>mnormalize_br</b> |
---|
1492 | is to overwrite the input matrix specified by <b>name_a</b>.<o:p></o:p></span></p> |
---|
1493 | |
---|
1494 | <h3><a name=moffset><span style='mso-fareast-font-family:"MS Mincho"'>moffset</span></a><span |
---|
1495 | style='mso-fareast-font-family:"MS Mincho"'> a delta<o:p></o:p></span></h3> |
---|
1496 | |
---|
1497 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1498 | "MS Mincho"'>Uses <b>mat_unary_op</b> to add a scalar constant to the elements |
---|
1499 | of an operand.<span style="mso-spacerun: yes"> </span>The modified operand is |
---|
1500 | the returned result.<o:p></o:p></span></p> |
---|
1501 | |
---|
1502 | <h3><a name=mprod><span style='mso-fareast-font-family:"MS Mincho"'>mprod</span></a><span |
---|
1503 | style='mso-fareast-font-family:"MS Mincho"'> a b<o:p></o:p></span></h3> |
---|
1504 | |
---|
1505 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1506 | "MS Mincho"'>Uses <b>mat_binary_op</b> to compute a new matrix or vector from the |
---|
1507 | multiplicative product of corresponding elements in two operands. <o:p></o:p></span></p> |
---|
1508 | |
---|
1509 | <h3><a name=mrange><span style='mso-fareast-font-family:"MS Mincho"'>mrange</span></a><span |
---|
1510 | style='mso-fareast-font-family:"MS Mincho"'> m col_start col_last {row_start 0} |
---|
1511 | {row_last end}<o:p></o:p></span></h3> |
---|
1512 | |
---|
1513 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>mrange_br name_m_in c_out |
---|
1514 | col_start col_last {row_start 0} {row_last end}<o:p></o:p></span></h3> |
---|
1515 | |
---|
1516 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1517 | "MS Mincho"'>Returns a subset of the selected columns and selected rows of a |
---|
1518 | matrix as a new matrix.<span style="mso-spacerun: yes"> </span>Column and row |
---|
1519 | indexing begin with 0.<span style="mso-spacerun: yes"> </span>The token <b>end |
---|
1520 | </b>may be used to specify the last row or column.<span style="mso-spacerun: |
---|
1521 | yes"> </span>The default values for row selection will return all rows.<span |
---|
1522 | style="mso-spacerun: yes"> </span>The rows and columns are read and copied |
---|
1523 | from the input matrix in the order of start to last.<span style="mso-spacerun: |
---|
1524 | yes"> </span>The selection result includes rows and columns with index values |
---|
1525 | equal to the start indexes and proceeds to the last indexes, including all rows |
---|
1526 | and columns with indexes between the start and last values and equal to the start |
---|
1527 | and last values.<span style="mso-spacerun: yes"> </span>If the start index is |
---|
1528 | less than the last index for row or column selection, the result matrix is |
---|
1529 | created with the row or columns in reverse order.<span style="mso-spacerun: |
---|
1530 | yes"> </span>This is a feature, not a bug.<span style="mso-spacerun: yes"> |
---|
1531 | </span><o:p></o:p></span></p> |
---|
1532 | |
---|
1533 | <p class=MsoPlainText style='margin-left:.5in'>% set m {2 2 3 1 2 3 4 5 6}</p> |
---|
1534 | |
---|
1535 | <p class=MsoPlainText style='margin-left:.5in'>% show $m</p> |
---|
1536 | |
---|
1537 | <p class=MsoPlainText style='margin-left:.5in'>1 2 3</p> |
---|
1538 | |
---|
1539 | <p class=MsoPlainText style='margin-left:.5in'>4 5 6</p> |
---|
1540 | |
---|
1541 | <p class=MsoPlainText style='margin-left:.5in'>% show [mrange $m 0 1]</p> |
---|
1542 | |
---|
1543 | <p class=MsoPlainText style='margin-left:.5in'>1 2</p> |
---|
1544 | |
---|
1545 | <p class=MsoPlainText style='margin-left:.5in'>4 5</p> |
---|
1546 | |
---|
1547 | <p class=MsoPlainText style='margin-left:.5in'>% show [mrange $m end 0]</p> |
---|
1548 | |
---|
1549 | <p class=MsoPlainText style='margin-left:.5in'>3 2 1</p> |
---|
1550 | |
---|
1551 | <p class=MsoPlainText style='margin-left:.5in'>6 5 4</p> |
---|
1552 | |
---|
1553 | <p class=MsoPlainText style='margin-left:.5in'>% show [mrange $m 1 1 0 0]</p> |
---|
1554 | |
---|
1555 | <p class=MsoPlainText style='margin-left:.5in'>2</p> |
---|
1556 | |
---|
1557 | <h3><a name=mround><span style='mso-fareast-font-family:"MS Mincho"'>mround</span></a><span |
---|
1558 | style='mso-fareast-font-family:"MS Mincho"'> a {epsilon 1.0e-8}<o:p></o:p></span></h3> |
---|
1559 | |
---|
1560 | <p class=MsoBodyTextIndent>Uses <b>mat_unary_op</b> to round-off to the nearest |
---|
1561 | integer the elements of a matrix or vector which are within epsilon of an |
---|
1562 | integer value.</p> |
---|
1563 | |
---|
1564 | <p class=MsoPlainText style='margin-left:.5in'>% show $m %12.4g</p> |
---|
1565 | |
---|
1566 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1567 | yes"> </span>1<span style="mso-spacerun: yes"> |
---|
1568 | </span>1.388e-016<span style="mso-spacerun: yes"> </span>8.327e-017<span |
---|
1569 | style="mso-spacerun: yes"> </span>-2.776e-017</p> |
---|
1570 | |
---|
1571 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1572 | yes"> </span>1.388e-016<span style="mso-spacerun: yes"> |
---|
1573 | </span>1<span style="mso-spacerun: yes"> </span>-5.551e-017<span |
---|
1574 | style="mso-spacerun: yes"> </span>-1.11e-016</p> |
---|
1575 | |
---|
1576 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1577 | yes"> </span>8.327e-017<span style="mso-spacerun: yes"> |
---|
1578 | </span>-5.551e-017<span style="mso-spacerun: yes"> </span>1<span |
---|
1579 | style="mso-spacerun: yes"> </span>-5.551e-017</p> |
---|
1580 | |
---|
1581 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1582 | yes"> </span>-2.776e-017<span style="mso-spacerun: yes"> |
---|
1583 | </span>-1.11e-016<span style="mso-spacerun: yes"> </span>-5.551e-017<span |
---|
1584 | style="mso-spacerun: yes"> </span>1</p> |
---|
1585 | |
---|
1586 | <p class=MsoPlainText style='margin-left:.5in'>% show [mround $m]</p> |
---|
1587 | |
---|
1588 | <p class=MsoPlainText style='margin-left:.5in'>1.0 0.0 0.0 0.0</p> |
---|
1589 | |
---|
1590 | <p class=MsoPlainText style='margin-left:.5in'>0.0 1.0 0.0 0.0</p> |
---|
1591 | |
---|
1592 | <p class=MsoPlainText style='margin-left:.5in'>0.0 0.0 1.0 0.0</p> |
---|
1593 | |
---|
1594 | <p class=MsoPlainText style='margin-left:.5in'>0.0 0.0 0.0 1.0</p> |
---|
1595 | |
---|
1596 | <h3><a name=mrows></a><a name=mscale><span style='mso-bookmark:mrows'>mrows</span> |
---|
1597 | m</a></h3> |
---|
1598 | |
---|
1599 | <h3><span style='mso-bookmark:mscale'>mrows_br m_name</span></h3> |
---|
1600 | |
---|
1601 | <p class=MsoBodyTextIndent><span style='mso-bookmark:mscale'>Return the number |
---|
1602 | of rows in a matrix or vector.<span style="mso-spacerun: yes"> </span>You can |
---|
1603 | use <b>mrows</b> and </span><a href="#mcols"><span style='mso-bookmark:mscale'>mcols</span><span |
---|
1604 | style='mso-bookmark:mscale'></span></a><span style='mso-bookmark:mscale'> to keep |
---|
1605 | your software isolated from the details of the data representation.</span></p> |
---|
1606 | |
---|
1607 | <h3><span style='mso-bookmark:mscale'>mscale</span> a scalefactor</h3> |
---|
1608 | |
---|
1609 | <p class=MsoBodyTextIndent>Uses <b>mat_unary_op</b> to multiply each element in |
---|
1610 | a matrix or vector operand, <b>a</b>, by the scalar <b>scalefactor</b>.</p> |
---|
1611 | |
---|
1612 | <h3><a name=msolve>msolve</a> A p</h3> |
---|
1613 | |
---|
1614 | <h3>msolve_br Ap_in {tolerance 2.3e-16}</h3> |
---|
1615 | |
---|
1616 | <p class=MsoNormal style='margin-left:.5in'>Solves a system of linear |
---|
1617 | equations, <b>Ax</b> = <b>p</b>, for <b>x</b>, by brute force application of |
---|
1618 | Gauss elimination with partial pivoting.<span style="mso-spacerun: yes"> |
---|
1619 | </span><span style='mso-fareast-font-family:"MS Mincho"'>When <b>p</b> is the |
---|
1620 | identity matrix, the solution <b>x</b>, is the inverse of </span>matrix <b><span |
---|
1621 | style='mso-fareast-font-family:"MS Mincho"'>A</span></b><span style='mso-fareast-font-family: |
---|
1622 | "MS Mincho"'>.</span>The <b>msolve_br</b> procedure accepts as input the |
---|
1623 | columnwise concatenation of <b>A</b> and <b>p</b>, and overwrites the <b>p</b> |
---|
1624 | columns with the solution columns <b>x</b>.<span style="mso-spacerun: yes"> |
---|
1625 | </span>The <b>msolve</b> procedure accepts <b>A</b> and <b>p</b> as separate |
---|
1626 | arguments, and returns the solution data directly.<span style="mso-spacerun: |
---|
1627 | yes"> </span><span style='mso-fareast-font-family:"MS Mincho"'>The <b>epsilon</b> |
---|
1628 | argument is expected to be the result of the <b>mathprec</b> procedure for your |
---|
1629 | platform.<o:p></o:p></span></p> |
---|
1630 | |
---|
1631 | <h3><a name=msub><span style='mso-fareast-font-family:"MS Mincho"'>msub</span></a><span |
---|
1632 | style='mso-fareast-font-family:"MS Mincho"'> a b<o:p></o:p></span></h3> |
---|
1633 | |
---|
1634 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1635 | "MS Mincho"'>Uses <b>mat_binary_op</b> to compute a new matrix or vector from |
---|
1636 | the subtraction of corresponding elements in two operands. <o:p></o:p></span></p> |
---|
1637 | |
---|
1638 | <h3><a name=msum>msum</a> a</h3> |
---|
1639 | |
---|
1640 | <h3>msum_br name_a sums_out</h3> |
---|
1641 | |
---|
1642 | <p class=MsoBodyTextIndent>Compute the sums of each column of a matrix or |
---|
1643 | vector, returning a vector or scalar result.<span style="mso-spacerun: yes"> |
---|
1644 | </span>Call twice to get the total sum of columns and rows (set total [msum |
---|
1645 | [msum $a]]).</p> |
---|
1646 | |
---|
1647 | <h3><a name=msvd>msvd</a> a</h3> |
---|
1648 | |
---|
1649 | <h3>msvd_br name_a_in_U_out S_out V_out {epsilon 2.3e-16}</h3> |
---|
1650 | |
---|
1651 | <p class=MsoBodyTextIndent>Perform the Singular Value Decomposition of a |
---|
1652 | matrix.</p> |
---|
1653 | |
---|
1654 | <p class=MsoBodyTextIndent>This factors matrix A into (U)(S)(Vtrans) where</p> |
---|
1655 | |
---|
1656 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1657 | yes"> </span><span style="mso-spacerun: yes"> </span>A[m,n] is the original |
---|
1658 | matrix</p> |
---|
1659 | |
---|
1660 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1661 | yes"> </span>U[m,n] has orthogonal columns (Ut)(U) =<span |
---|
1662 | style="mso-spacerun: yes"> </span>(1(k)</p> |
---|
1663 | |
---|
1664 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1665 | yes"> </span>and multiplies to an identity matrix<span |
---|
1666 | style="mso-spacerun: yes"> </span>...</p> |
---|
1667 | |
---|
1668 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1669 | yes"> </span>supplemented with zeroes if needed<span style="mso-spacerun: |
---|
1670 | yes"> </span>0(n-k))</p> |
---|
1671 | |
---|
1672 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1673 | yes"> </span>V[n,n] is orthogonal<span style="mso-spacerun: yes"> |
---|
1674 | </span>(V)(Vtran) = [mident $n]</p> |
---|
1675 | |
---|
1676 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1677 | yes"> </span>V contains the eigenvectors aka the principal components</p> |
---|
1678 | |
---|
1679 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1680 | yes"> </span>S is diagonal with the positive singular values of A</p> |
---|
1681 | |
---|
1682 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1683 | yes"> </span>Square S and divide by (m-1) to get the principal component</p> |
---|
1684 | |
---|
1685 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1686 | yes"> </span>eigenvalues.</p> |
---|
1687 | |
---|
1688 | <p class=MsoBodyTextIndent><span style="mso-spacerun: yes"> </span></p> |
---|
1689 | |
---|
1690 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1691 | yes"> </span>A[m,n]V[n,n] = B[m,n]<span style="mso-spacerun: yes"> </span>transforms |
---|
1692 | A to orthogonal columns, B</p> |
---|
1693 | |
---|
1694 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1695 | yes"> </span>B[m,n] = U[m,n]S[n,n]<span style="mso-spacerun: yes"> </span></p> |
---|
1696 | |
---|
1697 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1698 | yes"> </span></p> |
---|
1699 | |
---|
1700 | <p class=MsoNormal style='margin-left:.5in'>The <b>msvd</b> procedure outputs |
---|
1701 | formatted results to the console.<span style="mso-spacerun: yes"> </span>The <b>msvd_br</b> |
---|
1702 | procedure overwrites the input matrix <b>a</b> with the <b>U</b> result |
---|
1703 | matrix.<span style="mso-spacerun: yes"> </span><span style='mso-fareast-font-family: |
---|
1704 | "MS Mincho"'>The <b>epsilon</b> argument is expected to be the result of the <b>mathprec</b> |
---|
1705 | procedure for your platform.</span></p> |
---|
1706 | |
---|
1707 | <h3><a name="mat_unary_op">mat_unary_op</a> a op</h3> |
---|
1708 | |
---|
1709 | <h3>mat_unary_op_br name_a op {name_c_out {}}</h3> |
---|
1710 | |
---|
1711 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1712 | "MS Mincho"'>Perform unary operations on operand elements like scaling.<span |
---|
1713 | style="mso-spacerun: yes"> </span>The default output of the </span><b>mat_unary_op_br</b> |
---|
1714 | procedure is to overwrite the input specified by <b>name_a</b>.<span |
---|
1715 | style="mso-spacerun: yes"> </span>The logic sweeps through the matrix or |
---|
1716 | vector, and evaluates the concatenation of $<b>op</b> with the operand |
---|
1717 | element.<span style="mso-spacerun: yes"> </span>For example, if the value of <b>op</b> |
---|
1718 | is expr 0.5 * the result would be to multiply each element by 0.5.<span |
---|
1719 | style="mso-spacerun: yes"> </span>You can define your own procedures, and pass |
---|
1720 | the procedure name as the <b>op</b> argument.</p> |
---|
1721 | |
---|
1722 | <h3><a name=promote>promote</a> x</h3> |
---|
1723 | |
---|
1724 | <h3>promote_br name_x {name_out {}}</h3> |
---|
1725 | |
---|
1726 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1727 | "MS Mincho"'>Promote a scalar or vector to an array.<span style="mso-spacerun: |
---|
1728 | yes"> </span>Vector[N] is promoted to an Nx1 array.<span style="mso-spacerun: |
---|
1729 | yes"> </span>Calling promote with a matrix argument is all right; the result |
---|
1730 | is the matrix unchanged.<span style="mso-spacerun: yes"> </span>The default |
---|
1731 | output of <b>promote_br</b> is to overwrite the input.<o:p></o:p></span></p> |
---|
1732 | |
---|
1733 | <h3><a name=show><span style='mso-fareast-font-family:"MS Mincho"'>show</span></a><span |
---|
1734 | style='mso-fareast-font-family:"MS Mincho"'> x {format {}} {col_join { }} |
---|
1735 | {row_join \n}} <o:p></o:p></span></h3> |
---|
1736 | |
---|
1737 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>show_br name_in {name_out |
---|
1738 | {}} {format {}} {col_join { }} {row_join \n}<o:p></o:p></span></h3> |
---|
1739 | |
---|
1740 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1741 | "MS Mincho"'>Return a formatted string representation for an operand.<span |
---|
1742 | style="mso-spacerun: yes"> </span>Options allow for specify the format of |
---|
1743 | numbers, and the strings used to separate column and row elements.<span |
---|
1744 | style="mso-spacerun: yes"> </span>The optional <b>format</b> argument is a |
---|
1745 | specification string which is applied to convert each element using the Tcl <a |
---|
1746 | href="..\mann\format.html">format</a> command.<span style="mso-spacerun: yes"> |
---|
1747 | </span>The format command is very is similar to the C code sprintf |
---|
1748 | command.<span style="mso-spacerun: yes"> </span><o:p></o:p></span></p> |
---|
1749 | |
---|
1750 | <p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family: |
---|
1751 | "MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1752 | |
---|
1753 | <p class=MsoPlainText style='margin-left:.5in'>set m {2 2 3 1 2 3 4 5 6}</p> |
---|
1754 | |
---|
1755 | <p class=MsoPlainText style='margin-left:.5in'>% show $m %6.2f</p> |
---|
1756 | |
---|
1757 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1758 | yes"> </span>1.00<span style="mso-spacerun: yes"> </span>2.00<span |
---|
1759 | style="mso-spacerun: yes"> </span>3.00</p> |
---|
1760 | |
---|
1761 | <p class=MsoPlainText style='margin-left:.5in'><span style="mso-spacerun: |
---|
1762 | yes"> </span>4.00<span style="mso-spacerun: yes"> </span>5.00<span |
---|
1763 | style="mso-spacerun: yes"> </span>6.00</p> |
---|
1764 | |
---|
1765 | <p class=MsoPlainText style='margin-left:.5in'>% show $m {} , \;</p> |
---|
1766 | |
---|
1767 | <p class=MsoPlainText style='margin-left:.5in'>1,2,3;4,5,6</p> |
---|
1768 | |
---|
1769 | <h3><a name=transpose><span style='mso-fareast-font-family:"MS Mincho"'>transpose</span></a><span |
---|
1770 | style='mso-fareast-font-family:"MS Mincho"'> x<o:p></o:p></span></h3> |
---|
1771 | |
---|
1772 | <h3><span style='mso-fareast-font-family:"MS Mincho"'>transpose_br name_x |
---|
1773 | {name_out {}}<o:p></o:p></span></h3> |
---|
1774 | |
---|
1775 | <p class=MsoBodyTextIndent>Performs the matrix transpose, exchanging [i,j] with |
---|
1776 | [j,i].<span style="mso-spacerun: yes"> </span>A vector is promoted to a 1xN |
---|
1777 | array by transpose.<span style="mso-spacerun: yes"> </span>The default output |
---|
1778 | of the <b>transpose_br</b> procedure is to overwrite the input data named by <b>name_x</b>.</p> |
---|
1779 | |
---|
1780 | <h3><a name=vdiag>vdiag</a> m</h3> |
---|
1781 | |
---|
1782 | <h3>vdiag_br m_name_in v_out</h3> |
---|
1783 | |
---|
1784 | <p class=MsoBodyTextIndent>Create a vector from the diagonal elements of a |
---|
1785 | matrix.</p> |
---|
1786 | |
---|
1787 | <h3><a name=vtrim>vtrim</a> x</h3> |
---|
1788 | |
---|
1789 | <h3>vtrim_br <span style='mso-fareast-font-family:"MS Mincho"'>name_x {name_out |
---|
1790 | {}}</span></h3> |
---|
1791 | |
---|
1792 | <p class=MsoBodyTextIndent>For a vector or matrix operand, just return the |
---|
1793 | actual data elements by trimming away the dimension and size data in the front |
---|
1794 | of the underlying Tcl list representation.<span style="mso-spacerun: yes"> |
---|
1795 | </span>The default output of the <b>vtrim_br</b> procedure is to overwrite the |
---|
1796 | input data named by <b>name_x</b>.</p> |
---|
1797 | |
---|
1798 | <h1><span style='mso-fareast-font-family:"MS Mincho"'>About the <a name=author>Author</a><o:p></o:p></span></h1> |
---|
1799 | |
---|
1800 | <p class=MsoNormal>This package has been developed by Edward C. Hume, III |
---|
1801 | PhD.<span style="mso-spacerun: yes"> </span>Dr. Hume has been interested in |
---|
1802 | numerical methods since the early 1980s when his doctoral research at MIT |
---|
1803 | involved a comparison of Finite Element and Boundary Element methods for moving |
---|
1804 | boundary problems.<span style="mso-spacerun: yes"> </span>In recent years he |
---|
1805 | has been applying univariate and multivariate Statistical Process Control |
---|
1806 | techniques in his consulting work.<span style="mso-spacerun: yes"> </span>Dr. |
---|
1807 | Hume is the founder of Hume Integration Services, a software product and |
---|
1808 | consulting company, with a focus on Computer Integrated Manufacturing in the |
---|
1809 | Semiconductor and Electronics industries.</p> |
---|
1810 | |
---|
1811 | <p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
1812 | |
---|
1813 | <p class=MsoNormal>Hume Integration's flagship product is the <b>Distributed Message |
---|
1814 | Hub (DMH) Application Development Package</b>, a cohesive and synergistic set |
---|
1815 | of tools that extends the Tcl/Tk programming environment. The package includes |
---|
1816 | an in-memory SQL database that has subscription capability, comprehensive |
---|
1817 | support for equipment interfaces using SECS, serial, or network protocols, and |
---|
1818 | high-level facilities for interprocess communication. Applications can easily |
---|
1819 | share data and logic by exchanging Tcl and SQL messages which are efficiently |
---|
1820 | processed by the extended interpreter. This toolset is offered for Windows |
---|
1821 | 2000/NT and major POSIX platforms including HP-UX, Linux, AIX, and SOLARIS. The |
---|
1822 | toolset is in 7x24 use in dozens of factories located in the United States, |
---|
1823 | Malaysia, Korea, Japan, China, Hong Kong, Singapore, Taiwan, Mexico, France, |
---|
1824 | and Scotland.<span style="mso-spacerun: yes"> </span>Feel free to visit our |
---|
1825 | website at <a href="http://www.hume.com/">http://www.hume.com</a>.</p> |
---|
1826 | |
---|
1827 | <p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
1828 | |
---|
1829 | <h1><a name=references><span style='mso-fareast-font-family:"MS Mincho"'>References</span></a><span |
---|
1830 | style='mso-fareast-font-family:"MS Mincho"'><o:p></o:p></span></h1> |
---|
1831 | |
---|
1832 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1833 | |
---|
1834 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The more |
---|
1835 | sophisticated algorithms in this package were adapted from Nash, 1979.<o:p></o:p></span></p> |
---|
1836 | |
---|
1837 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1838 | |
---|
1839 | <p class=MsoNormal><u><span style='mso-fareast-font-family:"MS Mincho"'>Compact |
---|
1840 | Numerical Methods for Computers: Linear Algebra and Function Minimisation</span></u><span |
---|
1841 | style='mso-fareast-font-family:"MS Mincho"'> by J. C. Nash, John Wiley & |
---|
1842 | Sons, New York, 1979.<o:p></o:p></span></p> |
---|
1843 | |
---|
1844 | <h1><a name=LicenseTerms></a><a name="_License_Terms"></a><span |
---|
1845 | style='mso-bookmark:LicenseTerms'><span style='mso-fareast-font-family:"MS Mincho"'>License |
---|
1846 | Terms</span></span><span style='mso-fareast-font-family:"MS Mincho"'><o:p></o:p></span></h1> |
---|
1847 | |
---|
1848 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1849 | |
---|
1850 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>The La |
---|
1851 | package software is being distributed under terms and conditions similar to |
---|
1852 | Tcl/Tk.<span style="mso-spacerun: yes"> </span>The author is providing the |
---|
1853 | package software to the Tcl community as a returned favor for the value of |
---|
1854 | packages received over the years.<o:p></o:p></span></p> |
---|
1855 | |
---|
1856 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1857 | |
---|
1858 | <p class=MsoNormal>The La package software is copyrighted by Hume Integration |
---|
1859 | Services. The following terms apply to all files associated with the software |
---|
1860 | unless explicitly disclaimed in individual files.</p> |
---|
1861 | |
---|
1862 | <p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
1863 | |
---|
1864 | <p class=MsoNormal>The authors hereby grant permission to use, copy, modify, |
---|
1865 | distribute, and license this software and its documentation for any purpose, |
---|
1866 | provided that existing copyright notices are retained in all copies and that |
---|
1867 | this notice is included verbatim in any distributions. No written agreement, |
---|
1868 | license, or royalty fee is required for any of the authorized uses. |
---|
1869 | Modifications to this software may be copyrighted by their authors and need not |
---|
1870 | follow the licensing terms described here, provided that the new terms are |
---|
1871 | clearly indicated on the first page of each file where they apply.</p> |
---|
1872 | |
---|
1873 | <p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
1874 | |
---|
1875 | <p class=MsoNormal>IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO |
---|
1876 | ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
---|
1877 | ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES |
---|
1878 | THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH |
---|
1879 | DAMAGE.</p> |
---|
1880 | |
---|
1881 | <p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
1882 | |
---|
1883 | <p class=MsoNormal>THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY |
---|
1884 | WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
1885 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.<span |
---|
1886 | style="mso-spacerun: yes"> </span>THIS SOFTWARE IS PROVIDED ON AN "AS |
---|
1887 | IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE |
---|
1888 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.</p> |
---|
1889 | |
---|
1890 | <p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p> |
---|
1891 | |
---|
1892 | <p class=MsoNormal>GOVERNMENT USE: If you are acquiring this software on behalf |
---|
1893 | of the U.S. government, the Government shall have only "Restricted |
---|
1894 | Rights" in the software and related documentation as defined in the |
---|
1895 | Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).<span |
---|
1896 | style="mso-spacerun: yes"> </span>If you are acquiring the software on behalf |
---|
1897 | of the Department of Defense, the software shall be classified as |
---|
1898 | "Commercial Computer Software" and the Government shall have only |
---|
1899 | "Restricted Rights" as defined in Clause 252.227-7013 (c) (1) of |
---|
1900 | DFARs.<span style="mso-spacerun: yes"> </span>Notwithstanding the foregoing, |
---|
1901 | the authors grant the U.S. Government and others acting in its behalf |
---|
1902 | permission to use and distribute the software in accordance with the terms |
---|
1903 | specified in this license.</p> |
---|
1904 | |
---|
1905 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></p> |
---|
1906 | |
---|
1907 | <h1><a name=DocVersion><span style='mso-fareast-font-family:"MS Mincho"'>Document |
---|
1908 | Version</span></a><span style='mso-fareast-font-family:"MS Mincho"'><o:p></o:p></span></h1> |
---|
1909 | |
---|
1910 | <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>Date of |
---|
1911 | last revsion $Date: 2001/07/12 23:59:51 $.<o:p></o:p></span></p> |
---|
1912 | |
---|
1913 | </div> |
---|
1914 | |
---|
1915 | </body> |
---|
1916 | |
---|
1917 | </html> |
---|