home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
90%
| dexvert
| Hypertext Markup Language File (text/html)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| HTML document text
| default (weak)
| |
99%
| file
| LaTeX document text
| default
| |
98%
| file
| exported SGML document text
| default
| |
97%
| file
| exported SGML document, ASCII text, with CRLF, LF line terminators
| default
| |
80%
| TrID
| HyperText Markup Language with DOCTYPE
| default
| |
19%
| TrID
| HyperText Markup Language
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| gt2
| HTML (Hyper Text Markup Language) Datei
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| text/html
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3c 21 44 4f 43 54 59 50 | 45 20 48 54 4d 4c 20 50 |<!DOCTYP|E HTML P|
|00000010| 55 42 4c 49 43 20 22 2d | 2f 2f 57 33 43 2f 2f 44 |UBLIC "-|//W3C//D|
|00000020| 54 44 20 48 54 4d 4c 20 | 33 2e 32 20 46 69 6e 61 |TD HTML |3.2 Fina|
|00000030| 6c 2f 2f 65 6e 22 3e 0a | 0a 3c 21 2d 2d 43 6f 6e |l//en">.|.<!--Con|
|00000040| 76 65 72 74 65 64 20 77 | 69 74 68 20 4c 61 54 65 |verted w|ith LaTe|
|00000050| 58 32 48 54 4d 4c 20 32 | 30 32 32 20 28 52 65 6c |X2HTML 2|022 (Rel|
|00000060| 65 61 73 65 64 20 4a 61 | 6e 75 61 72 79 20 31 2c |eased Ja|nuary 1,|
|00000070| 20 32 30 32 32 29 20 2d | 2d 3e 0a 3c 48 54 4d 4c | 2022) -|->.<HTML|
|00000080| 20 6c 61 6e 67 3d 22 65 | 6e 22 3e 0a 3c 48 45 41 | lang="e|n">.<HEA|
|00000090| 44 3e 0a 3c 54 49 54 4c | 45 3e 43 6f 6e 74 65 6e |D>.<TITL|E>Conten|
|000000a0| 74 73 20 6f 66 20 57 68 | 61 74 20 69 73 20 74 68 |ts of Wh|at is th|
|000000b0| 65 20 50 72 6f 62 6c 65 | 6d 3f 3c 2f 54 49 54 4c |e Proble|m?</TITL|
|000000c0| 45 3e 0a 0a 3c 4d 45 54 | 41 20 48 54 54 50 2d 45 |E>..<MET|A HTTP-E|
|000000d0| 51 55 49 56 3d 22 43 6f | 6e 74 65 6e 74 2d 54 79 |QUIV="Co|ntent-Ty|
|000000e0| 70 65 22 20 43 4f 4e 54 | 45 4e 54 3d 22 74 65 78 |pe" CONT|ENT="tex|
|000000f0| 74 2f 68 74 6d 6c 3b 20 | 63 68 61 72 73 65 74 3d |t/html; |charset=|
|00000100| 75 74 66 2d 38 22 3e 0a | 3c 4d 45 54 41 20 4e 41 |utf-8">.|<META NA|
|00000110| 4d 45 3d 22 76 69 65 77 | 70 6f 72 74 22 20 43 4f |ME="view|port" CO|
|00000120| 4e 54 45 4e 54 3d 22 77 | 69 64 74 68 3d 64 65 76 |NTENT="w|idth=dev|
|00000130| 69 63 65 2d 77 69 64 74 | 68 2c 20 69 6e 69 74 69 |ice-widt|h, initi|
|00000140| 61 6c 2d 73 63 61 6c 65 | 3d 31 2e 30 22 3e 0a 3c |al-scale|=1.0">.<|
|00000150| 4d 45 54 41 20 4e 41 4d | 45 3d 22 47 65 6e 65 72 |META NAM|E="Gener|
|00000160| 61 74 6f 72 22 20 43 4f | 4e 54 45 4e 54 3d 22 4c |ator" CO|NTENT="L|
|00000170| 61 54 65 58 32 48 54 4d | 4c 20 76 32 30 32 32 22 |aTeX2HTM|L v2022"|
|00000180| 3e 0a 0a 3c 4c 49 4e 4b | 20 52 45 4c 3d 22 53 54 |>..<LINK| REL="ST|
|00000190| 59 4c 45 53 48 45 45 54 | 22 20 48 52 45 46 3d 22 |YLESHEET|" HREF="|
|000001a0| 64 6f 63 75 2e 63 73 73 | 22 3e 0a 0a 3c 4c 49 4e |docu.css|">..<LIN|
|000001b0| 4b 20 52 45 4c 3d 22 6e | 65 78 74 22 20 48 52 45 |K REL="n|ext" HRE|
|000001c0| 46 3d 22 6e 6f 64 65 34 | 5f 6d 6e 2e 68 74 6d 6c |F="node4|_mn.html|
|000001d0| 22 3e 0a 3c 4c 49 4e 4b | 20 52 45 4c 3d 22 70 72 |">.<LINK| REL="pr|
|000001e0| 65 76 69 6f 75 73 22 20 | 48 52 45 46 3d 22 6e 6f |evious" |HREF="no|
|000001f0| 64 65 32 5f 6d 6e 2e 68 | 74 6d 6c 22 3e 0a 3c 4c |de2_mn.h|tml">.<L|
|00000200| 49 4e 4b 20 52 45 4c 3d | 22 75 70 22 20 48 52 45 |INK REL=|"up" HRE|
|00000210| 46 3d 22 6e 6f 64 65 32 | 5f 6d 6e 2e 68 74 6d 6c |F="node2|_mn.html|
|00000220| 22 3e 0a 3c 4c 49 4e 4b | 20 52 45 4c 3d 22 6e 65 |">.<LINK| REL="ne|
|00000230| 78 74 22 20 48 52 45 46 | 3d 22 6e 6f 64 65 34 5f |xt" HREF|="node4_|
|00000240| 6d 6e 2e 68 74 6d 6c 22 | 3e 0a 3c 2f 48 45 41 44 |mn.html"|>.</HEAD|
|00000250| 3e 0a 20 0a 3c 42 4f 44 | 59 20 62 67 63 6f 6c 6f |>. .<BOD|Y bgcolo|
|00000260| 72 3d 22 23 66 66 66 66 | 66 66 22 20 74 65 78 74 |r="#ffff|ff" text|
|00000270| 3d 22 23 30 30 30 30 30 | 30 22 20 6c 69 6e 6b 3d |="#00000|0" link=|
|00000280| 22 23 39 39 34 34 45 45 | 22 20 76 6c 69 6e 6b 3d |"#9944EE|" vlink=|
|00000290| 22 23 30 30 30 30 66 66 | 22 20 61 6c 69 6e 6b 3d |"#0000ff|" alink=|
|000002a0| 22 23 30 30 66 66 30 30 | 22 3e 0a 0a 3c 48 31 3e |"#00ff00|">..<H1>|
|000002b0| 3c 41 20 49 44 3d 22 53 | 45 43 54 49 4f 4e 30 30 |<A ID="S|ECTION00|
|000002c0| 32 31 30 30 30 30 30 30 | 30 30 30 30 30 30 30 30 |21000000|00000000|
|000002d0| 30 30 22 3e 0a 57 68 61 | 74 20 69 73 20 74 68 65 |00">.Wha|t is the|
|000002e0| 20 50 72 6f 62 6c 65 6d | 3f 3c 2f 41 3e 0a 3c 2f | Problem|?</A>.</|
|000002f0| 48 31 3e 0d 0a 49 20 77 | 72 6f 74 65 20 74 68 69 |H1>..I w|rote thi|
|00000300| 73 20 63 6f 64 65 20 74 | 6f 20 73 6f 6c 76 65 20 |s code t|o solve |
|00000310| 73 6f 6d 65 20 6f 66 20 | 6d 79 20 6d 61 74 72 69 |some of |my matri|
|00000320| 78 20 61 6c 67 65 62 72 | 61 0d 0a 70 72 6f 62 6c |x algebr|a..probl|
|00000330| 65 6d 73 20 66 6f 72 20 | 6d 79 20 72 65 73 65 61 |ems for |my resea|
|00000340| 72 63 68 2e 20 49 20 6e | 65 65 64 65 64 20 61 20 |rch. I n|eeded a |
|00000350| 67 65 6e 65 72 69 63 20 | 70 72 6f 67 72 61 6d 20 |generic |program |
|00000360| 74 68 61 74 0d 0a 63 6f | 75 6c 64 20 68 61 6e 64 |that..co|uld hand|
|00000370| 6c 65 20 6d 61 74 72 69 | 78 20 61 6c 67 65 62 72 |le matri|x algebr|
|00000380| 61 20 6f 6e 20 61 20 50 | 43 2c 20 66 6f 72 20 69 |a on a P|C, for i|
|00000390| 6e 73 74 61 6e 63 65 20 | 0d 0a 3c 50 3e 3c 21 2d |nstance |..<P><!-|
|000003a0| 2d 20 4d 41 54 48 0a 20 | 5c 62 65 67 69 6e 7b 64 |- MATH. |\begin{d|
|000003b0| 69 73 70 6c 61 79 6d 61 | 74 68 7d 0a 5c 68 61 74 |isplayma|th}.\hat|
|000003c0| 20 5c 62 65 74 61 20 3d | 20 28 58 27 58 29 5e 7b | \beta =| (X'X)^{|
|000003d0| 2d 31 7d 58 27 79 0a 5c | 65 6e 64 7b 64 69 73 70 |-1}X'y.\|end{disp|
|000003e0| 6c 61 79 6d 61 74 68 7d | 0a 20 2d 2d 3e 0a 3c 2f |laymath}|. -->.</|
|000003f0| 50 3e 0a 3c 44 49 56 20 | 41 4c 49 47 4e 3d 22 43 |P>.<DIV |ALIGN="C|
|00000400| 45 4e 54 45 52 22 3e 0a | 3c 49 4d 47 0a 20 53 54 |ENTER">.|<IMG. ST|
|00000410| 59 4c 45 3d 22 68 65 69 | 67 68 74 3a 20 32 2e 31 |YLE="hei|ght: 2.1|
|00000420| 30 65 78 3b 20 76 65 72 | 74 69 63 61 6c 2d 61 6c |0ex; ver|tical-al|
|00000430| 69 67 6e 3a 20 31 37 36 | 2e 36 38 65 78 3b 20 22 |ign: 176|.68ex; "|
|00000440| 20 53 52 43 3d 22 69 6d | 67 31 2e 70 6e 67 22 0a | SRC="im|g1.png".|
|00000450| 20 41 4c 54 3d 22 24 5c | 64 69 73 70 6c 61 79 73 | ALT="$\|displays|
|00000460| 74 79 6c 65 20 5c 68 61 | 74 7b 5c 62 65 74 61 7d |tyle \ha|t{\beta}|
|00000470| 24 22 3e 20 3d 20 28 3c | 49 3e 58 27 58 3c 2f 49 |$"> = (<|I>X'X</I|
|00000480| 3e 29 3c 53 55 50 3e 2d | 31 3c 2f 53 55 50 3e 3c |>)<SUP>-|1</SUP><|
|00000490| 49 3e 58 27 79 3c 2f 49 | 3e 0a 3c 2f 44 49 56 3e |I>X'y</I|>.</DIV>|
|000004a0| 3c 50 3e 3c 2f 50 3e 0a | 54 68 65 20 63 6f 6d 70 |<P></P>.|The comp|
|000004b0| 75 74 65 72 20 6c 61 6e | 67 75 61 67 65 73 20 49 |uter lan|guages I|
|000004c0| 27 76 65 20 75 73 65 64 | 20 66 6f 72 20 74 68 69 |'ve used| for thi|
|000004d0| 73 20 70 72 6f 62 6c 65 | 6d 20 6a 75 73 74 20 77 |s proble|m just w|
|000004e0| 65 72 65 0d 0a 6e 6f 74 | 20 61 67 69 6c 65 20 65 |ere..not| agile e|
|000004f0| 6e 6f 75 67 68 20 74 6f | 20 68 61 6e 64 6c 65 20 |nough to| handle |
|00000500| 61 6c 6f 74 20 6f 66 20 | 6d 61 74 72 69 78 20 61 |alot of |matrix a|
|00000510| 6c 67 65 62 72 61 20 28 | 46 4f 52 54 52 41 4e 2c |lgebra (|FORTRAN,|
|00000520| 0d 0a 50 61 73 63 61 6c | 20 61 6e 64 20 43 29 2e |..Pascal| and C).|
|00000530| 20 54 68 69 73 20 43 2b | 2b 20 69 6e 63 61 72 6e | This C+|+ incarn|
|00000540| 61 74 69 6f 6e 20 6f 66 | 20 6d 79 20 61 74 74 65 |ation of| my atte|
|00000550| 6d 70 74 73 20 74 6f 20 | 73 6f 6c 76 65 0d 0a 74 |mpts to |solve..t|
|00000560| 68 69 73 20 70 72 6f 62 | 6c 65 6d 20 77 6f 75 6c |his prob|lem woul|
|00000570| 64 20 63 6f 64 65 20 74 | 68 65 20 65 71 75 61 74 |d code t|he equat|
|00000580| 69 6f 6e 20 61 62 6f 76 | 65 20 61 73 0a 0a 3c 50 |ion abov|e as..<P|
|00000590| 3e 0a 3c 50 52 45 3e 0d | 0a 20 20 20 20 20 20 56 |>.<PRE>.|. V|
|000005a0| 4d 61 74 72 69 78 20 62 | 2c 58 2c 59 3b 0d 0a 20 |Matrix b|,X,Y;.. |
|000005b0| 20 20 20 20 20 2f 2f 20 | 63 6f 64 65 20 74 6f 20 | // |code to |
|000005c0| 72 65 61 64 20 69 6e 20 | 58 20 61 6e 64 20 59 0d |read in |X and Y.|
|000005d0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 2e 0d 0a 20 |. | ... |
|000005e0| 20 20 20 20 20 20 20 20 | 20 20 2e 0d 0a 20 20 20 | | ... |
|000005f0| 20 20 20 20 20 20 20 20 | 2e 0d 0a 20 20 20 20 20 | |... |
|00000600| 20 62 20 3d 20 49 6e 76 | 28 54 72 61 6e 28 58 29 | b = Inv|(Tran(X)|
|00000610| 2a 58 29 2a 54 72 61 6e | 28 58 29 2a 59 3b 0a 3c |*X)*Tran|(X)*Y;.<|
|00000620| 2f 50 52 45 3e 0a 0a 3c | 50 3e 0a 77 68 65 72 65 |/PRE>..<|P>.where|
|00000630| 20 62 2c 20 58 2c 20 61 | 6e 64 20 59 20 61 72 65 | b, X, a|nd Y are|
|00000640| 20 6d 61 74 72 69 63 65 | 73 2e 20 54 68 69 73 20 | matrice|s. This |
|00000650| 6e 6f 74 20 71 75 69 74 | 65 20 61 73 0d 0a 70 6f |not quit|e as..po|
|00000660| 77 65 72 66 75 6c 20 61 | 73 20 73 6f 6d 65 20 6d |werful a|s some m|
|00000670| 61 74 72 69 78 20 69 6e | 74 65 72 70 72 65 74 65 |atrix in|terprete|
|00000680| 72 73 2c 20 62 75 74 20 | 69 74 20 77 6f 72 6b 73 |rs, but |it works|
|00000690| 2e 20 43 2b 2b 20 69 73 | 0d 0a 70 6f 77 65 72 66 |. C++ is|..powerf|
|000006a0| 75 6c 20 65 6e 6f 75 67 | 68 20 66 6f 72 20 74 68 |ul enoug|h for th|
|000006b0| 69 73 20 70 72 6f 62 6c | 65 6d 20 73 69 6e 63 65 |is probl|em since|
|000006c0| 20 69 74 20 63 61 6e 20 | 6f 76 65 72 6c 6f 61 64 | it can |overload|
|000006d0| 0d 0a 66 75 6e 63 74 69 | 6f 6e 73 20 66 6f 72 20 |..functi|ons for |
|000006e0| 6f 62 6a 65 63 74 73 2e | 20 49 74 20 61 6c 73 6f |objects.| It also|
|000006f0| 20 66 6c 65 78 69 62 6c | 65 20 65 6e 6f 75 67 68 | flexibl|e enough|
|00000700| 20 74 6f 20 68 61 6e 64 | 6c 65 0d 0a 74 68 65 20 | to hand|le..the |
|00000710| 72 65 63 75 72 73 69 76 | 65 20 61 6e 64 20 6e 65 |recursiv|e and ne|
|00000720| 73 74 65 64 20 66 75 6e | 63 74 69 6f 6e 20 63 61 |sted fun|ction ca|
|00000730| 6c 6c 73 20 6e 65 65 64 | 65 64 20 66 6f 72 20 6d |lls need|ed for m|
|00000740| 61 74 72 69 78 0d 0a 61 | 6c 67 65 62 72 61 2e 0a |atrix..a|lgebra..|
|00000750| 0a 3c 50 3e 0a 54 68 65 | 20 6e 65 78 74 20 70 72 |.<P>.The| next pr|
|00000760| 6f 62 6c 65 6d 20 77 61 | 73 20 74 6f 20 6d 69 6e |oblem wa|s to min|
|00000770| 69 6d 69 7a 65 20 74 68 | 65 20 6f 76 65 72 68 65 |imize th|e overhe|
|00000780| 61 64 20 6f 66 0d 0a 6d | 61 6e 69 70 75 6c 61 74 |ad of..m|anipulat|
|00000790| 69 6e 67 20 74 68 65 20 | 64 61 74 61 20 73 74 72 |ing the |data str|
|000007a0| 75 63 74 75 72 65 73 20 | 72 65 71 75 69 72 65 64 |uctures |required|
|000007b0| 20 66 6f 72 20 6b 65 65 | 70 69 6e 67 20 74 72 61 | for kee|ping tra|
|000007c0| 63 6b 0d 0a 6f 66 20 61 | 6c 6c 20 6f 66 20 74 68 |ck..of a|ll of th|
|000007d0| 65 20 6d 61 74 72 69 63 | 65 73 2e 20 54 68 65 20 |e matric|es. The |
|000007e0| 61 62 69 6c 69 74 79 20 | 74 6f 20 62 69 6e 64 20 |ability |to bind |
|000007f0| 66 75 6e 63 74 69 6f 6e | 73 20 74 6f 0d 0a 64 61 |function|s to..da|
|00000800| 74 61 20 73 74 72 75 63 | 74 75 72 65 73 20 75 73 |ta struc|tures us|
|00000810| 69 6e 67 20 6f 62 6a 65 | 63 74 73 20 73 6f 6c 76 |ing obje|cts solv|
|00000820| 65 64 20 74 68 69 73 20 | 70 72 6f 62 6c 65 6d 2e |ed this |problem.|
|00000830| 20 49 74 20 77 61 73 0d | 0a 72 65 61 73 6f 6e 61 | It was.|.reasona|
|00000840| 62 6c 79 20 65 61 73 79 | 20 74 6f 20 77 72 69 74 |bly easy| to writ|
|00000850| 65 20 61 20 73 74 61 63 | 6b 20 6f 66 20 6d 61 74 |e a stac|k of mat|
|00000860| 72 69 63 65 73 20 74 6f | 20 6b 65 65 70 20 74 72 |rices to| keep tr|
|00000870| 61 63 6b 0d 0a 6f 66 20 | 74 68 65 20 69 6e 74 65 |ack..of |the inte|
|00000880| 72 6d 65 64 69 61 74 65 | 20 63 61 6c 63 75 6c 61 |rmediate| calcula|
|00000890| 74 69 6f 6e 73 2c 20 61 | 6e 64 20 74 68 65 6e 20 |tions, a|nd then |
|000008a0| 64 65 6c 65 74 65 20 74 | 68 65 0d 0a 75 6e 6e 65 |delete t|he..unne|
|000008b0| 63 65 73 73 61 72 79 20 | 6d 61 74 72 69 63 65 73 |cessary |matrices|
|000008c0| 2e 20 49 74 20 61 6c 73 | 6f 20 6d 61 64 65 20 69 |. It als|o made i|
|000008d0| 74 20 72 65 61 73 6f 6e | 61 62 6c 79 20 65 61 73 |t reason|ably eas|
|000008e0| 79 20 74 6f 0d 0a 61 73 | 73 69 67 6e 20 6d 61 74 |y to..as|sign mat|
|000008f0| 72 69 63 65 73 20 75 73 | 69 6e 67 20 74 68 65 20 |rices us|ing the |
|00000900| 65 71 75 61 6c 73 20 6f | 70 65 72 61 74 6f 72 2e |equals o|perator.|
|00000910| 0a 0a 3c 50 3e 0a 54 68 | 65 20 6e 65 78 74 20 70 |..<P>.Th|e next p|
|00000920| 72 6f 62 6c 65 6d 20 77 | 61 73 20 74 68 65 20 36 |roblem w|as the 6|
|00000930| 34 30 4b 20 62 61 72 72 | 69 65 72 20 6f 6e 20 74 |40K barr|ier on t|
|00000940| 68 65 20 50 43 20 63 6c | 61 73 73 0d 0a 6d 61 63 |he PC cl|ass..mac|
|00000950| 68 69 6e 65 73 2e 20 4d | 6f 73 74 20 6f 66 20 6d |hines. M|ost of m|
|00000960| 79 20 70 72 6f 62 6c 65 | 6d 73 20 61 72 65 20 74 |y proble|ms are t|
|00000970| 6f 6f 20 62 69 67 20 74 | 6f 20 6b 65 65 70 20 61 |oo big t|o keep a|
|00000980| 6c 6c 20 6f 66 0d 0a 74 | 68 65 20 64 61 74 61 20 |ll of..t|he data |
|00000990| 69 6e 20 52 41 4d 2c 20 | 73 6f 20 49 20 68 61 76 |in RAM, |so I hav|
|000009a0| 65 20 74 6f 20 72 65 73 | 6f 72 74 20 74 6f 20 73 |e to res|ort to s|
|000009b0| 70 65 63 69 61 6c 20 64 | 61 74 61 20 49 4f 0d 0a |pecial d|ata IO..|
|000009c0| 74 72 69 63 6b 73 2e 20 | 54 68 69 73 20 69 73 20 |tricks. |This is |
|000009d0| 66 69 6e 65 20 66 6f 72 | 20 61 6e 79 20 73 69 6e |fine for| any sin|
|000009e0| 67 6c 65 20 70 72 6f 62 | 6c 65 6d 2c 20 62 75 74 |gle prob|lem, but|
|000009f0| 20 69 74 20 64 6f 65 73 | 0d 0a 6e 6f 74 20 67 65 | it does|..not ge|
|00000a00| 6e 65 72 61 6c 69 7a 65 | 20 76 65 72 79 20 77 65 |neralize| very we|
|00000a10| 6c 6c 2e 20 49 20 66 6f | 75 6e 64 20 61 20 76 69 |ll. I fo|und a vi|
|00000a20| 72 74 75 61 6c 20 6d 65 | 6d 6f 72 79 20 61 6c 6c |rtual me|mory all|
|00000a30| 6f 63 61 74 6f 72 0d 0a | 74 6f 20 73 6f 6c 76 65 |ocator..|to solve|
|00000a40| 20 74 68 69 73 20 70 72 | 6f 62 6c 65 6d 2e 20 49 | this pr|oblem. I|
|00000a50| 74 20 77 72 69 74 65 73 | 20 74 6f 20 61 20 64 69 |t writes| to a di|
|00000a60| 73 6b 20 66 69 6c 65 2e | 20 54 68 65 20 6e 65 77 |sk file.| The new|
|00000a70| 0d 0a 63 6c 61 73 73 20 | 6f 66 20 33 38 36 20 6d |..class |of 386 m|
|00000a80| 61 63 68 69 6e 65 73 20 | 63 61 6e 20 6b 65 65 70 |achines |can keep|
|00000a90| 20 52 41 4d 20 64 69 73 | 6b 73 20 69 6e 20 65 78 | RAM dis|ks in ex|
|00000aa0| 74 65 6e 64 65 64 0d 0a | 6d 65 6d 6f 72 79 2c 20 |tended..|memory, |
|00000ab0| 73 6f 20 74 68 65 72 65 | 20 69 73 20 6f 6e 6c 79 |so there| is only|
|00000ac0| 20 61 20 6d 6f 64 65 73 | 74 20 70 65 72 66 6f 72 | a modes|t perfor|
|00000ad0| 6d 61 6e 63 65 20 70 65 | 6e 61 6c 74 79 20 66 6f |mance pe|nalty fo|
|00000ae0| 72 0d 0a 61 63 63 65 73 | 73 69 6e 67 20 74 68 65 |r..acces|sing the|
|00000af0| 20 64 61 74 61 20 69 6e | 20 65 6c 65 63 74 72 6f | data in| electro|
|00000b00| 6e 69 63 20 6d 65 6d 6f | 72 79 2e 20 20 54 68 65 |nic memo|ry. The|
|00000b10| 20 76 69 72 74 75 61 6c | 0d 0a 6d 65 6d 6f 72 79 | virtual|..memory|
|00000b20| 20 73 63 68 65 6d 65 20 | 6f 6e 6c 79 20 6b 65 65 | scheme |only kee|
|00000b30| 70 73 20 61 62 6f 75 74 | 20 36 34 20 65 6c 65 6d |ps about| 64 elem|
|00000b40| 65 6e 74 73 20 69 6e 20 | 52 41 4d 2c 20 73 6f 0d |ents in |RAM, so.|
|00000b50| 0a 66 69 6e 64 69 6e 67 | 20 65 6c 65 6d 65 6e 74 |.finding| element|
|00000b60| 73 20 69 6e 20 61 20 6c | 61 72 67 65 20 6d 61 74 |s in a l|arge mat|
|00000b70| 72 69 78 20 69 73 20 73 | 6c 6f 77 65 72 20 74 68 |rix is s|lower th|
|00000b80| 61 6e 20 64 69 72 65 63 | 74 0d 0a 61 63 63 65 73 |an direc|t..acces|
|00000b90| 73 20 74 6f 20 74 68 65 | 20 68 65 61 70 2e 20 54 |s to the| heap. T|
|00000ba0| 68 69 73 20 74 72 61 64 | 65 6f 66 66 20 73 75 69 |his trad|eoff sui|
|00000bb0| 74 65 64 20 6d 65 20 73 | 69 6e 63 65 20 49 20 77 |ted me s|ince I w|
|00000bc0| 6f 75 6c 64 0d 0a 72 61 | 74 68 65 72 20 62 65 20 |ould..ra|ther be |
|00000bd0| 61 62 6c 65 20 74 6f 20 | 75 73 65 20 6d 61 74 72 |able to |use matr|
|00000be0| 69 63 65 73 20 74 68 61 | 74 20 61 72 65 20 70 6f |ices tha|t are po|
|00000bf0| 74 65 6e 74 69 61 6c 6c | 79 20 6c 61 72 67 65 72 |tentiall|y larger|
|00000c00| 0d 0a 74 68 61 6e 20 36 | 34 30 4b 2e 20 41 20 33 |..than 6|40K. A 3|
|00000c10| 20 6f 72 20 34 20 6d 65 | 67 20 52 41 4d 20 64 69 | or 4 me|g RAM di|
|00000c20| 73 6b 20 77 6f 75 6c 64 | 20 73 75 69 74 20 6d 6f |sk would| suit mo|
|00000c30| 73 74 20 6f 66 20 6d 79 | 0d 0a 6e 65 65 64 73 2e |st of my|..needs.|
|00000c40| 20 54 68 65 20 68 61 72 | 64 20 64 72 69 76 65 20 | The har|d drive |
|00000c50| 63 61 6e 20 62 65 20 75 | 73 65 64 20 74 6f 6f 2e |can be u|sed too.|
|00000c60| 20 41 67 61 69 6e 2c 20 | 69 74 20 61 69 6e 27 74 | Again, |it ain't|
|00000c70| 0d 0a 66 61 73 74 2c 20 | 62 75 74 20 69 74 20 77 |..fast, |but it w|
|00000c80| 6f 72 6b 73 2e 0a 0a 3c | 50 3e 0a 54 68 65 20 70 |orks...<|P>.The p|
|00000c90| 72 6f 70 65 72 74 69 65 | 73 20 6f 66 20 43 2b 2b |ropertie|s of C++|
|00000ca0| 20 68 65 6c 70 65 64 20 | 73 6f 6c 76 65 20 74 68 | helped |solve th|
|00000cb0| 65 73 65 20 70 72 6f 62 | 6c 65 6d 73 2e 20 54 68 |ese prob|lems. Th|
|00000cc0| 69 73 0d 0a 64 6f 63 75 | 6d 65 6e 74 20 77 69 6c |is..docu|ment wil|
|00000cd0| 6c 20 64 65 76 65 6c 6f | 70 20 61 20 6d 61 74 72 |l develo|p a matr|
|00000ce0| 69 78 20 63 6c 61 73 73 | 20 66 72 6f 6d 20 6c 6f |ix class| from lo|
|00000cf0| 77 65 72 20 6c 65 76 65 | 6c 0d 0a 66 75 6e 63 74 |wer leve|l..funct|
|00000d00| 69 6f 6e 73 2e 20 54 68 | 65 20 66 69 72 73 74 20 |ions. Th|e first |
|00000d10| 73 74 65 70 20 69 73 20 | 74 6f 20 65 78 70 6c 61 |step is |to expla|
|00000d20| 69 6e 20 74 68 65 20 76 | 69 72 74 75 61 6c 20 6d |in the v|irtual m|
|00000d30| 65 6d 6f 72 79 0d 0a 61 | 6c 6c 6f 63 61 74 6f 72 |emory..a|llocator|
|00000d40| 2e 20 54 68 65 20 6e 65 | 78 74 20 73 74 65 70 20 |. The ne|xt step |
|00000d50| 69 73 20 74 6f 20 65 78 | 70 6c 61 69 6e 20 74 68 |is to ex|plain th|
|00000d60| 65 20 73 74 72 69 6e 67 | 0d 0a 66 75 6e 63 74 69 |e string|..functi|
|00000d70| 6f 6e 73 2e 20 54 68 65 | 20 74 68 69 72 64 20 73 |ons. The| third s|
|00000d80| 74 65 70 20 69 73 20 74 | 6f 20 64 65 76 65 6c 6f |tep is t|o develo|
|00000d90| 70 20 61 20 76 65 63 74 | 6f 72 20 63 6c 61 73 73 |p a vect|or class|
|00000da0| 0d 0a 62 61 73 65 64 20 | 6f 6e 20 74 68 65 20 76 |..based |on the v|
|00000db0| 69 72 74 75 61 6c 20 6d | 65 6d 6f 72 79 20 61 6c |irtual m|emory al|
|00000dc0| 6c 6f 63 61 74 6f 72 2e | 20 54 68 65 20 6e 65 78 |locator.| The nex|
|00000dd0| 74 20 73 74 65 70 20 69 | 73 20 74 6f 0d 0a 65 78 |t step i|s to..ex|
|00000de0| 70 6c 61 69 6e 20 74 68 | 65 20 6d 61 74 72 69 78 |plain th|e matrix|
|00000df0| 20 63 6c 61 73 73 20 61 | 6e 64 20 6d 61 74 72 69 | class a|nd matri|
|00000e00| 78 20 73 74 61 63 6b 20 | 63 6c 61 73 73 65 73 2e |x stack |classes.|
|00000e10| 20 54 68 65 0d 0a 76 69 | 72 74 75 61 6c 20 76 65 | The..vi|rtual ve|
|00000e20| 63 74 6f 72 20 63 6c 61 | 73 73 20 69 73 20 74 68 |ctor cla|ss is th|
|00000e30| 65 20 62 61 73 65 20 63 | 6c 61 73 73 20 66 6f 72 |e base c|lass for|
|00000e40| 20 74 68 65 20 6d 61 74 | 72 69 78 0d 0a 63 6c 61 | the mat|rix..cla|
|00000e50| 73 73 2e 20 54 68 65 20 | 6d 61 74 72 69 78 20 73 |ss. The |matrix s|
|00000e60| 74 61 63 6b 20 69 73 20 | 64 65 72 69 76 65 64 20 |tack is |derived |
|00000e70| 66 72 6f 6d 20 74 68 65 | 20 6d 61 74 72 69 78 20 |from the| matrix |
|00000e80| 63 6c 61 73 73 2e 0d 0a | 44 65 76 65 6c 6f 70 69 |class...|Developi|
|00000e90| 6e 67 20 61 20 67 65 6e | 65 72 61 6c 20 6d 61 74 |ng a gen|eral mat|
|00000ea0| 72 69 78 20 70 72 6f 67 | 72 61 6d 20 69 73 20 68 |rix prog|ram is h|
|00000eb0| 61 72 64 20 77 69 74 68 | 6f 75 74 0d 0a 65 6e 63 |ard with|out..enc|
|00000ec0| 61 70 73 75 6c 61 74 69 | 6f 6e 20 61 6e 64 20 69 |apsulati|on and i|
|00000ed0| 6e 68 65 72 69 74 61 6e | 63 65 2e 0a 0a 3c 50 3e |nheritan|ce...<P>|
|00000ee0| 0a 0a 3c 48 52 3e 0a 0a | 3c 2f 42 4f 44 59 3e 0a |..<HR>..|</BODY>.|
|00000ef0| 3c 2f 48 54 4d 4c 3e 0a | |</HTML>.| |
+--------+-------------------------+-------------------------+--------+--------+