home *** CD-ROM | disk | FTP | other *** search
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was processed as: SHell self-extracting ARchive
(archive/shar).
You can browse this item here: part01
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 75 75 | 6e 65 74 21 72 73 0a 46 |Path: uu|net!rs.F|
|00000010| 72 6f 6d 3a 20 72 73 40 | 75 75 6e 65 74 2e 55 55 |rom: rs@|uunet.UU|
|00000020| 2e 4e 45 54 20 28 52 69 | 63 68 20 53 61 6c 7a 29 |.NET (Ri|ch Salz)|
|00000030| 0a 4e 65 77 73 67 72 6f | 75 70 73 3a 20 63 6f 6d |.Newsgro|ups: com|
|00000040| 70 2e 73 6f 75 72 63 65 | 73 2e 75 6e 69 78 0a 53 |p.source|s.unix.S|
|00000050| 75 62 6a 65 63 74 3a 20 | 76 31 30 69 30 33 34 3a |ubject: |v10i034:|
|00000060| 20 49 6e 74 65 72 70 72 | 65 74 65 64 20 46 75 6e | Interpr|eted Fun|
|00000070| 63 74 69 6f 6e 61 6c 20 | 50 72 6f 67 72 61 6d 6d |ctional |Programm|
|00000080| 69 6e 67 20 6c 61 6e 75 | 61 67 65 2c 20 50 61 72 |ing lanu|age, Par|
|00000090| 74 20 30 31 2f 30 37 0a | 4d 65 73 73 61 67 65 2d |t 01/07.|Message-|
|000000a0| 49 44 3a 20 3c 35 37 31 | 40 75 75 6e 65 74 2e 55 |ID: <571|@uunet.U|
|000000b0| 55 2e 4e 45 54 3e 0a 44 | 61 74 65 3a 20 37 20 4a |U.NET>.D|ate: 7 J|
|000000c0| 75 6c 20 38 37 20 30 34 | 3a 33 32 3a 30 37 20 47 |ul 87 04|:32:07 G|
|000000d0| 4d 54 0a 4f 72 67 61 6e | 69 7a 61 74 69 6f 6e 3a |MT.Organ|ization:|
|000000e0| 20 55 55 4e 45 54 20 43 | 6f 6d 6d 75 6e 69 63 61 | UUNET C|ommunica|
|000000f0| 74 69 6f 6e 73 20 53 65 | 72 76 69 63 65 73 2c 20 |tions Se|rvices, |
|00000100| 41 72 6c 69 6e 67 74 6f | 6e 2c 20 56 41 0a 4c 69 |Arlingto|n, VA.Li|
|00000110| 6e 65 73 3a 20 31 32 32 | 34 0a 41 70 70 72 6f 76 |nes: 122|4.Approv|
|00000120| 65 64 3a 20 72 73 40 75 | 75 6e 65 74 2e 75 75 2e |ed: rs@u|unet.uu.|
|00000130| 6e 65 74 0a 0a 4d 6f 64 | 2e 73 6f 75 72 63 65 73 |net..Mod|.sources|
|00000140| 3a 20 56 6f 6c 75 6d 65 | 20 31 30 2c 20 4e 75 6d |: Volume| 10, Num|
|00000150| 62 65 72 20 33 34 0a 53 | 75 62 6d 69 74 74 65 64 |ber 34.S|ubmitted|
|00000160| 20 62 79 3a 20 72 6f 62 | 69 73 6f 6e 40 62 2e 63 | by: rob|ison@b.c|
|00000170| 73 2e 75 69 75 63 2e 65 | 64 75 20 28 41 72 63 68 |s.uiuc.e|du (Arch|
|00000180| 20 52 6f 62 69 73 6f 6e | 29 0a 41 72 63 68 69 76 | Robison|).Archiv|
|00000190| 65 2d 6e 61 6d 65 3a 20 | 69 66 70 2f 50 61 72 74 |e-name: |ifp/Part|
|000001a0| 30 31 0a 0a 49 46 50 5b | 31 5d 20 69 73 20 61 20 |01..IFP[|1] is a |
|000001b0| 76 61 72 69 61 6e 74 20 | 6f 66 20 42 61 63 6b 75 |variant |of Backu|
|000001c0| 73 27 20 46 50 20 5b 32 | 5d 2e 20 20 54 68 65 20 |s' FP [2|]. The |
|000001d0| 49 46 50 20 69 6e 74 65 | 72 70 72 65 74 65 72 20 |IFP inte|rpreter |
|000001e0| 69 73 20 77 72 69 74 74 | 65 6e 0a 69 6e 20 43 20 |is writt|en.in C |
|000001f0| 61 6e 64 20 69 73 20 61 | 6e 20 6f 72 64 65 72 20 |and is a|n order |
|00000200| 6f 66 20 6d 61 67 6e 69 | 74 75 64 65 20 66 61 73 |of magni|tude fas|
|00000210| 74 65 72 20 74 68 61 6e | 20 74 68 65 20 42 53 44 |ter than| the BSD|
|00000220| 20 34 2e 32 20 46 50 20 | 5b 33 5d 2e 0a 54 68 65 | 4.2 FP |[3]..The|
|00000230| 20 69 6e 74 65 72 70 72 | 65 74 65 72 20 73 68 6f | interpr|eter sho|
|00000240| 75 6c 64 20 72 75 6e 20 | 6f 6e 20 61 6e 79 20 55 |uld run |on any U|
|00000250| 4e 49 58 20 62 6f 78 2e | 0a 0a 41 72 63 68 20 44 |NIX box.|..Arch D|
|00000260| 2e 20 52 6f 62 69 73 6f | 6e 0a 55 6e 69 76 65 72 |. Robiso|n.Univer|
|00000270| 73 69 74 79 20 6f 66 20 | 49 6c 6c 69 6e 6f 69 73 |sity of |Illinois|
|00000280| 20 61 74 20 55 72 62 61 | 6e 61 2d 43 68 61 6d 70 | at Urba|na-Champ|
|00000290| 61 69 67 6e 0a 09 0a 43 | 53 4e 45 54 3a 20 72 6f |aign...C|SNET: ro|
|000002a0| 62 69 73 6f 6e 40 55 49 | 55 43 2e 43 53 4e 45 54 |bison@UI|UC.CSNET|
|000002b0| 0a 55 55 43 50 3a 20 7b | 69 68 6e 70 34 2c 70 75 |.UUCP: {|ihnp4,pu|
|000002c0| 72 2d 65 65 2c 63 6f 6e | 76 65 78 7d 21 75 69 75 |r-ee,con|vex}!uiu|
|000002d0| 63 64 63 73 21 72 6f 62 | 69 73 6f 6e 0a 41 52 50 |cdcs!rob|ison.ARP|
|000002e0| 41 3a 20 72 6f 62 69 73 | 6f 6e 40 42 2e 43 53 2e |A: robis|on@B.CS.|
|000002f0| 55 49 55 43 2e 45 44 55 | 20 28 72 6f 62 69 73 6f |UIUC.EDU| (robiso|
|00000300| 6e 40 55 49 55 43 2e 41 | 52 50 41 29 0a 0a 47 65 |n@UIUC.A|RPA)..Ge|
|00000310| 6e 65 72 61 6c 20 52 65 | 66 65 72 65 6e 63 65 73 |neral Re|ferences|
|00000320| 0a 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.-------|--------|
|00000330| 2d 2d 2d 0a 0a 5b 31 5d | 20 20 41 72 63 68 20 44 |---..[1]| Arch D|
|00000340| 2e 20 52 6f 62 69 73 6f | 6e 2c 20 22 49 6c 6c 69 |. Robiso|n, "Illi|
|00000350| 6e 6f 69 73 20 20 46 75 | 6e 63 74 69 6f 6e 61 6c |nois Fu|nctional|
|00000360| 20 20 50 72 6f 67 72 61 | 6d 6d 69 6e 67 3a 20 20 | Progra|mming: |
|00000370| 41 0a 20 20 20 20 20 54 | 75 74 6f 72 69 61 6c 2c |A. T|utorial,|
|00000380| 22 20 42 59 54 45 20 56 | 6f 6c 2e 20 31 32 2c 32 |" BYTE V|ol. 12,2|
|00000390| 20 70 70 2e 20 31 31 35 | 2d 31 32 35 20 4d 63 47 | pp. 115|-125 McG|
|000003a0| 72 61 77 2d 48 69 6c 6c | 20 49 6e 63 2e 2c 0a 20 |raw-Hill| Inc.,. |
|000003b0| 20 20 20 20 28 46 65 62 | 72 75 61 72 79 20 31 39 | (Feb|ruary 19|
|000003c0| 38 37 29 2e 0a 0a 5b 32 | 5d 20 20 4a 6f 68 6e 20 |87)...[2|] John |
|000003d0| 42 61 63 6b 75 73 2c 20 | 22 43 61 6e 20 50 72 6f |Backus, |"Can Pro|
|000003e0| 67 72 61 6d 6d 69 6e 67 | 20 42 65 20 4c 69 62 65 |gramming| Be Libe|
|000003f0| 72 61 74 65 64 20 66 72 | 6f 6d 20 74 68 65 20 76 |rated fr|om the v|
|00000400| 6f 6e 0a 20 20 20 20 20 | 4e 65 75 6d 61 6e 6e 20 |on. |Neumann |
|00000410| 20 53 74 79 6c 65 3f 20 | 20 20 41 20 46 75 6e 63 | Style? | A Func|
|00000420| 74 69 6f 6e 61 6c 20 53 | 74 79 6c 65 20 61 6e 64 |tional S|tyle and|
|00000430| 20 49 74 73 20 41 6c 67 | 65 62 72 61 20 6f 66 0a | Its Alg|ebra of.|
|00000440| 20 20 20 20 20 50 72 6f | 67 72 61 6d 73 2c 22 20 | Pro|grams," |
|00000450| 43 41 43 4d 20 20 56 6f | 6c 2e 20 20 32 31 2c 38 |CACM Vo|l. 21,8|
|00000460| 20 70 70 2e 20 20 36 31 | 33 2d 36 34 31 20 20 41 | pp. 61|3-641 A|
|00000470| 43 4d 2c 20 20 28 41 75 | 67 75 73 74 0a 20 20 20 |CM, (Au|gust. |
|00000480| 20 20 31 39 37 38 29 2e | 0a 0a 5b 33 5d 20 20 53 | 1978).|..[3] S|
|00000490| 63 6f 74 74 20 42 61 64 | 65 6e 2c 20 22 42 65 72 |cott Bad|en, "Ber|
|000004a0| 6b 65 6c 65 79 20 46 50 | 20 20 55 73 65 72 27 73 |keley FP| User's|
|000004b0| 20 20 4d 61 6e 75 61 6c | 2c 20 20 52 65 76 2e 20 | Manual|, Rev. |
|000004c0| 20 34 2e 31 2c 22 0a 20 | 20 20 20 20 55 4e 49 58 | 4.1,". | UNIX|
|000004d0| 20 50 72 6f 67 72 61 6d | 6d 65 72 73 20 4d 61 6e | Program|mers Man|
|000004e0| 75 61 6c 2c 20 28 4a 75 | 6c 79 20 32 37 2c 31 39 |ual, (Ju|ly 27,19|
|000004f0| 38 33 29 2e 0a 0a 0a 23 | 21 20 2f 62 69 6e 2f 73 |83)....#|! /bin/s|
|00000500| 68 0a 23 20 54 68 69 73 | 20 69 73 20 61 20 73 68 |h.# This| is a sh|
|00000510| 65 6c 6c 20 61 72 63 68 | 69 76 65 2c 20 6d 65 61 |ell arch|ive, mea|
|00000520| 6e 69 6e 67 3a 0a 23 20 | 31 2e 20 52 65 6d 6f 76 |ning:.# |1. Remov|
|00000530| 65 20 65 76 65 72 79 74 | 68 69 6e 67 20 61 62 6f |e everyt|hing abo|
|00000540| 76 65 20 74 68 65 20 23 | 21 20 2f 62 69 6e 2f 73 |ve the #|! /bin/s|
|00000550| 68 20 6c 69 6e 65 2e 0a | 23 20 32 2e 20 53 61 76 |h line..|# 2. Sav|
|00000560| 65 20 74 68 65 20 72 65 | 73 75 6c 74 69 6e 67 20 |e the re|sulting |
|00000570| 74 65 78 74 20 69 6e 20 | 61 20 66 69 6c 65 2e 0a |text in |a file..|
|00000580| 23 20 33 2e 20 45 78 65 | 63 75 74 65 20 74 68 65 |# 3. Exe|cute the|
|00000590| 20 66 69 6c 65 20 77 69 | 74 68 20 2f 62 69 6e 2f | file wi|th /bin/|
|000005a0| 73 68 2e 0a 23 20 54 68 | 65 20 66 6f 6c 6c 6f 77 |sh..# Th|e follow|
|000005b0| 69 6e 67 20 66 69 6c 65 | 73 20 77 69 6c 6c 20 62 |ing file|s will b|
|000005c0| 65 20 63 72 65 61 74 65 | 64 3a 0a 23 09 52 45 41 |e create|d:.#.REA|
|000005d0| 44 4d 45 0a 23 09 69 66 | 70 2e 31 0a 23 09 52 75 |DME.#.if|p.1.#.Ru|
|000005e0| 6e 49 46 50 0a 23 09 66 | 70 72 6f 6f 74 0a 65 78 |nIFP.#.f|proot.ex|
|000005f0| 70 6f 72 74 20 50 41 54 | 48 3b 20 50 41 54 48 3d |port PAT|H; PATH=|
|00000600| 2f 62 69 6e 3a 24 50 41 | 54 48 0a 69 66 20 74 65 |/bin:$PA|TH.if te|
|00000610| 73 74 20 2d 66 20 27 52 | 45 41 44 4d 45 27 0a 74 |st -f 'R|EADME'.t|
|00000620| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|00000630| 6f 76 65 72 2d 77 72 69 | 74 69 6e 67 20 65 78 69 |over-wri|ting exi|
|00000640| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 52 45 41 |sting fi|le "'REA|
|00000650| 44 4d 45 27 22 0a 66 69 | 0a 63 61 74 20 3c 3c 20 |DME'".fi|.cat << |
|00000660| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 52 45 41 |\SHAR_EO|F > 'REA|
|00000670| 44 4d 45 27 0a 54 68 69 | 73 20 64 69 72 65 63 74 |DME'.Thi|s direct|
|00000680| 6f 72 79 20 63 6f 6e 74 | 61 69 6e 73 20 74 68 65 |ory cont|ains the|
|00000690| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 73 75 62 64 69 | followi|ng subdi|
|000006a0| 72 65 63 74 6f 72 69 65 | 73 20 61 6e 64 20 66 69 |rectorie|s and fi|
|000006b0| 6c 65 73 3a 0a 0a 09 52 | 45 41 44 4d 45 20 2d 20 |les:...R|EADME - |
|000006c0| 74 68 69 73 20 66 69 6c | 65 0a 0a 09 52 75 6e 49 |this fil|e...RunI|
|000006d0| 46 50 20 2d 20 73 68 65 | 6c 6c 20 73 63 72 69 70 |FP - she|ll scrip|
|000006e0| 74 20 77 68 69 63 68 20 | 72 75 6e 73 20 49 46 50 |t which |runs IFP|
|000006f0| 20 69 6e 74 65 72 70 72 | 65 74 65 72 0a 0a 09 66 | interpr|eter...f|
|00000700| 70 72 6f 6f 74 20 2d 20 | 49 46 50 20 64 65 6d 6f |proot - |IFP demo|
|00000710| 6e 73 74 72 61 74 69 6f | 6e 20 72 6f 6f 74 20 64 |nstratio|n root d|
|00000720| 69 72 65 63 74 6f 72 79 | 0a 09 66 70 72 6f 6f 74 |irectory|..fproot|
|00000730| 2f 64 65 6d 6f 20 2d 20 | 64 65 6d 6f 6e 73 74 72 |/demo - |demonstr|
|00000740| 61 74 69 6f 6e 20 66 75 | 6e 63 74 69 6f 6e 73 0a |ation fu|nctions.|
|00000750| 0a 09 69 6e 74 65 72 70 | 20 2d 20 73 6f 75 72 63 |..interp| - sourc|
|00000760| 65 20 63 6f 64 65 20 61 | 6e 64 20 4d 61 6b 65 66 |e code a|nd Makef|
|00000770| 69 6c 65 20 66 6f 72 20 | 49 46 50 20 69 6e 74 65 |ile for |IFP inte|
|00000780| 72 70 72 65 74 65 72 0a | 0a 09 6d 61 6e 75 61 6c |rpreter.|..manual|
|00000790| 20 2d 20 74 72 6f 66 66 | 20 66 69 6c 65 73 20 61 | - troff| files a|
|000007a0| 6e 64 20 4d 61 6b 65 66 | 69 6c 65 20 66 6f 72 20 |nd Makef|ile for |
|000007b0| 49 46 50 20 6d 61 6e 75 | 61 6c 0a 53 48 41 52 5f |IFP manu|al.SHAR_|
|000007c0| 45 4f 46 0a 63 68 6d 6f | 64 20 2b 78 20 27 52 45 |EOF.chmo|d +x 'RE|
|000007d0| 41 44 4d 45 27 0a 69 66 | 20 74 65 73 74 20 2d 66 |ADME'.if| test -f|
|000007e0| 20 27 69 66 70 2e 31 27 | 0a 74 68 65 6e 0a 09 65 | 'ifp.1'|.then..e|
|000007f0| 63 68 6f 20 73 68 61 72 | 3a 20 6f 76 65 72 2d 77 |cho shar|: over-w|
|00000800| 72 69 74 69 6e 67 20 65 | 78 69 73 74 69 6e 67 20 |riting e|xisting |
|00000810| 66 69 6c 65 20 22 27 69 | 66 70 2e 31 27 22 0a 66 |file "'i|fp.1'".f|
|00000820| 69 0a 63 61 74 20 3c 3c | 20 5c 53 48 41 52 5f 45 |i.cat <<| \SHAR_E|
|00000830| 4f 46 20 3e 20 27 69 66 | 70 2e 31 27 0a 2e 54 48 |OF > 'if|p.1'..TH|
|00000840| 20 49 46 50 20 31 20 22 | 4a 61 6e 20 32 38 2c 20 | IFP 1 "|Jan 28, |
|00000850| 31 39 38 37 22 0a 2e 55 | 43 20 34 0a 2e 53 48 20 |1987"..U|C 4..SH |
|00000860| 4e 41 4d 45 0a 69 66 70 | 20 5c 2d 20 49 6c 6c 69 |NAME.ifp| \- Illi|
|00000870| 6e 6f 69 73 20 46 50 20 | 69 6e 74 65 72 70 72 65 |nois FP |interpre|
|00000880| 74 65 72 20 0a 2e 53 48 | 20 53 59 4e 4f 50 53 49 |ter ..SH| SYNOPSI|
|00000890| 53 0a 2e 42 20 69 66 70 | 0a 5b 20 6f 70 74 69 6f |S..B ifp|.[ optio|
|000008a0| 6e 20 5d 20 0a 2e 53 48 | 20 44 45 53 43 52 49 50 |n ] ..SH| DESCRIP|
|000008b0| 54 49 4f 4e 0a 2e 49 20 | 49 66 70 0a 73 74 61 72 |TION..I |Ifp.star|
|000008c0| 74 73 20 74 68 65 20 49 | 6c 6c 69 6e 6f 69 73 20 |ts the I|llinois |
|000008d0| 46 50 20 69 6e 74 65 72 | 70 72 65 74 65 72 2e 0a |FP inter|preter..|
|000008e0| 2e 50 50 0a 2e 49 20 49 | 66 70 0a 75 6e 64 65 72 |.PP..I I|fp.under|
|000008f0| 73 74 61 6e 64 73 20 73 | 65 76 65 72 61 6c 20 6f |stands s|everal o|
|00000900| 70 74 69 6f 6e 73 2e 20 | 20 4e 6f 72 6d 61 6c 6c |ptions. | Normall|
|00000910| 79 2c 20 6e 6f 20 6f 70 | 74 69 6f 6e 73 20 61 72 |y, no op|tions ar|
|00000920| 65 20 72 65 71 75 69 72 | 65 64 2e 0a 4d 6f 73 74 |e requir|ed..Most|
|00000930| 20 6f 66 20 74 68 65 20 | 6f 70 74 69 6f 6e 73 20 | of the |options |
|00000940| 61 72 65 20 66 6f 72 20 | 65 78 70 65 72 69 6d 65 |are for |experime|
|00000950| 6e 74 61 6c 20 77 6f 72 | 6b 2e 20 20 0a 4e 6f 74 |ntal wor|k. .Not|
|00000960| 20 61 6c 6c 20 28 6f 72 | 20 65 76 65 6e 20 61 6e | all (or| even an|
|00000970| 79 29 20 6f 66 20 74 68 | 65 20 6f 70 74 69 6f 6e |y) of th|e option|
|00000980| 73 20 6d 61 79 0a 65 78 | 69 73 74 20 66 6f 72 20 |s may.ex|ist for |
|00000990| 61 20 70 61 72 74 69 63 | 75 6c 61 72 20 76 65 72 |a partic|ular ver|
|000009a0| 73 69 6f 6e 20 6f 66 20 | 74 68 65 20 69 6e 74 65 |sion of |the inte|
|000009b0| 72 70 72 65 74 65 72 2e | 0a 2e 54 50 0a 2e 42 20 |rpreter.|..TP..B |
|000009c0| 5c 2d 6c 0a 50 72 69 6e | 74 20 61 6c 6c 20 66 75 |\-l.Prin|t all fu|
|000009d0| 6e 63 74 69 6f 6e 73 20 | 77 69 74 68 20 66 75 6c |nctions |with ful|
|000009e0| 6c 20 70 61 74 68 6e 61 | 6d 65 2e 20 20 0a 55 73 |l pathna|me. .Us|
|000009f0| 65 66 75 6c 20 66 6f 72 | 20 64 65 62 75 67 67 69 |eful for| debuggi|
|00000a00| 6e 67 20 73 63 6f 70 65 | 20 70 72 6f 62 6c 65 6d |ng scope| problem|
|00000a10| 73 2e 0a 2e 54 50 0a 2e | 42 20 5c 2d 65 5b 30 31 |s...TP..|B \-e[01|
|00000a20| 32 5d 0a 54 75 72 6e 20 | 6f 6e 20 65 78 70 72 65 |2].Turn |on expre|
|00000a30| 73 73 69 6f 6e 20 63 61 | 63 68 65 2e 20 20 54 68 |ssion ca|che. Th|
|00000a40| 65 20 63 61 63 68 65 20 | 6d 61 79 20 62 65 20 74 |e cache |may be t|
|00000a50| 75 72 6e 65 64 20 6f 6e | 20 66 6f 72 20 61 6e 79 |urned on| for any|
|00000a60| 20 73 75 62 73 65 74 20 | 6f 66 3a 0a 2e 6e 66 0a | subset |of:..nf.|
|00000a70| 09 30 09 50 72 69 6d 69 | 74 69 76 65 20 66 75 6e |.0.Primi|tive fun|
|00000a80| 63 74 69 6f 6e 73 0a 09 | 31 09 55 73 65 72 2d 64 |ctions..|1.User-d|
|00000a90| 65 66 69 6e 65 64 20 66 | 75 6e 63 74 69 6f 6e 73 |efined f|unctions|
|00000aa0| 0a 09 32 09 50 46 4f 73 | 0a 2e 66 69 0a 54 6f 20 |..2.PFOs|..fi.To |
|00000ab0| 73 65 65 20 74 68 65 20 | 63 61 63 68 65 20 73 74 |see the |cache st|
|00000ac0| 61 74 69 73 74 69 63 73 | 2c 20 67 69 76 65 20 74 |atistics|, give t|
|00000ad0| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 22 63 61 63 68 |he comma|nd "cach|
|00000ae0| 65 22 20 74 6f 20 74 68 | 65 20 69 6e 74 65 72 70 |e" to th|e interp|
|00000af0| 72 65 74 65 72 2e 0a 2e | 54 50 0a 2e 42 20 5c 2d |reter...|TP..B \-|
|00000b00| 70 6e 0a 28 4d 75 6c 74 | 69 6d 61 78 20 6f 6e 6c |pn.(Mult|imax onl|
|00000b10| 79 29 20 54 68 69 73 20 | 6f 70 74 69 6f 6e 20 73 |y) This |option s|
|00000b20| 70 65 63 69 66 69 65 73 | 20 74 68 61 74 20 74 68 |pecifies| that th|
|00000b30| 65 20 69 6e 74 65 72 70 | 72 65 74 65 72 20 73 68 |e interp|reter sh|
|00000b40| 6f 75 6c 64 20 62 65 20 | 72 75 6e 0a 61 73 20 6e |ould be |run.as n|
|00000b50| 20 70 61 72 61 6c 6c 65 | 6c 20 70 72 6f 63 65 73 | paralle|l proces|
|00000b60| 73 65 73 2e 0a 2e 54 50 | 0a 2e 42 20 5c 2d 66 0a |ses...TP|..B \-f.|
|00000b70| 28 4d 75 6c 74 69 6d 61 | 78 20 6f 6e 6c 79 29 20 |(Multima|x only) |
|00000b80| 50 72 69 6e 74 20 65 78 | 70 72 65 73 73 69 6f 6e |Print ex|pression|
|00000b90| 20 71 75 65 75 65 20 73 | 74 61 74 69 73 74 69 63 | queue s|tatistic|
|00000ba0| 73 2e 0a 2e 54 50 20 0a | 2e 42 20 20 5c 2d 73 6e |s...TP .|.B \-sn|
|00000bb0| 0a 28 4d 75 6c 74 69 6d | 61 78 20 6f 6e 6c 79 29 |.(Multim|ax only)|
|00000bc0| 20 55 73 65 20 73 74 61 | 63 6b 20 6f 66 20 6d 61 | Use sta|ck of ma|
|00000bd0| 78 2e 20 64 65 70 74 68 | 20 6e 20 66 6f 72 20 65 |x. depth| n for e|
|00000be0| 78 70 72 65 73 73 69 6f | 6e 20 73 63 68 65 64 75 |xpressio|n schedu|
|00000bf0| 6c 69 6e 67 2e 0a 2e 54 | 50 0a 2e 42 20 5c 2d 71 |ling...T|P..B \-q|
|00000c00| 6e 0a 28 4d 75 6c 74 69 | 6d 61 78 20 6f 6e 6c 79 |n.(Multi|max only|
|00000c10| 29 20 55 73 65 20 71 75 | 65 75 65 20 6f 66 20 6d |) Use qu|eue of m|
|00000c20| 61 78 2e 20 6c 65 6e 67 | 74 68 20 6e 20 66 6f 72 |ax. leng|th n for|
|00000c30| 20 65 78 70 72 65 73 73 | 69 6f 6e 20 73 63 68 65 | express|ion sche|
|00000c40| 64 75 6c 69 6e 67 2e 0a | 2e 54 50 0a 2e 42 20 5c |duling..|.TP..B \|
|00000c50| 2d 64 5b 70 61 66 72 69 | 63 78 68 75 73 6c 65 5d |-d[pafri|cxhusle]|
|00000c60| 0a 54 75 72 6e 20 6f 6e | 20 73 70 79 20 70 6f 69 |.Turn on| spy poi|
|00000c70| 6e 74 73 20 63 6f 72 72 | 65 73 70 6f 6e 64 69 6e |nts corr|espondin|
|00000c80| 67 20 74 6f 20 73 65 6c | 65 63 74 65 64 20 6c 65 |g to sel|ected le|
|00000c90| 74 74 65 72 73 2e 0a 2e | 6e 66 0a 09 70 09 70 61 |tters...|nf..p.pa|
|00000ca0| 72 73 65 72 0a 09 61 09 | 6d 65 6d 6f 72 79 20 61 |rser..a.|memory a|
|00000cb0| 6c 6c 6f 63 61 74 69 6f | 6e 0a 09 66 09 66 69 6c |llocatio|n..f.fil|
|00000cc0| 65 20 69 6f 0a 09 72 09 | 72 65 66 65 72 65 6e 63 |e io..r.|referenc|
|00000cd0| 65 20 63 6f 75 6e 74 73 | 0a 09 69 09 69 6e 69 74 |e counts|..i.init|
|00000ce0| 69 61 6c 69 7a 61 74 69 | 6f 6e 0a 09 63 09 65 78 |ializati|on..c.ex|
|00000cf0| 70 72 65 73 73 69 6f 6e | 20 63 61 63 68 65 0a 09 |pression| cache..|
|00000d00| 78 09 65 78 74 65 6e 64 | 65 64 20 64 65 66 69 6e |x.extend|ed defin|
|00000d10| 69 74 69 6f 6e 73 0a 09 | 68 09 68 79 70 65 72 63 |itions..|h.hyperc|
|00000d20| 75 62 65 0a 09 75 09 4d | 75 6c 74 69 6d 61 78 0a |ube..u.M|ultimax.|
|00000d30| 09 73 09 53 65 6d 61 70 | 68 6f 72 65 73 0a 09 6c |.s.Semap|hores..l|
|00000d40| 09 46 72 65 65 20 6c 69 | 73 74 0a 09 65 09 45 78 |.Free li|st..e.Ex|
|00000d50| 70 72 65 73 73 69 6f 6e | 20 73 63 6b 65 64 75 6c |pression| sckedul|
|00000d60| 69 6e 67 0a 2e 66 69 0a | 46 6f 72 20 65 78 61 6d |ing..fi.|For exam|
|00000d70| 70 6c 65 2c 20 2d 64 61 | 72 20 74 75 72 6e 73 20 |ple, -da|r turns |
|00000d80| 6f 6e 20 73 70 79 20 70 | 6f 69 6e 74 73 20 66 6f |on spy p|oints fo|
|00000d90| 72 20 6d 65 6d 6f 72 79 | 20 61 6c 6c 6f 63 61 74 |r memory| allocat|
|00000da0| 69 6f 6e 20 61 6e 64 20 | 0a 72 65 66 65 72 65 6e |ion and |.referen|
|00000db0| 63 65 20 63 6f 75 6e 74 | 73 2e 0a 2e 53 48 20 46 |ce count|s...SH F|
|00000dc0| 49 4c 45 53 0a 2e 74 61 | 20 5c 77 27 2f 75 73 72 |ILES..ta| \w'/usr|
|00000dd0| 2f 6c 6f 63 61 6c 2f 6c | 69 62 2f 6c 69 62 2a 2e |/local/l|ib/lib*.|
|00000de0| 61 5c 20 5c 20 27 75 0a | 69 66 70 09 69 6e 74 65 |a\ \ 'u.|ifp.inte|
|00000df0| 72 70 72 65 74 65 72 20 | 0a 2e 62 72 0a 2e 53 48 |rpreter |..br..SH|
|00000e00| 20 22 53 45 45 20 41 4c | 53 4f 22 0a 49 6c 6c 69 | "SEE AL|SO".Illi|
|00000e10| 6e 6f 69 73 20 46 50 20 | 55 73 65 72 27 73 20 4d |nois FP |User's M|
|00000e20| 61 6e 75 61 6c 0a 2e 73 | 70 20 32 0a 41 20 46 75 |anual..s|p 2.A Fu|
|00000e30| 6e 63 74 69 6f 6e 61 6c | 20 50 72 6f 67 72 61 6d |nctional| Program|
|00000e40| 6d 69 6e 67 20 49 6e 74 | 65 72 70 72 65 74 65 72 |ming Int|erpreter|
|00000e50| 20 28 54 48 45 53 49 53 | 2c 20 55 6e 69 76 65 72 | (THESIS|, Univer|
|00000e60| 69 73 69 74 79 20 6f 66 | 20 49 6c 6c 69 6e 6f 69 |isity of| Illinoi|
|00000e70| 73 29 20 0a 2e 73 70 20 | 32 0a 2e 75 6c 0a 49 6c |s) ..sp |2..ul.Il|
|00000e80| 6c 69 6e 6f 69 73 20 46 | 75 6e 63 74 69 6f 6e 61 |linois F|unctiona|
|00000e90| 6c 20 50 72 6f 67 72 61 | 6d 6d 69 6e 67 3a 20 41 |l Progra|mming: A|
|00000ea0| 20 54 75 74 6f 72 69 61 | 6c 20 0a 28 42 59 54 45 | Tutoria|l .(BYTE|
|00000eb0| 2c 20 46 65 62 2e 20 31 | 39 38 37 29 0a 2e 62 72 |, Feb. 1|987)..br|
|00000ec0| 0a 66 70 28 31 29 0a 2e | 53 48 20 42 55 47 53 0a |.fp(1)..|SH BUGS.|
|00000ed0| 50 72 6f 67 72 61 6d 6d | 69 6e 67 20 69 6e 20 49 |Programm|ing in I|
|00000ee0| 46 50 20 73 74 69 6c 6c | 20 72 65 71 75 69 72 65 |FP still| require|
|00000ef0| 73 20 74 68 69 6e 6b 69 | 6e 67 2e 20 20 53 6f 6d |s thinki|ng. Som|
|00000f00| 65 20 74 68 65 20 6f 70 | 74 69 6f 6e 73 20 61 72 |e the op|tions ar|
|00000f10| 65 20 69 6e 63 6f 6d 70 | 61 74 69 62 6c 65 2e 0a |e incomp|atible..|
|00000f20| 2e 53 48 20 41 55 54 48 | 4f 52 0a 41 72 63 68 20 |.SH AUTH|OR.Arch |
|00000f30| 44 2e 20 52 6f 62 69 73 | 6f 6e 0a 53 48 41 52 5f |D. Robis|on.SHAR_|
|00000f40| 45 4f 46 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |EOF.if t|est -f '|
|00000f50| 52 75 6e 49 46 50 27 0a | 74 68 65 6e 0a 09 65 63 |RunIFP'.|then..ec|
|00000f60| 68 6f 20 73 68 61 72 3a | 20 6f 76 65 72 2d 77 72 |ho shar:| over-wr|
|00000f70| 69 74 69 6e 67 20 65 78 | 69 73 74 69 6e 67 20 66 |iting ex|isting f|
|00000f80| 69 6c 65 20 22 27 52 75 | 6e 49 46 50 27 22 0a 66 |ile "'Ru|nIFP'".f|
|00000f90| 69 0a 63 61 74 20 3c 3c | 20 5c 53 48 41 52 5f 45 |i.cat <<| \SHAR_E|
|00000fa0| 4f 46 20 3e 20 27 52 75 | 6e 49 46 50 27 0a 23 20 |OF > 'Ru|nIFP'.# |
|00000fb0| 53 68 65 6c 6c 20 73 63 | 72 69 70 74 20 66 6f 72 |Shell sc|ript for|
|00000fc0| 20 69 6e 76 6f 6b 69 6e | 67 20 49 46 50 20 69 6e | invokin|g IFP in|
|00000fd0| 74 65 72 70 72 65 74 65 | 72 2e 0a 0a 23 20 54 68 |terprete|r...# Th|
|00000fe0| 69 73 20 73 63 72 69 70 | 74 20 69 73 20 66 6f 72 |is scrip|t is for|
|00000ff0| 20 64 65 6d 6f 6e 73 74 | 72 61 74 69 6f 6e 20 61 | demonst|ration a|
|00001000| 6e 64 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |nd docum|entation|
|00001010| 20 70 75 72 70 6f 73 65 | 73 20 6f 6e 6c 79 2e 0a | purpose|s only..|
|00001020| 23 20 52 75 6e 6e 69 6e | 67 20 74 68 65 20 73 63 |# Runnin|g the sc|
|00001030| 72 69 70 74 20 77 69 6c | 6c 20 73 65 74 20 74 68 |ript wil|l set th|
|00001040| 65 20 61 70 70 72 6f 70 | 72 69 61 74 65 20 65 6e |e approp|riate en|
|00001050| 76 69 72 6f 6e 6d 65 6e | 74 20 76 61 72 69 61 62 |vironmen|t variab|
|00001060| 6c 65 73 0a 23 20 61 6e | 64 20 73 74 61 72 74 20 |les.# an|d start |
|00001070| 75 70 20 74 68 65 20 49 | 46 50 20 69 6e 74 65 72 |up the I|FP inter|
|00001080| 70 72 65 74 65 72 20 69 | 6e 20 74 68 65 20 64 65 |preter i|n the de|
|00001090| 6d 6f 6e 73 74 72 61 74 | 69 6f 6e 20 64 69 72 65 |monstrat|ion dire|
|000010a0| 63 74 6f 72 79 2e 0a 0a | 23 20 41 6c 6c 20 69 74 |ctory...|# All it|
|000010b0| 73 20 61 63 74 69 6f 6e | 73 20 73 68 6f 75 6c 64 |s action|s should|
|000010c0| 20 62 65 20 70 75 74 20 | 69 6e 20 74 68 65 20 75 | be put |in the u|
|000010d0| 73 65 72 27 73 20 2e 6c | 6f 67 69 6e 2c 20 61 6e |ser's .l|ogin, an|
|000010e0| 64 20 2e 63 73 68 72 63 | 20 66 69 6c 65 73 2e 0a |d .cshrc| files..|
|000010f0| 23 20 54 68 65 20 49 46 | 50 20 69 6e 74 65 72 70 |# The IF|P interp|
|00001100| 72 65 74 65 72 20 6d 75 | 73 74 20 62 65 20 63 6f |reter mu|st be co|
|00001110| 6d 70 69 6c 65 64 20 62 | 65 66 6f 72 65 20 72 75 |mpiled b|efore ru|
|00001120| 6e 6e 69 6e 67 20 74 68 | 69 73 20 73 63 72 69 70 |nning th|is scrip|
|00001130| 74 2e 0a 23 20 53 65 65 | 20 74 68 65 20 4d 61 6b |t..# See| the Mak|
|00001140| 65 66 69 6c 65 20 69 6e | 20 73 75 62 64 69 72 65 |efile in| subdire|
|00001150| 63 74 6f 72 79 20 22 69 | 6e 74 65 72 70 22 20 66 |ctory "i|nterp" f|
|00001160| 6f 72 20 69 6e 73 74 72 | 75 63 74 69 6f 6e 73 20 |or instr|uctions |
|00001170| 6f 6e 20 68 6f 77 0a 23 | 20 74 6f 20 63 6f 6d 70 |on how.#| to comp|
|00001180| 69 6c 65 20 74 68 65 20 | 69 6e 74 65 72 70 72 65 |ile the |interpre|
|00001190| 74 65 72 2e 0a 0a 23 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ter...#-|--------|
|000011a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000011b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000011c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000011d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0a 0a |--------|------..|
|000011e0| 23 20 54 68 65 73 65 20 | 74 77 6f 20 6c 69 6e 65 |# These |two line|
|000011f0| 73 20 73 68 6f 75 6c 64 | 20 67 6f 20 69 6e 20 65 |s should| go in e|
|00001200| 61 63 68 20 75 73 65 72 | 27 73 20 2e 6c 6f 67 69 |ach user|'s .logi|
|00001210| 6e 20 66 69 6c 65 20 61 | 6e 64 20 62 65 20 63 75 |n file a|nd be cu|
|00001220| 73 74 6f 6d 69 7a 65 64 | 0a 23 20 66 6f 72 20 74 |stomized|.# for t|
|00001230| 68 65 20 75 73 65 72 27 | 73 20 70 61 72 74 69 63 |he user'|s partic|
|00001240| 75 6c 61 72 20 49 46 50 | 20 72 6f 6f 74 20 64 69 |ular IFP| root di|
|00001250| 72 65 63 74 6f 72 79 20 | 61 6e 64 20 65 64 69 74 |rectory |and edit|
|00001260| 6f 72 2e 20 0a 0a 09 73 | 65 74 65 6e 76 20 49 46 |or. ...s|etenv IF|
|00001270| 50 72 6f 6f 74 20 24 63 | 77 64 2f 66 70 72 6f 6f |Proot $c|wd/fproo|
|00001280| 74 0a 09 73 65 74 65 6e | 76 20 45 44 49 54 4f 52 |t..seten|v EDITOR|
|00001290| 20 22 2f 75 73 72 2f 75 | 63 62 2f 76 69 22 0a 0a | "/usr/u|cb/vi"..|
|000012a0| 23 20 54 68 69 73 20 61 | 6c 69 61 73 20 69 73 20 |# This a|lias is |
|000012b0| 66 6f 72 20 63 6f 6e 76 | 65 6e 69 65 6e 63 65 2e |for conv|enience.|
|000012c0| 20 20 50 72 65 73 75 6d | 61 62 6c 79 20 74 68 65 | Presum|ably the|
|000012d0| 20 69 6e 74 65 72 70 72 | 65 74 65 72 20 77 69 6c | interpr|eter wil|
|000012e0| 6c 20 6e 6f 72 6d 61 6c | 6c 79 0a 23 20 72 65 73 |l normal|ly.# res|
|000012f0| 69 64 65 20 6f 6e 20 74 | 68 65 20 75 73 65 72 27 |ide on t|he user'|
|00001300| 73 20 73 65 61 72 63 68 | 20 70 61 74 68 2e 0a 0a |s search| path...|
|00001310| 09 61 6c 69 61 73 20 69 | 66 70 20 24 63 77 64 2f |.alias i|fp $cwd/|
|00001320| 69 6e 74 65 72 70 2f 69 | 66 70 0a 0a 23 20 4e 6f |interp/i|fp..# No|
|00001330| 72 6d 61 6c 6c 79 20 74 | 68 65 20 75 73 65 72 20 |rmally t|he user |
|00001340| 77 6f 75 6c 64 20 74 79 | 70 65 20 69 6e 20 74 68 |would ty|pe in th|
|00001350| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 74 77 6f 20 |e follow|ing two |
|00001360| 6c 69 6e 65 73 3a 0a 0a | 09 63 64 20 66 70 72 6f |lines:..|.cd fpro|
|00001370| 6f 74 2f 64 65 6d 6f 0a | 09 69 66 70 0a 0a 23 20 |ot/demo.|.ifp..# |
|00001380| 54 68 65 20 69 6e 74 65 | 72 70 72 65 74 65 72 20 |The inte|rpreter |
|00001390| 77 69 6c 6c 20 72 65 73 | 70 6f 6e 64 20 77 69 74 |will res|pond wit|
|000013a0| 68 20 74 68 65 20 70 72 | 6f 6d 70 74 20 22 69 66 |h the pr|ompt "if|
|000013b0| 70 3e 22 20 77 68 65 6e | 20 72 65 61 64 79 20 66 |p>" when| ready f|
|000013c0| 6f 72 20 0a 23 20 75 73 | 65 72 20 69 6e 70 75 74 |or .# us|er input|
|000013d0| 2e 0a 0a 53 48 41 52 5f | 45 4f 46 0a 63 68 6d 6f |...SHAR_|EOF.chmo|
|000013e0| 64 20 2b 78 20 27 52 75 | 6e 49 46 50 27 0a 69 66 |d +x 'Ru|nIFP'.if|
|000013f0| 20 74 65 73 74 20 21 20 | 2d 64 20 27 66 70 72 6f | test ! |-d 'fpro|
|00001400| 6f 74 27 0a 74 68 65 6e | 0a 09 6d 6b 64 69 72 20 |ot'.then|..mkdir |
|00001410| 27 66 70 72 6f 6f 74 27 | 0a 66 69 0a 63 64 20 27 |'fproot'|.fi.cd '|
|00001420| 66 70 72 6f 6f 74 27 0a | 69 66 20 74 65 73 74 20 |fproot'.|if test |
|00001430| 21 20 2d 64 20 27 64 65 | 6d 6f 27 0a 74 68 65 6e |! -d 'de|mo'.then|
|00001440| 0a 09 6d 6b 64 69 72 20 | 27 64 65 6d 6f 27 0a 66 |..mkdir |'demo'.f|
|00001450| 69 0a 63 64 20 27 64 65 | 6d 6f 27 0a 69 66 20 74 |i.cd 'de|mo'.if t|
|00001460| 65 73 74 20 2d 66 20 27 | 25 49 4d 50 4f 52 54 27 |est -f '|%IMPORT'|
|00001470| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00001480| 3a 20 6f 76 65 72 2d 77 | 72 69 74 69 6e 67 20 65 |: over-w|riting e|
|00001490| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 22 27 25 |xisting |file "'%|
|000014a0| 49 4d 50 4f 52 54 27 22 | 0a 66 69 0a 63 61 74 20 |IMPORT'"|.fi.cat |
|000014b0| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|000014c0| 25 49 4d 50 4f 52 54 27 | 0a 46 52 4f 4d 20 2f 73 |%IMPORT'|.FROM /s|
|000014d0| 79 73 20 49 4d 50 4f 52 | 54 0a 20 20 20 61 70 6e |ys IMPOR|T. apn|
|000014e0| 64 6c 2c 61 70 6e 64 72 | 2c 61 70 70 6c 79 2c 61 |dl,apndr|,apply,a|
|000014f0| 73 73 6f 63 2c 63 61 74 | 2c 64 69 73 74 6c 2c 64 |ssoc,cat|,distl,d|
|00001500| 69 73 74 72 2c 64 72 6f | 70 6c 2c 64 72 6f 70 72 |istr,dro|pl,dropr|
|00001510| 2c 65 78 70 6c 6f 64 65 | 2c 69 64 2c 69 6d 70 6c |,explode|,id,impl|
|00001520| 6f 64 65 2c 0a 20 20 20 | 69 6f 74 61 2c 6c 65 6e |ode,. |iota,len|
|00001530| 67 74 68 2c 70 61 74 6f | 6d 2c 70 69 63 6b 2c 72 |gth,pato|m,pick,r|
|00001540| 65 70 65 61 74 2c 72 65 | 76 65 72 73 65 2c 74 61 |epeat,re|verse,ta|
|00001550| 6b 65 6c 2c 74 61 6b 65 | 72 2c 74 6c 2c 74 6c 72 |kel,take|r,tl,tlr|
|00001560| 2c 74 72 61 6e 73 3b 0a | 0a 46 52 4f 4d 20 2f 6d |,trans;.|.FROM /m|
|00001570| 61 74 68 2f 61 72 69 74 | 68 20 49 4d 50 4f 52 54 |ath/arit|h IMPORT|
|00001580| 0a 20 20 20 2b 2c 2d 2c | 2a 2c 25 2c 61 64 64 31 |. +,-,|*,%,add1|
|00001590| 2c 61 72 63 63 6f 73 2c | 61 72 63 73 69 6e 2c 61 |,arccos,|arcsin,a|
|000015a0| 72 63 74 61 6e 2c 63 6f | 73 2c 64 69 76 2c 65 78 |rctan,co|s,div,ex|
|000015b0| 70 2c 6c 6e 2c 0a 20 20 | 20 6d 61 78 2c 6d 69 6e |p,ln,. | max,min|
|000015c0| 2c 6d 6f 64 2c 6d 69 6e | 75 73 2c 70 6f 77 65 72 |,mod,min|us,power|
|000015d0| 2c 70 72 6f 64 2c 73 69 | 6e 2c 73 71 72 74 2c 73 |,prod,si|n,sqrt,s|
|000015e0| 75 62 31 2c 73 75 6d 2c | 74 61 6e 3b 0a 0a 46 52 |ub1,sum,|tan;..FR|
|000015f0| 4f 4d 20 2f 6d 61 74 68 | 2f 6c 6f 67 69 63 20 49 |OM /math|/logic I|
|00001600| 4d 50 4f 52 54 0a 20 20 | 20 3c 2c 3c 3d 2c 3d 2c |MPORT. | <,<=,=,|
|00001610| 7e 3d 2c 3e 3d 2c 3e 2c | 7e 2c 61 6e 64 2c 61 6c |~=,>=,>,|~,and,al|
|00001620| 6c 2c 61 6e 79 2c 61 74 | 6f 6d 2c 62 6f 6f 6c 65 |l,any,at|om,boole|
|00001630| 61 6e 2c 66 61 6c 73 65 | 2c 6c 6f 6e 67 65 72 2c |an,false|,longer,|
|00001640| 6d 65 6d 62 65 72 2c 6e | 75 6c 6c 2c 0a 20 20 20 |member,n|ull,. |
|00001650| 6e 75 6d 65 72 69 63 2c | 6f 64 64 2c 6f 72 2c 70 |numeric,|odd,or,p|
|00001660| 61 69 72 2c 73 68 6f 72 | 74 65 72 2c 78 6f 72 3b |air,shor|ter,xor;|
|00001670| 20 0a 0a 53 48 41 52 5f | 45 4f 46 0a 69 66 20 74 | ..SHAR_|EOF.if t|
|00001680| 65 73 74 20 2d 66 20 27 | 41 27 0a 74 68 65 6e 0a |est -f '|A'.then.|
|00001690| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 6f 76 65 72 |.echo sh|ar: over|
|000016a0| 2d 77 72 69 74 69 6e 67 | 20 65 78 69 73 74 69 6e |-writing| existin|
|000016b0| 67 20 66 69 6c 65 20 22 | 27 41 27 22 0a 66 69 0a |g file "|'A'".fi.|
|000016c0| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|000016d0| 20 3e 20 27 41 27 0a 44 | 45 46 20 41 20 41 53 0a | > 'A'.D|EF A AS.|
|000016e0| 20 20 23 3c 3c 31 20 32 | 20 33 3e 0a 20 20 20 20 | #<<1 2| 3>. |
|000016f0| 3c 34 20 35 20 36 3e 0a | 20 20 20 20 3c 37 20 38 |<4 5 6>.| <7 8|
|00001700| 20 39 3e 3e 3b 0a 53 48 | 41 52 5f 45 4f 46 0a 69 | 9>>;.SH|AR_EOF.i|
|00001710| 66 20 74 65 73 74 20 2d | 66 20 27 41 62 73 27 0a |f test -|f 'Abs'.|
|00001720| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00001730| 20 6f 76 65 72 2d 77 72 | 69 74 69 6e 67 20 65 78 | over-wr|iting ex|
|00001740| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 41 62 |isting f|ile "'Ab|
|00001750| 73 27 22 0a 66 69 0a 63 | 61 74 20 3c 3c 20 5c 53 |s'".fi.c|at << \S|
|00001760| 48 41 52 5f 45 4f 46 20 | 3e 20 27 41 62 73 27 0a |HAR_EOF |> 'Abs'.|
|00001770| 28 2a 20 41 62 73 6f 6c | 75 74 65 20 76 61 6c 75 |(* Absol|ute valu|
|00001780| 65 20 66 75 6e 63 74 69 | 6f 6e 20 2a 29 0a 0a 44 |e functi|on *)..D|
|00001790| 45 46 20 41 62 73 20 41 | 53 0a 20 20 20 49 46 20 |EF Abs A|S. IF |
|000017a0| 5b 69 64 2c 23 30 5d 20 | 7c 20 3c 20 54 48 45 4e |[id,#0] || < THEN|
|000017b0| 20 6d 69 6e 75 73 0a 20 | 20 20 45 4c 53 45 20 69 | minus. | ELSE i|
|000017c0| 64 0a 20 20 20 45 4e 44 | 3b 0a 53 48 41 52 5f 45 |d. END|;.SHAR_E|
|000017d0| 4f 46 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 42 |OF.if te|st -f 'B|
|000017e0| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|000017f0| 72 3a 20 6f 76 65 72 2d | 77 72 69 74 69 6e 67 20 |r: over-|writing |
|00001800| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|00001810| 42 27 22 0a 66 69 0a 63 | 61 74 20 3c 3c 20 5c 53 |B'".fi.c|at << \S|
|00001820| 48 41 52 5f 45 4f 46 20 | 3e 20 27 42 27 0a 28 2a |HAR_EOF |> 'B'.(*|
|00001830| 0a 20 2a 20 41 20 64 61 | 74 61 20 6d 61 74 72 69 |. * A da|ta matri|
|00001840| 78 2e 0a 20 2a 29 0a 44 | 45 46 20 42 20 41 53 0a |x.. *).D|EF B AS.|
|00001850| 20 20 20 23 3c 35 20 33 | 20 38 38 20 20 36 20 32 | #<5 3| 88 6 2|
|00001860| 31 20 20 30 20 20 30 20 | 2d 37 20 0a 20 20 20 20 |1 0 0 |-7 . |
|00001870| 20 35 20 32 20 20 31 20 | 20 34 20 20 38 20 31 30 | 5 2 1 | 4 8 10|
|00001880| 20 20 31 20 20 34 0a 20 | 20 20 20 20 32 20 34 20 | 1 4. | 2 4 |
|00001890| 20 33 20 20 37 20 20 39 | 20 20 35 20 20 32 20 20 | 3 7 9| 5 2 |
|000018a0| 35 0a 20 20 20 20 20 31 | 20 33 20 20 33 20 20 35 |5. 1| 3 3 5|
|000018b0| 20 20 37 20 20 32 20 20 | 33 20 20 36 0a 20 20 20 | 7 2 |3 6. |
|000018c0| 20 20 34 20 37 20 20 35 | 20 20 33 20 20 31 20 20 | 4 7 5| 3 1 |
|000018d0| 38 20 20 34 20 20 37 0a | 20 20 20 20 20 38 20 39 |8 4 7.| 8 9|
|000018e0| 20 20 37 20 20 31 20 20 | 36 20 31 32 20 20 35 20 | 7 1 |6 12 5 |
|000018f0| 20 38 0a 20 20 20 20 31 | 30 20 35 20 20 32 20 20 | 8. 1|0 5 2 |
|00001900| 38 20 31 32 20 20 31 20 | 20 36 20 20 39 0a 20 20 |8 12 1 | 6 9. |
|00001910| 20 20 20 31 20 32 20 20 | 33 20 20 34 20 20 35 20 | 1 2 |3 4 5 |
|00001920| 20 36 20 20 31 20 20 32 | 0a 20 20 20 20 20 34 20 | 6 1 2|. 4 |
|00001930| 35 20 20 36 20 20 37 20 | 20 38 20 20 39 20 20 32 |5 6 7 | 8 9 2|
|00001940| 20 20 31 3e 3b 0a 0a 53 | 48 41 52 5f 45 4f 46 0a | 1>;..S|HAR_EOF.|
|00001950| 69 66 20 74 65 73 74 20 | 2d 66 20 27 43 61 72 74 |if test |-f 'Cart|
|00001960| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|00001970| 72 3a 20 6f 76 65 72 2d | 77 72 69 74 69 6e 67 20 |r: over-|writing |
|00001980| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|00001990| 43 61 72 74 27 22 0a 66 | 69 0a 63 61 74 20 3c 3c |Cart'".f|i.cat <<|
|000019a0| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 43 61 | \SHAR_E|OF > 'Ca|
|000019b0| 72 74 27 0a 28 2a 20 0a | 20 2a 20 43 61 72 74 65 |rt'.(* .| * Carte|
|000019c0| 73 69 61 6e 20 70 72 6f | 64 75 63 74 20 6f 66 20 |sian pro|duct of |
|000019d0| 74 77 6f 20 73 65 71 75 | 65 6e 63 65 73 0a 20 2a |two sequ|ences. *|
|000019e0| 29 0a 44 45 46 20 43 61 | 72 74 20 41 53 20 0a 20 |).DEF Ca|rt AS . |
|000019f0| 20 20 64 69 73 74 72 20 | 7c 20 45 41 43 48 20 64 | distr || EACH d|
|00001a00| 69 73 74 6c 20 45 4e 44 | 3b 0a 0a 53 48 41 52 5f |istl END|;..SHAR_|
|00001a10| 45 4f 46 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |EOF.if t|est -f '|
|00001a20| 43 6f 73 53 69 6e 27 0a | 74 68 65 6e 0a 09 65 63 |CosSin'.|then..ec|
|00001a30| 68 6f 20 73 68 61 72 3a | 20 6f 76 65 72 2d 77 72 |ho shar:| over-wr|
|00001a40| 69 74 69 6e 67 20 65 78 | 69 73 74 69 6e 67 20 66 |iting ex|isting f|
|00001a50| 69 6c 65 20 22 27 43 6f | 73 53 69 6e 27 22 0a 66 |ile "'Co|sSin'".f|
|00001a60| 69 0a 63 61 74 20 3c 3c | 20 5c 53 48 41 52 5f 45 |i.cat <<| \SHAR_E|
|00001a70| 4f 46 20 3e 20 27 43 6f | 73 53 69 6e 27 0a 28 2a |OF > 'Co|sSin'.(*|
|00001a80| 0a 20 2a 20 43 6f 73 53 | 69 6e 0a 20 2a 0a 20 2a |. * CosS|in. *. *|
|00001a90| 20 43 6f 6d 70 75 74 65 | 20 74 68 65 20 73 69 6e | Compute| the sin|
|00001aa0| 65 20 61 6e 64 20 63 6f | 73 69 6e 65 20 6f 66 20 |e and co|sine of |
|00001ab0| 61 6e 20 61 6e 67 6c 65 | 20 76 69 61 20 68 61 6c |an angle| via hal|
|00001ac0| 66 2d 61 6e 67 6c 65 20 | 66 6f 72 6d 75 6c 61 65 |f-angle |formulae|
|00001ad0| 2e 0a 20 2a 20 54 68 65 | 20 66 75 6e 63 74 69 6f |.. * The| functio|
|00001ae0| 6e 20 69 73 20 61 63 63 | 75 72 61 74 65 20 74 6f |n is acc|urate to|
|00001af0| 20 31 32 20 64 65 63 69 | 6d 61 6c 73 2e 0a 20 2a | 12 deci|mals.. *|
|00001b00| 29 0a 44 45 46 20 43 6f | 73 53 69 6e 20 41 53 0a |).DEF Co|sSin AS.|
|00001b10| 20 20 20 49 46 20 5b 69 | 64 7c 41 62 73 2c 23 31 | IF [i|d|Abs,#1|
|00001b20| 65 2d 36 5d 7c 3c 20 54 | 48 45 4e 20 5b 5b 23 31 |e-6]|< T|HEN [[#1|
|00001b30| 2c 5b 53 71 75 61 72 65 | 2c 23 32 5d 7c 25 5d 7c |,[Square|,#2]|%]||
|00001b40| 2d 2c 69 64 5d 0a 20 20 | 20 45 4c 53 45 0a 20 20 |-,id]. | ELSE. |
|00001b50| 20 20 20 20 5b 69 64 2c | 23 32 5d 7c 25 20 7c 20 | [id,|#2]|% | |
|00001b60| 43 6f 73 53 69 6e 20 7c | 20 0a 20 20 20 20 20 20 |CosSin || . |
|00001b70| 5b 5b 2b 2c 2d 5d 7c 2a | 2c 20 5b 2a 2c 2a 5d 7c |[[+,-]|*|, [*,*]||
|00001b80| 2b 5d 20 0a 20 20 20 45 | 4e 44 3b 0a 0a 53 48 41 |+] . E|ND;..SHA|
|00001b90| 52 5f 45 4f 46 0a 69 66 | 20 74 65 73 74 20 2d 66 |R_EOF.if| test -f|
|00001ba0| 20 27 44 61 74 61 27 0a | 74 68 65 6e 0a 09 65 63 | 'Data'.|then..ec|
|00001bb0| 68 6f 20 73 68 61 72 3a | 20 6f 76 65 72 2d 77 72 |ho shar:| over-wr|
|00001bc0| 69 74 69 6e 67 20 65 78 | 69 73 74 69 6e 67 20 66 |iting ex|isting f|
|00001bd0| 69 6c 65 20 22 27 44 61 | 74 61 27 22 0a 66 69 0a |ile "'Da|ta'".fi.|
|00001be0| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|00001bf0| 20 3e 20 27 44 61 74 61 | 27 0a 28 2a 0a 20 2a 20 | > 'Data|'.(*. * |
|00001c00| 43 75 72 72 65 6e 74 6c | 79 20 49 2f 4f 20 69 73 |Currentl|y I/O is|
|00001c10| 20 61 6c 6d 6f 73 74 20 | 6e 6f 6e 2d 65 78 69 73 | almost |non-exis|
|00001c20| 74 65 6e 74 20 69 6e 20 | 49 46 50 2e 20 20 4f 6e |tent in |IFP. On|
|00001c30| 65 20 77 61 79 20 74 6f | 20 73 6b 69 72 74 20 74 |e way to| skirt t|
|00001c40| 68 69 73 20 70 72 6f 62 | 6c 65 6d 0a 20 2a 20 77 |his prob|lem. * w|
|00001c50| 68 65 6e 20 79 6f 75 20 | 68 61 76 65 20 61 20 6c |hen you |have a l|
|00001c60| 61 72 67 65 20 61 6d 6f | 75 6e 74 20 6f 66 20 64 |arge amo|unt of d|
|00001c70| 61 74 61 20 74 6f 20 69 | 6e 70 75 74 20 69 73 20 |ata to i|nput is |
|00001c80| 74 6f 20 64 65 66 69 6e | 65 20 61 20 63 6f 6e 73 |to defin|e a cons|
|00001c90| 74 61 6e 74 20 0a 20 2a | 20 66 75 6e 63 74 69 6f |tant . *| functio|
|00001ca0| 6e 20 77 69 74 68 20 74 | 68 65 20 61 70 70 72 6f |n with t|he appro|
|00001cb0| 70 72 69 61 74 65 20 76 | 61 6c 75 65 73 2e 0a 20 |priate v|alues.. |
|00001cc0| 2a 0a 20 2a 20 54 68 65 | 20 66 75 6e 63 74 69 6f |*. * The| functio|
|00001cd0| 6e 20 44 61 74 61 20 72 | 65 74 75 72 6e 73 20 61 |n Data r|eturns a|
|00001ce0| 20 73 65 71 75 65 6e 63 | 65 20 6f 66 20 64 61 74 | sequenc|e of dat|
|00001cf0| 61 20 76 61 6c 75 65 73 | 2e 20 20 57 65 20 63 6f |a values|. We co|
|00001d00| 75 6c 64 2c 20 66 6f 72 | 20 0a 20 2a 20 69 6e 73 |uld, for| . * ins|
|00001d10| 74 61 6e 63 65 2c 20 73 | 6f 72 74 20 74 68 65 6d |tance, s|ort them|
|00001d20| 20 62 79 20 63 6f 6d 70 | 6f 73 69 6e 67 20 44 61 | by comp|osing Da|
|00001d30| 74 61 20 77 69 74 68 20 | 51 75 69 63 6b 53 6f 72 |ta with |QuickSor|
|00001d40| 74 0a 20 2a 0a 20 2a 20 | 45 78 61 6d 70 6c 65 73 |t. *. * |Examples|
|00001d50| 3a 0a 20 2a 20 20 20 20 | 20 20 30 20 3a 20 44 61 |:. * | 0 : Da|
|00001d60| 74 61 20 2d 3e 20 3c 35 | 20 33 20 38 38 20 36 20 |ta -> <5| 3 88 6 |
|00001d70| 32 31 20 30 20 2d 37 3e | 0a 20 2a 20 20 20 20 20 |21 0 -7>|. * |
|00001d80| 20 30 20 3a 20 44 61 74 | 61 20 7c 20 51 75 69 63 | 0 : Dat|a | Quic|
|00001d90| 6b 53 6f 72 74 20 2d 3e | 20 3c 2d 37 20 30 20 33 |kSort ->| <-7 0 3|
|00001da0| 20 35 20 36 20 32 31 20 | 38 38 3e 0a 20 2a 29 0a | 5 6 21 |88>. *).|
|00001db0| 0a 44 45 46 20 44 61 74 | 61 20 41 53 0a 20 20 20 |.DEF Dat|a AS. |
|00001dc0| 23 3c 35 20 33 20 38 38 | 20 36 20 32 31 20 30 20 |#<5 3 88| 6 21 0 |
|00001dd0| 2d 37 3e 3b 0a 20 0a 53 | 48 41 52 5f 45 4f 46 0a |-7>;. .S|HAR_EOF.|
|00001de0| 69 66 20 74 65 73 74 20 | 2d 66 20 27 44 65 62 75 |if test |-f 'Debu|
|00001df0| 67 27 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |g'.then.|.echo sh|
|00001e00| 61 72 3a 20 6f 76 65 72 | 2d 77 72 69 74 69 6e 67 |ar: over|-writing|
|00001e10| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|00001e20| 27 44 65 62 75 67 27 22 | 0a 66 69 0a 63 61 74 20 |'Debug'"|.fi.cat |
|00001e30| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|00001e40| 44 65 62 75 67 27 0a 28 | 2a 0a 20 2a 20 56 65 72 |Debug'.(|*. * Ver|
|00001e50| 73 69 6f 6e 20 6f 66 20 | 46 69 62 20 77 69 74 68 |sion of |Fib with|
|00001e60| 20 64 65 62 75 67 67 69 | 6e 67 20 6f 75 74 70 75 | debuggi|ng outpu|
|00001e70| 74 0a 20 2a 0a 20 2a 20 | 6e 20 3a 20 44 65 62 75 |t. *. * |n : Debu|
|00001e80| 67 20 2d 3e 20 73 65 71 | 75 65 6e 63 65 20 6f 66 |g -> seq|uence of|
|00001e90| 20 66 69 72 73 74 20 6e | 20 46 69 62 6f 6e 61 63 | first n| Fibonac|
|00001ea0| 63 69 20 6e 75 6d 62 65 | 72 73 0a 20 2a 0a 20 2a |ci numbe|rs. *. *|
|00001eb0| 20 54 68 65 20 74 77 6f | 20 66 75 6e 63 74 69 6f | The two| functio|
|00001ec0| 6e 73 20 63 72 65 61 74 | 65 64 20 77 69 74 68 20 |ns creat|ed with |
|00001ed0| 74 68 65 20 22 40 22 20 | 66 6f 72 6d 20 70 72 69 |the "@" |form pri|
|00001ee0| 6e 74 20 74 68 65 69 72 | 20 69 6e 70 75 74 73 0a |nt their| inputs.|
|00001ef0| 20 2a 20 73 6f 20 77 65 | 20 63 61 6e 20 73 65 65 | * so we| can see|
|00001f00| 20 77 68 61 74 20 69 73 | 20 67 6f 69 6e 67 20 6f | what is| going o|
|00001f10| 6e 20 69 6e 73 69 64 65 | 20 74 68 65 20 44 65 62 |n inside| the Deb|
|00001f20| 75 67 20 66 75 6e 63 74 | 69 6f 6e 2e 0a 20 2a 29 |ug funct|ion.. *)|
|00001f30| 0a 0a 44 45 46 20 44 65 | 62 75 67 20 41 53 0a 0a |..DEF De|bug AS..|
|00001f40| 20 20 20 49 46 20 5b 69 | 64 2c 23 32 5d 20 7c 20 | IF [i|d,#2] | |
|00001f50| 3c 3d 20 54 48 45 4e 0a | 0a 20 20 20 20 20 20 40 |<= THEN.|. @|
|00001f60| 22 74 72 69 76 69 61 6c | 20 63 61 73 65 22 20 7c |"trivial| case" ||
|00001f70| 20 5b 23 3c 31 20 31 3e | 2c 69 64 5d 20 7c 20 74 | [#<1 1>|,id] | t|
|00001f80| 61 6b 65 6c 0a 0a 20 20 | 20 45 4c 53 45 0a 0a 20 |akel.. | ELSE.. |
|00001f90| 20 20 20 20 20 40 22 72 | 65 63 75 72 73 65 22 20 | @"r|ecurse" |
|00001fa0| 7c 20 73 75 62 31 20 7c | 20 44 65 62 75 67 20 7c || sub1 || Debug ||
|00001fb0| 20 5b 69 64 2c 20 5b 31 | 72 2c 32 72 5d 7c 2b 5d | [id, [1|r,2r]|+]|
|00001fc0| 20 7c 20 61 70 6e 64 72 | 0a 0a 20 20 20 45 4e 44 | | apndr|.. END|
|00001fd0| 3b 0a 0a 53 48 41 52 5f | 45 4f 46 0a 69 66 20 74 |;..SHAR_|EOF.if t|
|00001fe0| 65 73 74 20 2d 66 20 27 | 44 6f 75 62 6c 65 27 0a |est -f '|Double'.|
|00001ff0| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00002000| 20 6f 76 65 72 2d 77 72 | 69 74 69 6e 67 20 65 78 | over-wr|iting ex|
|00002010| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 44 6f |isting f|ile "'Do|
|00002020| 75 62 6c 65 27 22 0a 66 | 69 0a 63 61 74 20 3c 3c |uble'".f|i.cat <<|
|00002030| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 44 6f | \SHAR_E|OF > 'Do|
|00002040| 75 62 6c 65 27 0a 28 2a | 20 44 6f 75 62 6c 65 20 |uble'.(*| Double |
|00002050| 61 20 6e 75 6d 62 65 72 | 20 2d 20 65 2e 67 2e 20 |a number| - e.g. |
|00002060| 33 3a 44 6f 75 62 6c 65 | 20 2d 3e 20 36 20 2a 29 |3:Double| -> 6 *)|
|00002070| 0a 0a 44 45 46 20 44 6f | 75 62 6c 65 20 41 53 20 |..DEF Do|uble AS |
|00002080| 5b 69 64 2c 69 64 5d 7c | 2b 3b 0a 0a 53 48 41 52 |[id,id]||+;..SHAR|
|00002090| 5f 45 4f 46 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |_EOF.if |test -f |
|000020a0| 27 46 69 62 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |'Fib'.th|en..echo|
|000020b0| 20 73 68 61 72 3a 20 6f | 76 65 72 2d 77 72 69 74 | shar: o|ver-writ|
|000020c0| 69 6e 67 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ing exis|ting fil|
|000020d0| 65 20 22 27 46 69 62 27 | 22 0a 66 69 0a 63 61 74 |e "'Fib'|".fi.cat|
|000020e0| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|000020f0| 27 46 69 62 27 0a 28 2a | 0a 20 2a 20 43 6f 6d 70 |'Fib'.(*|. * Comp|
|00002100| 75 74 65 20 6e 74 68 20 | 66 69 62 6f 6e 61 63 63 |ute nth |fibonacc|
|00002110| 69 20 6e 75 6d 62 65 72 | 0a 20 2a 0a 20 2a 20 45 |i number|. *. * E|
|00002120| 78 61 6d 70 6c 65 73 3a | 0a 20 2a 0a 20 2a 09 36 |xamples:|. *. *.6|
|00002130| 20 3a 20 46 69 62 20 2d | 3e 20 38 0a 20 2a 09 37 | : Fib -|> 8. *.7|
|00002140| 20 3a 20 46 69 62 20 2d | 3e 20 31 33 0a 20 2a 09 | : Fib -|> 13. *.|
|00002150| 38 20 3a 20 46 69 62 20 | 2d 3e 20 32 31 0a 20 2a |8 : Fib |-> 21. *|
|00002160| 29 0a 0a 44 45 46 20 46 | 69 62 20 41 53 20 0a 20 |)..DEF F|ib AS . |
|00002170| 20 20 49 46 20 5b 69 64 | 2c 23 32 5d 20 7c 20 3c | IF [id|,#2] | <|
|00002180| 20 54 48 45 4e 20 69 64 | 0a 20 20 20 45 4c 53 45 | THEN id|. ELSE|
|00002190| 0a 20 20 20 20 20 20 73 | 75 62 31 20 7c 20 5b 46 |. s|ub1 | [F|
|000021a0| 69 62 2c 73 75 62 31 7c | 46 69 62 5d 20 7c 20 2b |ib,sub1||Fib] | +|
|000021b0| 0a 20 20 20 45 4e 44 3b | 0a 53 48 41 52 5f 45 4f |. END;|.SHAR_EO|
|000021c0| 46 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 46 69 |F.if tes|t -f 'Fi|
|000021d0| 62 53 65 71 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |bSeq'.th|en..echo|
|000021e0| 20 73 68 61 72 3a 20 6f | 76 65 72 2d 77 72 69 74 | shar: o|ver-writ|
|000021f0| 69 6e 67 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ing exis|ting fil|
|00002200| 65 20 22 27 46 69 62 53 | 65 71 27 22 0a 66 69 0a |e "'FibS|eq'".fi.|
|00002210| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|00002220| 20 3e 20 27 46 69 62 53 | 65 71 27 0a 28 2a 0a 20 | > 'FibS|eq'.(*. |
|00002230| 2a 20 46 69 62 6f 6e 61 | 63 63 69 20 6e 75 6d 62 |* Fibona|cci numb|
|00002240| 65 72 73 0a 20 2a 20 0a | 20 2a 20 6e 20 3a 20 46 |ers. * .| * n : F|
|00002250| 69 62 53 65 71 20 2d 3e | 20 73 65 71 75 65 6e 63 |ibSeq ->| sequenc|
|00002260| 65 20 6f 66 20 66 69 72 | 73 74 20 6e 20 46 69 62 |e of fir|st n Fib|
|00002270| 6f 6e 61 63 63 69 20 6e | 75 6d 62 65 72 73 0a 20 |onacci n|umbers. |
|00002280| 2a 0a 20 2a 20 45 78 61 | 6d 70 6c 65 0a 20 2a 20 |*. * Exa|mple. * |
|00002290| 20 20 20 20 20 36 20 3a | 20 46 69 62 53 65 71 20 | 6 :| FibSeq |
|000022a0| 2d 3e 20 3c 31 20 31 20 | 32 20 33 20 35 20 38 3e |-> <1 1 |2 3 5 8>|
|000022b0| 0a 20 2a 29 0a 0a 44 45 | 46 20 46 69 62 53 65 71 |. *)..DE|F FibSeq|
|000022c0| 20 41 53 0a 20 20 20 49 | 46 20 5b 69 64 2c 23 32 | AS. I|F [id,#2|
|000022d0| 5d 20 7c 20 3c 3d 20 54 | 48 45 4e 0a 20 20 20 20 |] | <= T|HEN. |
|000022e0| 20 20 5b 23 3c 31 20 31 | 3e 2c 69 64 5d 20 7c 20 | [#<1 1|>,id] | |
|000022f0| 74 61 6b 65 6c 20 20 20 | 20 20 20 20 28 2a 20 74 |takel | (* t|
|00002300| 72 69 76 69 61 6c 20 63 | 61 73 65 20 2a 29 0a 20 |rivial c|ase *). |
|00002310| 20 20 45 4c 53 45 0a 20 | 20 20 20 20 20 73 75 62 | ELSE. | sub|
|00002320| 31 20 7c 20 46 69 62 53 | 65 71 20 7c 20 20 20 20 |1 | FibS|eq | |
|00002330| 20 20 20 20 20 20 20 28 | 2a 20 67 65 6e 65 72 61 | (|* genera|
|00002340| 74 65 20 6e 2d 31 20 46 | 69 62 6f 6e 61 63 63 69 |te n-1 F|ibonacci|
|00002350| 20 6e 75 6d 62 65 72 73 | 20 20 20 20 20 20 20 20 | numbers| |
|00002360| 2a 29 0a 20 20 20 20 20 | 20 5b 69 64 2c 20 5b 31 |*). | [id, [1|
|00002370| 72 2c 32 72 5d 7c 2b 5d | 20 7c 20 61 70 6e 64 72 |r,2r]|+]| | apndr|
|00002380| 20 20 20 28 2a 20 61 70 | 70 65 6e 64 20 73 75 6d | (* ap|pend sum|
|00002390| 20 6f 66 20 6c 61 73 74 | 20 74 77 6f 20 74 6f 20 | of last| two to |
|000023a0| 65 6e 64 20 6f 66 20 6c | 69 73 74 20 2a 29 0a 20 |end of l|ist *). |
|000023b0| 20 20 45 4e 44 3b 0a 0a | 53 48 41 52 5f 45 4f 46 | END;..|SHAR_EOF|
|000023c0| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 46 6f 72 |.if test| -f 'For|
|000023d0| 6d 61 74 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |mat'.the|n..echo |
|000023e0| 73 68 61 72 3a 20 6f 76 | 65 72 2d 77 72 69 74 69 |shar: ov|er-writi|
|000023f0| 6e 67 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |ng exist|ing file|
|00002400| 20 22 27 46 6f 72 6d 61 | 74 27 22 0a 66 69 0a 63 | "'Forma|t'".fi.c|
|00002410| 61 74 20 3c 3c 20 5c 53 | 48 41 52 5f 45 4f 46 20 |at << \S|HAR_EOF |
|00002420| 3e 20 27 46 6f 72 6d 61 | 74 27 0a 44 45 46 20 46 |> 'Forma|t'.DEF F|
|00002430| 6f 72 6d 61 74 20 41 53 | 0a 20 20 20 5b 69 64 2c |ormat AS|. [id,|
|00002440| 23 22 20 22 5d 20 7c 20 | 64 69 73 74 72 20 7c 20 |#" "] | |distr | |
|00002450| 63 61 74 20 7c 20 69 6d | 70 6c 6f 64 65 3b 0a 0a |cat | im|plode;..|
|00002460| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|00002470| 20 2d 66 20 27 48 61 6e | 6f 69 27 0a 74 68 65 6e | -f 'Han|oi'.then|
|00002480| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 6f 76 65 |..echo s|har: ove|
|00002490| 72 2d 77 72 69 74 69 6e | 67 20 65 78 69 73 74 69 |r-writin|g existi|
|000024a0| 6e 67 20 66 69 6c 65 20 | 22 27 48 61 6e 6f 69 27 |ng file |"'Hanoi'|
|000024b0| 22 0a 66 69 0a 63 61 74 | 20 3c 3c 20 5c 53 48 41 |".fi.cat| << \SHA|
|000024c0| 52 5f 45 4f 46 20 3e 20 | 27 48 61 6e 6f 69 27 0a |R_EOF > |'Hanoi'.|
|000024d0| 28 2a 0a 20 2a 20 48 61 | 6e 69 6f 20 2d 20 74 6f |(*. * Ha|nio - to|
|000024e0| 77 65 72 73 20 6f 66 20 | 48 61 6e 6f 69 20 73 6f |wers of |Hanoi so|
|000024f0| 6c 76 65 72 0a 20 2a 0a | 20 2a 20 3c 4e 20 4e 61 |lver. *.| * <N Na|
|00002500| 6d 65 73 3e 20 3a 20 48 | 61 6e 6f 69 20 2d 3e 20 |mes> : H|anoi -> |
|00002510| 3c 3c 73 72 63 20 64 73 | 74 3e 20 2e 2e 2e 3c 73 |<<src ds|t> ...<s|
|00002520| 72 63 20 64 73 74 3e 3e | 0a 20 2a 0a 20 2a 20 77 |rc dst>>|. *. * w|
|00002530| 68 65 72 65 20 4e 20 69 | 73 20 6e 75 6d 62 65 72 |here N i|s number|
|00002540| 20 6f 66 20 72 69 6e 67 | 73 20 61 6e 64 20 6e 61 | of ring|s and na|
|00002550| 6d 65 73 20 69 73 20 61 | 20 74 72 69 70 6c 65 20 |mes is a| triple |
|00002560| 6f 66 20 70 6f 73 74 20 | 6e 61 6d 65 73 0a 20 2a |of post |names. *|
|00002570| 20 3c 73 6f 75 72 63 65 | 20 74 65 6d 70 6f 72 61 | <source| tempora|
|00002580| 72 79 20 64 65 73 74 3e | 2e 0a 20 2a 0a 20 2a 20 |ry dest>|.. *. * |
|00002590| 45 78 61 6d 70 6c 65 3a | 0a 20 2a 09 3c 32 20 3c |Example:|. *.<2 <|
|000025a0| 61 20 62 20 63 3e 3e 20 | 3a 20 48 61 6e 6f 69 20 |a b c>> |: Hanoi |
|000025b0| 2d 3e 20 3c 3c 61 2c 62 | 3e 2c 3c 61 2c 63 3e 2c |-> <<a,b|>,<a,c>,|
|000025c0| 3c 62 2c 63 3e 3e 0a 20 | 2a 29 0a 0a 44 45 46 20 |<b,c>>. |*)..DEF |
|000025d0| 48 61 6e 6f 69 20 41 53 | 0a 20 20 20 7b 5b 6e 2c |Hanoi AS|. {[n,|
|000025e0| 5b 61 2c 62 2c 63 5d 5d | 20 3a 3d 20 69 64 7d 0a |[a,b,c]]| := id}.|
|000025f0| 20 20 20 49 46 20 5b 6e | 2c 23 30 5d 7c 3d 20 54 | IF [n|,#0]|= T|
|00002600| 48 45 4e 20 5b 5d 0a 20 | 20 20 45 4c 53 45 20 5b |HEN []. | ELSE [|
|00002610| 0a 20 20 20 20 20 20 5b | 6e 7c 73 75 62 31 2c 20 |. [|n|sub1, |
|00002620| 5b 61 2c 63 2c 62 5d 5d | 20 7c 20 48 61 6e 6f 69 |[a,c,b]]| | Hanoi|
|00002630| 2c 0a 20 20 20 20 20 20 | 5b 5b 61 2c 63 5d 5d 2c |,. |[[a,c]],|
|00002640| 0a 20 20 20 20 20 20 5b | 6e 7c 73 75 62 31 2c 20 |. [|n|sub1, |
|00002650| 5b 62 2c 61 2c 63 5d 5d | 20 7c 20 48 61 6e 6f 69 |[b,a,c]]| | Hanoi|
|00002660| 20 0a 20 20 20 5d 20 7c | 20 63 61 74 0a 20 20 20 | . ] || cat. |
|00002670| 45 4e 44 3b 0a 0a 53 48 | 41 52 5f 45 4f 46 0a 69 |END;..SH|AR_EOF.i|
|00002680| 66 20 74 65 73 74 20 2d | 66 20 27 49 6e 6e 65 72 |f test -|f 'Inner|
|00002690| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|000026a0| 72 3a 20 6f 76 65 72 2d | 77 72 69 74 69 6e 67 20 |r: over-|writing |
|000026b0| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|000026c0| 49 6e 6e 65 72 27 22 0a | 66 69 0a 63 61 74 20 3c |Inner'".|fi.cat <|
|000026d0| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 49 |< \SHAR_|EOF > 'I|
|000026e0| 6e 6e 65 72 27 0a 28 2a | 0a 20 2a 20 43 6f 6d 70 |nner'.(*|. * Comp|
|000026f0| 75 74 65 20 74 68 65 20 | 69 6e 6e 65 72 20 70 72 |ute the |inner pr|
|00002700| 6f 64 75 63 74 20 6f 66 | 20 74 77 6f 20 76 65 63 |oduct of| two vec|
|00002710| 74 6f 72 73 2e 0a 20 2a | 29 0a 44 45 46 20 49 6e |tors.. *|).DEF In|
|00002720| 6e 65 72 20 41 53 20 0a | 20 20 20 74 72 61 6e 73 |ner AS .| trans|
|00002730| 20 7c 20 45 41 43 48 20 | 2a 20 45 4e 44 20 7c 20 | | EACH |* END | |
|00002740| 49 4e 53 45 52 54 20 2b | 20 45 4e 44 3b 0a 53 48 |INSERT +| END;.SH|
|00002750| 41 52 5f 45 4f 46 0a 69 | 66 20 74 65 73 74 20 2d |AR_EOF.i|f test -|
|00002760| 66 20 27 49 6e 73 65 72 | 74 53 6f 72 74 27 0a 74 |f 'Inser|tSort'.t|
|00002770| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|00002780| 6f 76 65 72 2d 77 72 69 | 74 69 6e 67 20 65 78 69 |over-wri|ting exi|
|00002790| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 49 6e 73 |sting fi|le "'Ins|
|000027a0| 65 72 74 53 6f 72 74 27 | 22 0a 66 69 0a 63 61 74 |ertSort'|".fi.cat|
|000027b0| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|000027c0| 27 49 6e 73 65 72 74 53 | 6f 72 74 27 0a 28 2a 0a |'InsertS|ort'.(*.|
|000027d0| 20 2a 20 49 6e 73 65 72 | 74 53 6f 72 74 0a 20 2a | * Inser|tSort. *|
|000027e0| 0a 20 2a 20 54 68 69 73 | 20 66 75 6e 63 74 69 6f |. * This| functio|
|000027f0| 6e 20 73 6f 72 74 73 20 | 61 20 73 65 71 75 65 6e |n sorts |a sequen|
|00002800| 63 65 20 6f 66 20 6e 75 | 6d 62 65 72 73 20 6f 72 |ce of nu|mbers or|
|00002810| 20 73 74 72 69 6e 67 73 | 20 69 6e 74 6f 20 61 73 | strings| into as|
|00002820| 63 65 6e 64 69 6e 67 20 | 6f 72 64 65 72 0a 20 2a |cending |order. *|
|00002830| 20 75 73 69 6e 67 20 69 | 6e 73 65 72 74 69 6f 6e | using i|nsertion|
|00002840| 20 73 6f 72 74 2e 0a 20 | 2a 0a 20 2a 20 45 78 61 | sort.. |*. * Exa|
|00002850| 6d 70 6c 65 73 3a 0a 20 | 2a 0a 20 2a 20 20 20 20 |mples:. |*. * |
|00002860| 20 20 3c 33 20 31 20 34 | 20 31 20 35 20 39 20 32 | <3 1 4| 1 5 9 2|
|00002870| 3e 20 3a 20 49 6e 73 65 | 72 74 53 6f 72 74 20 3d |> : Inse|rtSort =|
|00002880| 3d 20 3c 31 20 31 20 32 | 20 33 20 34 20 35 20 39 |= <1 1 2| 3 4 5 9|
|00002890| 3e 0a 20 2a 0a 20 2a 20 | 20 20 20 20 20 3c 61 6c |>. *. * | <al|
|000028a0| 6c 20 77 6f 72 6b 20 61 | 6e 64 20 6e 6f 20 70 6c |l work a|nd no pl|
|000028b0| 61 79 3e 20 3a 20 49 6e | 73 65 72 74 53 6f 72 74 |ay> : In|sertSort|
|000028c0| 20 3d 3d 20 3c 61 6c 6c | 20 61 6e 64 20 6e 6f 20 | == <all| and no |
|000028d0| 70 6c 61 79 20 77 6f 72 | 6b 3e 0a 20 2a 0a 20 2a |play wor|k>. *. *|
|000028e0| 20 54 68 65 20 73 65 71 | 75 65 6e 63 65 20 6d 61 | The seq|uence ma|
|000028f0| 79 20 6e 6f 74 20 6d 69 | 78 20 73 74 72 69 6e 67 |y not mi|x string|
|00002900| 73 20 61 6e 64 20 6e 75 | 6d 62 65 72 73 2e 0a 20 |s and nu|mbers.. |
|00002910| 2a 29 0a 44 45 46 20 49 | 6e 73 65 72 74 53 6f 72 |*).DEF I|nsertSor|
|00002920| 74 20 41 53 0a 20 20 20 | 49 46 20 6e 75 6c 6c 20 |t AS. |IF null |
|00002930| 54 48 45 4e 20 69 64 09 | 09 09 28 2a 20 43 68 65 |THEN id.|..(* Che|
|00002940| 63 6b 20 66 6f 72 20 74 | 72 69 76 69 61 6c 20 63 |ck for t|rivial c|
|00002950| 61 73 65 20 2a 29 0a 20 | 20 20 45 4c 53 45 0a 20 |ase *). | ELSE. |
|00002960| 20 20 20 20 20 5b 74 6c | 2c 5b 31 5d 5d 20 7c 20 | [tl|,[1]] | |
|00002970| 61 70 6e 64 72 20 7c 20 | 0a 20 20 20 20 20 20 49 |apndr | |. I|
|00002980| 4e 53 45 52 54 0a 09 20 | 7b 5b 45 6c 65 6d 65 6e |NSERT.. |{[Elemen|
|00002990| 74 2c 53 65 71 5d 20 3a | 3d 20 69 64 7d 0a 20 20 |t,Seq] :|= id}. |
|000029a0| 20 20 20 20 20 20 20 7b | 5b 4c 65 66 74 2c 52 69 | {|[Left,Ri|
|000029b0| 67 68 74 5d 20 3a 3d 20 | 5b 53 65 71 2c 20 64 69 |ght] := |[Seq, di|
|000029c0| 73 74 6c 20 7c 20 46 49 | 4c 54 45 52 20 3e 20 45 |stl | FI|LTER > E|
|000029d0| 4e 44 20 7c 20 6c 65 6e | 67 74 68 5d 20 7c 20 5b |ND | len|gth] | [|
|000029e0| 74 61 6b 65 6c 2c 64 72 | 6f 70 6c 5d 7d 0a 09 20 |takel,dr|opl]}.. |
|000029f0| 5b 4c 65 66 74 2c 5b 45 | 6c 65 6d 65 6e 74 5d 2c |[Left,[E|lement],|
|00002a00| 52 69 67 68 74 5d 20 7c | 20 63 61 74 0a 20 20 20 |Right] || cat. |
|00002a10| 20 20 20 45 4e 44 0a 20 | 20 20 45 4e 44 3b 0a 0a | END. | END;..|
|00002a20| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|00002a30| 20 2d 66 20 27 49 6e 74 | 65 72 27 0a 74 68 65 6e | -f 'Int|er'.then|
|00002a40| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 6f 76 65 |..echo s|har: ove|
|00002a50| 72 2d 77 72 69 74 69 6e | 67 20 65 78 69 73 74 69 |r-writin|g existi|
|00002a60| 6e 67 20 66 69 6c 65 20 | 22 27 49 6e 74 65 72 27 |ng file |"'Inter'|
|00002a70| 22 0a 66 69 0a 63 61 74 | 20 3c 3c 20 5c 53 48 41 |".fi.cat| << \SHA|
|00002a80| 52 5f 45 4f 46 20 3e 20 | 27 49 6e 74 65 72 27 0a |R_EOF > |'Inter'.|
|00002a90| 28 2a 0a 20 2a 20 53 65 | 74 20 69 6e 74 65 72 73 |(*. * Se|t inters|
|00002aa0| 65 63 74 69 6f 6e 3a 20 | 5b 41 2c 42 5d 20 3a 20 |ection: |[A,B] : |
|00002ab0| 49 6e 74 65 72 20 2d 3e | 20 65 6c 65 6d 65 6e 74 |Inter ->| element|
|00002ac0| 73 20 6f 66 20 42 20 77 | 68 69 63 68 20 61 72 65 |s of B w|hich are|
|00002ad0| 20 69 6e 20 41 20 0a 20 | 2a 20 0a 20 2a 20 45 78 | in A . |* . * Ex|
|00002ae0| 61 6d 70 6c 65 3a 0a 20 | 2a 20 20 20 20 20 20 3c |ample:. |* <|
|00002af0| 3c 32 20 33 20 34 3e 20 | 3c 35 20 33 20 32 20 31 |<2 3 4> |<5 3 2 1|
|00002b00| 3e 3e 20 3a 20 49 6e 74 | 65 72 20 2d 3e 20 3c 33 |>> : Int|er -> <3|
|00002b10| 20 32 3e 0a 20 2a 29 0a | 0a 44 45 46 20 49 6e 74 | 2>. *).|.DEF Int|
|00002b20| 65 72 20 41 53 0a 20 20 | 20 64 69 73 74 6c 20 7c |er AS. | distl ||
|00002b30| 20 46 49 4c 54 45 52 20 | 6d 65 6d 62 65 72 20 45 | FILTER |member E|
|00002b40| 4e 44 20 7c 20 45 41 43 | 48 20 32 20 45 4e 44 3b |ND | EAC|H 2 END;|
|00002b50| 0a 53 48 41 52 5f 45 4f | 46 0a 69 66 20 74 65 73 |.SHAR_EO|F.if tes|
|00002b60| 74 20 2d 66 20 27 4d 61 | 74 4d 75 6c 27 0a 74 68 |t -f 'Ma|tMul'.th|
|00002b70| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 6f |en..echo| shar: o|
|00002b80| 76 65 72 2d 77 72 69 74 | 69 6e 67 20 65 78 69 73 |ver-writ|ing exis|
|00002b90| 74 69 6e 67 20 66 69 6c | 65 20 22 27 4d 61 74 4d |ting fil|e "'MatM|
|00002ba0| 75 6c 27 22 0a 66 69 0a | 63 61 74 20 3c 3c 20 5c |ul'".fi.|cat << \|
|00002bb0| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 4d 61 74 4d |SHAR_EOF| > 'MatM|
|00002bc0| 75 6c 27 0a 28 2a 0a 20 | 2a 20 4d 61 74 4d 75 6c |ul'.(*. |* MatMul|
|00002bd0| 0a 20 2a 0a 20 2a 20 5b | 6d 61 74 72 69 78 41 2c |. *. * [|matrixA,|
|00002be0| 6d 61 74 72 69 78 42 5d | 20 2d 3e 20 6d 61 74 72 |matrixB]| -> matr|
|00002bf0| 69 78 41 42 0a 20 2a 29 | 0a 44 45 46 20 4d 61 74 |ixAB. *)|.DEF Mat|
|00002c00| 4d 75 6c 20 41 53 0a 20 | 20 20 7b 5b 41 2c 42 5d |Mul AS. | {[A,B]|
|00002c10| 20 3a 3d 20 69 64 7d 0a | 20 20 20 5b 41 2c 42 7c | := id}.| [A,B||
|00002c20| 74 72 61 6e 73 5d 20 7c | 20 64 69 73 74 72 20 7c |trans] || distr ||
|00002c30| 0a 20 20 20 45 41 43 48 | 20 64 69 73 74 6c 20 7c |. EACH| distl ||
|00002c40| 0a 20 20 20 20 20 20 45 | 41 43 48 20 49 6e 6e 65 |. E|ACH Inne|
|00002c50| 72 20 45 4e 44 0a 20 20 | 20 45 4e 44 3b 20 20 0a |r END. | END; .|
|00002c60| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|00002c70| 20 2d 66 20 27 4d 65 6d | 62 65 72 27 0a 74 68 65 | -f 'Mem|ber'.the|
|00002c80| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 6f 76 |n..echo |shar: ov|
|00002c90| 65 72 2d 77 72 69 74 69 | 6e 67 20 65 78 69 73 74 |er-writi|ng exist|
|00002ca0| 69 6e 67 20 66 69 6c 65 | 20 22 27 4d 65 6d 62 65 |ing file| "'Membe|
|00002cb0| 72 27 22 0a 66 69 0a 63 | 61 74 20 3c 3c 20 5c 53 |r'".fi.c|at << \S|
|00002cc0| 48 41 52 5f 45 4f 46 20 | 3e 20 27 4d 65 6d 62 65 |HAR_EOF |> 'Membe|
|00002cd0| 72 27 0a 28 2a 0a 20 2a | 20 3c 53 20 65 3e 20 3a |r'.(*. *| <S e> :|
|00002ce0| 20 4d 65 6d 62 65 72 20 | 2d 3e 20 23 74 20 69 66 | Member |-> #t if|
|00002cf0| 20 65 20 69 73 20 69 6e | 20 73 65 71 75 65 6e 63 | e is in| sequenc|
|00002d00| 65 20 53 2c 20 23 66 20 | 6f 74 68 65 72 77 69 73 |e S, #f |otherwis|
|00002d10| 65 0a 20 2a 0a 20 2a 20 | 45 78 61 6d 70 6c 65 73 |e. *. * |Examples|
|00002d20| 3a 0a 20 2a 20 20 20 20 | 20 20 3c 3c 61 20 62 20 |:. * | <<a b |
|00002d30| 63 20 64 3e 20 63 3e 20 | 2d 3e 20 74 0a 20 2a 20 |c d> c> |-> t. * |
|00002d40| 20 20 20 20 20 3c 3c 32 | 20 34 20 36 20 38 3e 20 | <<2| 4 6 8> |
|00002d50| 33 3e 20 2d 3e 20 66 0a | 20 2a 29 0a 44 45 46 20 |3> -> f.| *).DEF |
|00002d60| 4d 65 6d 62 65 72 20 41 | 53 0a 20 20 20 64 69 73 |Member A|S. dis|
|00002d70| 74 72 20 7c 20 45 41 43 | 48 20 3d 20 45 4e 44 20 |tr | EAC|H = END |
|00002d80| 7c 20 61 6e 79 3b 0a 0a | 53 48 41 52 5f 45 4f 46 || any;..|SHAR_EOF|
|00002d90| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 4d 65 72 |.if test| -f 'Mer|
|00002da0| 67 65 27 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |ge'.then|..echo s|
|00002db0| 68 61 72 3a 20 6f 76 65 | 72 2d 77 72 69 74 69 6e |har: ove|r-writin|
|00002dc0| 67 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |g existi|ng file |
|00002dd0| 22 27 4d 65 72 67 65 27 | 22 0a 66 69 0a 63 61 74 |"'Merge'|".fi.cat|
|00002de0| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00002df0| 27 4d 65 72 67 65 27 0a | 28 2a 0a 20 2a 20 4d 65 |'Merge'.|(*. * Me|
|00002e00| 72 67 65 0a 20 2a 0a 20 | 2a 20 4d 65 72 67 65 20 |rge. *. |* Merge |
|00002e10| 74 77 6f 20 61 73 63 65 | 6e 64 69 6e 67 20 73 65 |two asce|nding se|
|00002e20| 71 75 65 6e 63 65 73 2e | 0a 20 2a 0a 20 2a 20 54 |quences.|. *. * T|
|00002e30| 68 65 20 73 65 71 75 65 | 6e 63 65 73 20 73 68 6f |he seque|nces sho|
|00002e40| 75 6c 64 20 6e 6f 74 20 | 6d 69 78 20 73 74 72 69 |uld not |mix stri|
|00002e50| 6e 67 73 20 61 6e 64 20 | 6e 75 6d 62 65 72 73 2e |ngs and |numbers.|
|00002e60| 0a 20 2a 0a 20 2a 20 45 | 78 61 6d 70 6c 65 3a 0a |. *. * E|xample:.|
|00002e70| 20 2a 0a 20 2a 09 3c 3c | 61 20 62 20 78 20 7a 3e | *. *.<<|a b x z>|
|00002e80| 20 3c 63 20 64 20 7a 3e | 3e 20 3a 20 4d 65 72 67 | <c d z>|> : Merg|
|00002e90| 65 20 2d 3e 20 3c 61 20 | 62 20 63 20 64 20 78 20 |e -> <a |b c d x |
|00002ea0| 79 20 7a 3e 0a 20 2a 29 | 0a 44 45 46 20 4d 65 72 |y z>. *)|.DEF Mer|
|00002eb0| 67 65 20 41 53 0a 20 20 | 20 49 46 20 45 41 43 48 |ge AS. | IF EACH|
|00002ec0| 20 6e 75 6c 6c 20 45 4e | 44 20 7c 20 6f 72 20 54 | null EN|D | or T|
|00002ed0| 48 45 4e 20 63 61 74 0a | 20 20 20 45 4c 53 45 0a |HEN cat.| ELSE.|
|00002ee0| 20 20 20 20 20 20 49 46 | 20 45 41 43 48 20 31 20 | IF| EACH 1 |
|00002ef0| 45 4e 44 20 7c 20 3e 20 | 54 48 45 4e 20 72 65 76 |END | > |THEN rev|
|00002f00| 65 72 73 65 20 45 4c 53 | 45 20 69 64 20 45 4e 44 |erse ELS|E id END|
|00002f10| 20 7c 0a 20 20 20 20 20 | 20 5b 31 7c 31 2c 5b 31 | |. | [1|1,[1|
|00002f20| 7c 74 6c 2c 32 5d 7c 4d | 65 72 67 65 5d 20 7c 20 ||tl,2]|M|erge] | |
|00002f30| 61 70 6e 64 6c 0a 20 20 | 20 45 4e 44 3b 0a 0a 53 |apndl. | END;..S|
|00002f40| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|00002f50| 2d 66 20 27 4d 65 72 67 | 65 53 6f 72 74 27 0a 74 |-f 'Merg|eSort'.t|
|00002f60| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|00002f70| 6f 76 65 72 2d 77 72 69 | 74 69 6e 67 20 65 78 69 |over-wri|ting exi|
|00002f80| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 4d 65 72 |sting fi|le "'Mer|
|00002f90| 67 65 53 6f 72 74 27 22 | 0a 66 69 0a 63 61 74 20 |geSort'"|.fi.cat |
|00002fa0| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|00002fb0| 4d 65 72 67 65 53 6f 72 | 74 27 0a 28 2a 0a 20 2a |MergeSor|t'.(*. *|
|00002fc0| 20 4d 65 72 67 65 53 6f | 72 74 0a 20 2a 0a 20 2a | MergeSo|rt. *. *|
|00002fd0| 20 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 73 | This fu|nction s|
|00002fe0| 6f 72 74 73 20 61 20 73 | 65 71 75 65 6e 63 65 20 |orts a s|equence |
|00002ff0| 6f 66 20 6e 75 6d 62 65 | 72 73 20 6f 72 20 73 74 |of numbe|rs or st|
|00003000| 72 69 6e 67 73 20 69 6e | 74 6f 20 61 73 63 65 6e |rings in|to ascen|
|00003010| 64 69 6e 67 20 6f 72 64 | 65 72 0a 20 2a 20 75 73 |ding ord|er. * us|
|00003020| 69 6e 67 20 6d 65 72 67 | 65 20 73 6f 72 74 2e 0a |ing merg|e sort..|
|00003030| 20 2a 0a 20 2a 20 45 78 | 61 6d 70 6c 65 73 3a 0a | *. * Ex|amples:.|
|00003040| 20 2a 0a 20 2a 20 20 20 | 20 20 20 3c 33 20 31 20 | *. * | <3 1 |
|00003050| 34 20 31 20 35 20 39 20 | 32 3e 20 3a 20 4d 65 72 |4 1 5 9 |2> : Mer|
|00003060| 67 65 53 6f 72 74 20 3d | 3d 20 3c 31 20 31 20 32 |geSort =|= <1 1 2|
|00003070| 20 33 20 34 20 35 20 39 | 3e 0a 20 2a 0a 20 2a 20 | 3 4 5 9|>. *. * |
|00003080| 20 20 20 20 20 3c 61 6c | 6c 20 77 6f 72 6b 20 61 | <al|l work a|
|00003090| 6e 64 20 6e 6f 20 70 6c | 61 79 3e 20 3a 20 4d 65 |nd no pl|ay> : Me|
|000030a0| 72 67 65 53 6f 72 74 20 | 3d 3d 20 3c 61 6c 6c 20 |rgeSort |== <all |
|000030b0| 61 6e 64 20 6e 6f 20 70 | 6c 61 79 20 77 6f 72 6b |and no p|lay work|
|000030c0| 3e 0a 20 2a 0a 20 2a 20 | 54 68 65 20 73 65 71 75 |>. *. * |The sequ|
|000030d0| 65 6e 63 65 20 6d 61 79 | 20 6e 6f 74 20 6d 69 78 |ence may| not mix|
|000030e0| 20 73 74 72 69 6e 67 73 | 20 61 6e 64 20 6e 75 6d | strings| and num|
|000030f0| 62 65 72 73 2e 0a 20 2a | 29 0a 44 45 46 20 4d 65 |bers.. *|).DEF Me|
|00003100| 72 67 65 53 6f 72 74 20 | 41 53 0a 20 20 20 49 46 |rgeSort |AS. IF|
|00003110| 20 5b 6c 65 6e 67 74 68 | 2c 23 32 5d 20 7c 20 3c | [length|,#2] | <|
|00003120| 20 54 48 45 4e 20 69 64 | 0a 20 20 20 45 4c 53 45 | THEN id|. ELSE|
|00003130| 0a 20 20 20 20 20 20 20 | 5b 69 64 2c 20 5b 6c 65 |. |[id, [le|
|00003140| 6e 67 74 68 2c 23 32 5d | 20 7c 20 64 69 76 5d 20 |ngth,#2]| | div] |
|00003150| 7c 0a 20 20 20 20 20 20 | 20 5b 74 61 6b 65 6c 2c ||. | [takel,|
|00003160| 64 72 6f 70 6c 5d 20 7c | 20 45 41 43 48 20 4d 65 |dropl] || EACH Me|
|00003170| 72 67 65 53 6f 72 74 20 | 45 4e 44 20 7c 20 4d 65 |rgeSort |END | Me|
|00003180| 72 67 65 0a 20 20 20 45 | 4e 44 3b 0a 0a 53 48 41 |rge. E|ND;..SHA|
|00003190| 52 5f 45 4f 46 0a 69 66 | 20 74 65 73 74 20 2d 66 |R_EOF.if| test -f|
|000031a0| 20 27 4f 75 74 65 72 27 | 0a 74 68 65 6e 0a 09 65 | 'Outer'|.then..e|
|000031b0| 63 68 6f 20 73 68 61 72 | 3a 20 6f 76 65 72 2d 77 |cho shar|: over-w|
|000031c0| 72 69 74 69 6e 67 20 65 | 78 69 73 74 69 6e 67 20 |riting e|xisting |
|000031d0| 66 69 6c 65 20 22 27 4f | 75 74 65 72 27 22 0a 66 |file "'O|uter'".f|
|000031e0| 69 0a 63 61 74 20 3c 3c | 20 5c 53 48 41 52 5f 45 |i.cat <<| \SHAR_E|
|000031f0| 4f 46 20 3e 20 27 4f 75 | 74 65 72 27 0a 28 2a 20 |OF > 'Ou|ter'.(* |
|00003200| 0a 20 2a 20 4f 75 74 65 | 72 20 70 72 6f 64 75 63 |. * Oute|r produc|
|00003210| 74 20 6f 66 20 74 77 6f | 20 76 65 63 74 6f 72 73 |t of two| vectors|
|00003220| 20 0a 20 2a 29 0a 44 45 | 46 20 4f 75 74 65 72 20 | . *).DE|F Outer |
|00003230| 41 53 20 0a 20 20 20 43 | 61 72 74 20 7c 20 45 41 |AS . C|art | EA|
|00003240| 43 48 20 45 41 43 48 20 | 2a 20 45 4e 44 20 45 4e |CH EACH |* END EN|
|00003250| 44 3b 0a 0a 53 48 41 52 | 5f 45 4f 46 0a 69 66 20 |D;..SHAR|_EOF.if |
|00003260| 74 65 73 74 20 2d 66 20 | 27 50 61 73 54 72 69 27 |test -f |'PasTri'|
|00003270| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00003280| 3a 20 6f 76 65 72 2d 77 | 72 69 74 69 6e 67 20 65 |: over-w|riting e|
|00003290| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 22 27 50 |xisting |file "'P|
|000032a0| 61 73 54 72 69 27 22 0a | 66 69 0a 63 61 74 20 3c |asTri'".|fi.cat <|
|000032b0| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 50 |< \SHAR_|EOF > 'P|
|000032c0| 61 73 54 72 69 27 0a 28 | 2a 0a 20 2a 20 50 61 73 |asTri'.(|*. * Pas|
|000032d0| 63 61 6c 27 73 20 74 72 | 69 61 6e 67 6c 65 20 67 |cal's tr|iangle g|
|000032e0| 65 6e 65 72 61 74 6f 72 | 0a 20 2a 0a 20 2a 20 6e |enerator|. *. * n|
|000032f0| 20 3a 20 50 61 73 54 72 | 69 20 2d 3e 20 66 69 72 | : PasTr|i -> fir|
|00003300| 73 74 20 6e 20 72 6f 77 | 73 20 6f 66 20 50 61 73 |st n row|s of Pas|
|00003310| 63 61 6c 27 73 20 74 72 | 69 61 6e 67 6c 65 0a 20 |cal's tr|iangle. |
|00003320| 2a 0a 20 2a 20 45 78 61 | 6d 70 6c 65 0a 20 2a 20 |*. * Exa|mple. * |
|00003330| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 35 20 3a | | 5 :|
|00003340| 20 50 61 73 54 72 69 20 | 2d 3e 20 3c 0a 20 2a 20 | PasTri |-> <. * |
|00003350| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003360| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 3c 31 | | <1|
|00003370| 3e 0a 20 2a 20 20 20 20 | 20 20 20 20 20 20 20 20 |>. * | |
|00003380| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003390| 20 20 20 3c 31 20 31 3e | 0a 20 2a 20 20 20 20 20 | <1 1>|. * |
|000033a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000033b0| 20 20 20 20 20 20 20 20 | 20 20 3c 31 20 32 20 31 | | <1 2 1|
|000033c0| 3e 0a 20 2a 20 20 20 20 | 20 20 20 20 20 20 20 20 |>. * | |
|000033d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000033e0| 20 20 20 3c 31 20 33 20 | 33 20 31 3e 0a 20 2a 20 | <1 3 |3 1>. * |
|000033f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003400| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 3c 31 | | <1|
|00003410| 20 34 20 36 20 34 20 31 | 3e 0a 20 2a 20 20 20 20 | 4 6 4 1|>. * |
|00003420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003430| 20 20 20 20 20 20 20 20 | 3e 0a 20 2a 29 0a 0a 44 | |>. *)..D|
|00003440| 45 46 20 50 61 73 54 72 | 69 20 41 53 20 20 20 20 |EF PasTr|i AS |
|00003450| 20 20 20 20 20 20 0a 20 | 20 20 49 46 20 5b 69 64 | . | IF [id|
|00003460| 2c 23 30 5d 20 7c 20 3c | 3d 20 54 48 45 4e 20 23 |,#0] | <|= THEN #|
|00003470| 3c 3c 31 3e 3e 0a 20 20 | 20 45 4c 53 45 0a 20 20 |<<1>>. | ELSE. |
|00003480| 20 20 20 20 73 75 62 31 | 20 7c 20 50 61 73 54 72 | sub1| | PasTr|
|00003490| 69 20 7c 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |i | | |
|000034a0| 20 20 20 28 2a 20 43 72 | 65 61 74 65 20 74 72 69 | (* Cr|eate tri|
|000034b0| 61 6e 67 6c 65 20 77 69 | 74 68 20 6e 2d 31 20 72 |angle wi|th n-1 r|
|000034c0| 6f 77 73 20 2a 29 0a 20 | 20 20 20 20 20 5b 0a 20 |ows *). | [. |
|000034d0| 20 20 20 20 20 20 20 20 | 69 64 2c 20 20 0a 0a 20 | |id, .. |
|000034e0| 20 20 20 20 20 20 20 20 | 31 72 20 7c 20 20 20 20 | |1r | |
|000034f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003500| 20 20 20 20 28 2a 20 54 | 61 6b 65 20 6c 61 73 74 | (* T|ake last|
|00003510| 20 72 6f 77 20 6f 66 20 | 73 6d 61 6c 6c 65 72 20 | row of |smaller |
|00003520| 74 72 69 61 6e 67 6c 65 | 20 2a 29 0a 20 20 20 20 |triangle| *). |
|00003530| 20 20 20 20 20 5b 0a 20 | 20 20 20 20 20 20 20 20 | [. | |
|00003540| 20 20 20 5b 23 30 2c 69 | 64 5d 20 7c 20 61 70 6e | [#0,i|d] | apn|
|00003550| 64 6c 2c 20 20 20 20 20 | 20 20 20 20 28 2a 20 41 |dl, | (* A|
|00003560| 70 70 65 6e 64 20 30 20 | 74 6f 20 6c 65 66 74 20 |ppend 0 |to left |
|00003570| 65 64 67 65 20 6f 66 20 | 72 6f 77 20 20 2a 29 0a |edge of |row *).|
|00003580| 20 20 20 20 20 20 20 20 | 20 20 20 20 5b 69 64 2c | | [id,|
|00003590| 23 30 5d 20 7c 20 61 70 | 6e 64 72 20 20 20 20 20 |#0] | ap|ndr |
|000035a0| 20 20 20 20 20 28 2a 20 | 41 70 70 65 6e 64 20 30 | (* |Append 0|
|000035b0| 20 74 6f 20 72 69 67 68 | 74 20 65 64 67 65 20 6f | to righ|t edge o|
|000035c0| 66 20 72 6f 77 20 2a 29 | 0a 20 20 20 20 20 20 20 |f row *)|. |
|000035d0| 20 20 5d 20 7c 20 74 72 | 61 6e 73 20 7c 20 45 41 | ] | tr|ans | EA|
|000035e0| 43 48 20 2b 20 45 4e 44 | 20 20 20 20 20 20 28 2a |CH + END| (*|
|000035f0| 20 41 64 64 20 63 6f 72 | 72 65 73 70 6f 6e 64 69 | Add cor|respondi|
|00003600| 6e 67 20 65 6c 65 6d 65 | 6e 74 73 20 2a 29 0a 0a |ng eleme|nts *)..|
|00003610| 20 20 20 20 20 20 5d 20 | 7c 20 61 70 6e 64 72 20 | ] || apndr |
|00003620| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003630| 20 20 20 20 20 28 2a 20 | 41 70 70 65 6e 64 20 6e | (* |Append n|
|00003640| 65 77 20 72 6f 77 20 74 | 6f 20 73 6d 61 6c 6c 65 |ew row t|o smalle|
|00003650| 72 20 74 72 69 61 6e 67 | 6c 65 20 2a 29 0a 20 20 |r triang|le *). |
|00003660| 20 45 4e 44 3b 0a 0a 0a | 0a 0a 53 48 41 52 5f 45 | END;...|..SHAR_E|
|00003670| 4f 46 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 50 |OF.if te|st -f 'P|
|00003680| 65 72 6d 75 74 65 27 0a | 74 68 65 6e 0a 09 65 63 |ermute'.|then..ec|
|00003690| 68 6f 20 73 68 61 72 3a | 20 6f 76 65 72 2d 77 72 |ho shar:| over-wr|
|000036a0| 69 74 69 6e 67 20 65 78 | 69 73 74 69 6e 67 20 66 |iting ex|isting f|
|000036b0| 69 6c 65 20 22 27 50 65 | 72 6d 75 74 65 27 22 0a |ile "'Pe|rmute'".|
|000036c0| 66 69 0a 63 61 74 20 3c | 3c 20 5c 53 48 41 52 5f |fi.cat <|< \SHAR_|
|000036d0| 45 4f 46 20 3e 20 27 50 | 65 72 6d 75 74 65 27 0a |EOF > 'P|ermute'.|
|000036e0| 44 45 46 20 50 65 72 6d | 75 74 65 20 41 53 0a 20 |DEF Perm|ute AS. |
|000036f0| 20 20 49 46 20 6e 75 6c | 6c 20 54 48 45 4e 20 23 | IF nul|l THEN #|
|00003700| 3c 3c 3e 3e 0a 20 20 20 | 45 4c 53 45 0a 20 20 20 |<<>>. |ELSE. |
|00003710| 20 20 20 5b 69 64 2c 6c | 65 6e 67 74 68 7c 69 6f | [id,l|ength|io|
|00003720| 74 61 5d 20 7c 20 64 69 | 73 74 6c 20 7c 0a 20 20 |ta] | di|stl |. |
|00003730| 20 20 20 20 45 41 43 48 | 0a 09 20 5b 70 69 63 6b | EACH|.. [pick|
|00003740| 2c 5b 74 61 6b 65 6c 7c | 74 6c 72 2c 64 72 6f 70 |,[takel||tlr,drop|
|00003750| 6c 5d 7c 63 61 74 7c 50 | 65 72 6d 75 74 65 5d 20 |l]|cat|P|ermute] |
|00003760| 7c 20 64 69 73 74 6c 20 | 7c 20 45 41 43 48 20 61 || distl || EACH a|
|00003770| 70 6e 64 6c 20 45 4e 44 | 0a 20 20 20 20 20 20 45 |pndl END|. E|
|00003780| 4e 44 20 7c 20 63 61 74 | 0a 20 20 20 45 4e 44 3b |ND | cat|. END;|
|00003790| 20 0a 53 48 41 52 5f 45 | 4f 46 0a 69 66 20 74 65 | .SHAR_E|OF.if te|
|000037a0| 73 74 20 2d 66 20 27 50 | 69 67 4c 61 74 69 6e 27 |st -f 'P|igLatin'|
|000037b0| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|000037c0| 3a 20 6f 76 65 72 2d 77 | 72 69 74 69 6e 67 20 65 |: over-w|riting e|
|000037d0| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 22 27 50 |xisting |file "'P|
|000037e0| 69 67 4c 61 74 69 6e 27 | 22 0a 66 69 0a 63 61 74 |igLatin'|".fi.cat|
|000037f0| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00003800| 27 50 69 67 4c 61 74 69 | 6e 27 0a 28 2a 0a 20 2a |'PigLati|n'.(*. *|
|00003810| 20 43 6f 6e 76 65 72 74 | 20 73 65 71 75 65 6e 63 | Convert| sequenc|
|00003820| 65 20 6f 66 20 77 6f 72 | 64 73 20 74 6f 20 70 69 |e of wor|ds to pi|
|00003830| 67 2d 6c 61 74 69 6e 0a | 20 2a 0a 20 2a 20 45 2e |g-latin.| *. * E.|
|00003840| 67 2e 0a 20 2a 20 20 20 | 20 20 20 3c 48 61 76 65 |g.. * | <Have|
|00003850| 20 61 20 6e 69 63 65 20 | 64 61 79 3e 20 3a 20 50 | a nice |day> : P|
|00003860| 69 67 4c 61 74 69 6e 20 | 2d 3e 20 3c 61 76 65 48 |igLatin |-> <aveH|
|00003870| 61 79 20 61 20 69 63 65 | 6e 61 79 20 61 79 64 61 |ay a ice|nay ayda|
|00003880| 79 3e 0a 20 2a 0a 20 2a | 20 54 68 65 20 74 65 78 |y>. *. *| The tex|
|00003890| 74 20 70 72 6f 63 65 73 | 73 69 6e 67 20 69 73 20 |t proces|sing is |
|000038a0| 64 6f 6e 65 20 76 69 61 | 20 65 78 70 6c 6f 64 65 |done via| explode|
|000038b0| 20 61 6e 64 20 69 6d 70 | 6c 6f 64 65 2e 0a 20 2a | and imp|lode.. *|
|000038c0| 20 60 65 78 70 6c 6f 64 | 65 27 20 63 6f 6e 76 65 | `explod|e' conve|
|000038d0| 72 74 73 20 61 20 73 74 | 72 69 6e 67 20 69 6e 74 |rts a st|ring int|
|000038e0| 6f 20 61 20 73 65 71 75 | 65 6e 63 65 20 6f 66 20 |o a sequ|ence of |
|000038f0| 63 68 61 72 61 63 74 65 | 72 73 20 28 31 20 6c 65 |characte|rs (1 le|
|00003900| 74 74 65 72 20 73 74 72 | 69 6e 67 73 29 2c 0a 20 |tter str|ings),. |
|00003910| 2a 20 60 69 6d 70 6c 6f | 64 65 27 20 63 61 74 65 |* `implo|de' cate|
|00003920| 6e 61 74 65 73 20 61 20 | 73 65 71 75 65 6e 63 65 |nates a |sequence|
|00003930| 20 6f 66 20 73 74 72 69 | 6e 67 73 20 69 6e 74 6f | of stri|ngs into|
|00003940| 20 61 20 73 69 6e 67 6c | 65 20 73 74 72 69 6e 67 | a singl|e string|
|00003950| 2e 0a 20 2a 0a 20 2a 20 | 43 6f 64 65 64 20 62 79 |.. *. * |Coded by|
|00003960| 20 4b 65 76 69 6e 20 4b | 65 6e 6e 79 20 61 6e 64 | Kevin K|enny and|
|00003970| 20 41 72 63 68 20 52 6f | 62 69 73 6f 6e 0a 20 2a | Arch Ro|bison. *|
|00003980| 29 0a 0a 44 45 46 20 50 | 69 67 4c 61 74 69 6e 20 |)..DEF P|igLatin |
|00003990| 41 53 0a 0a 20 20 20 45 | 41 43 48 0a 20 20 20 20 |AS.. E|ACH. |
|000039a0| 20 20 65 78 70 6c 6f 64 | 65 20 7c 0a 0a 20 20 20 | explod|e |.. |
|000039b0| 20 20 20 49 46 20 45 41 | 43 48 20 56 6f 77 65 6c | IF EA|CH Vowel|
|000039c0| 20 45 4e 44 20 7c 20 61 | 6e 79 20 7c 20 7e 20 54 | END | a|ny | ~ T|
|000039d0| 48 45 4e 20 69 64 20 20 | 20 20 28 2a 20 4e 6f 74 |HEN id | (* Not|
|000039e0| 20 61 20 77 6f 72 64 2c | 20 64 6f 6e 27 74 20 6d | a word,| don't m|
|000039f0| 61 6e 67 6c 65 20 69 74 | 20 2a 29 0a 20 20 20 20 |angle it| *). |
|00003a00| 20 20 45 4c 53 45 0a 0a | 20 20 20 20 20 20 20 20 | ELSE..| |
|00003a10| 20 49 46 20 31 7c 56 6f | 77 65 6c 7c 7e 20 54 48 | IF 1|Vo|wel|~ TH|
|00003a20| 45 4e 0a 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |EN.. | |
|00003a30| 28 2a 20 57 6f 72 64 20 | 62 65 67 69 6e 73 20 77 |(* Word |begins w|
|00003a40| 69 74 68 20 61 20 63 6f | 6e 73 6f 6e 61 6e 74 20 |ith a co|nsonant |
|00003a50| 2d 20 72 6f 74 61 74 65 | 20 66 69 72 73 74 20 76 |- rotate| first v|
|00003a60| 6f 77 65 6c 20 74 6f 20 | 66 72 6f 6e 74 2e 20 2a |owel to |front. *|
|00003a70| 29 0a 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 57 |).. | W|
|00003a80| 48 49 4c 45 20 31 7c 56 | 6f 77 65 6c 7c 7e 20 44 |HILE 1|V|owel|~ D|
|00003a90| 4f 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |O. | |
|00003aa0| 20 5b 74 6c 2c 31 5d 7c | 61 70 6e 64 72 0a 20 20 | [tl,1]||apndr. |
|00003ab0| 20 20 20 20 20 20 20 20 | 20 20 45 4e 44 0a 0a 20 | | END.. |
|00003ac0| 20 20 20 20 20 20 20 20 | 45 4c 53 49 46 20 5b 31 | |ELSIF [1|
|00003ad0| 72 7c 56 6f 77 65 6c 2c | 20 5b 23 3c 79 20 59 3e |r|Vowel,| [#<y Y>|
|00003ae0| 2c 31 72 5d 7c 6d 65 6d | 62 65 72 5d 20 7c 20 6f |,1r]|mem|ber] | o|
|00003af0| 72 20 54 48 45 4e 0a 0a | 20 20 20 20 20 20 20 20 |r THEN..| |
|00003b00| 20 20 20 20 28 2a 20 57 | 6f 72 64 20 65 6e 64 73 | (* W|ord ends|
|00003b10| 20 69 6e 20 76 6f 77 65 | 6c 20 6f 72 20 27 79 27 | in vowe|l or 'y'|
|00003b20| 20 2d 20 61 70 70 65 6e | 64 20 61 20 27 77 27 20 | - appen|d a 'w' |
|00003b30| 2a 29 0a 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |*).. | |
|00003b40| 5b 69 64 2c 23 77 5d 20 | 7c 20 61 70 6e 64 72 0a |[id,#w] || apndr.|
|00003b50| 0a 20 20 20 20 20 20 20 | 20 20 45 4c 53 45 20 69 |. | ELSE i|
|00003b60| 64 0a 20 20 20 20 20 20 | 20 20 20 45 4e 44 20 7c |d. | END ||
|00003b70| 0a 0a 20 20 20 20 20 20 | 20 20 20 5b 69 64 2c 23 |.. | [id,#|
|00003b80| 3c 61 20 79 3e 5d 20 7c | 20 63 61 74 0a 0a 20 20 |<a y>] || cat.. |
|00003b90| 20 20 20 20 45 4e 44 20 | 7c 0a 0a 20 20 20 20 20 | END ||.. |
|00003ba0| 20 69 6d 70 6c 6f 64 65 | 0a 20 20 20 45 4e 44 3b | implode|. END;|
|00003bb0| 0a 0a 53 48 41 52 5f 45 | 4f 46 0a 69 66 20 74 65 |..SHAR_E|OF.if te|
|00003bc0| 73 74 20 2d 66 20 27 50 | 6f 77 65 72 53 65 74 27 |st -f 'P|owerSet'|
|00003bd0| 0a 74 68 65 6e 0a 09 65 | 63 68 6f 20 73 68 61 72 |.then..e|cho shar|
|00003be0| 3a 20 6f 76 65 72 2d 77 | 72 69 74 69 6e 67 20 65 |: over-w|riting e|
|00003bf0| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 22 27 50 |xisting |file "'P|
|00003c00| 6f 77 65 72 53 65 74 27 | 22 0a 66 69 0a 63 61 74 |owerSet'|".fi.cat|
|00003c10| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00003c20| 27 50 6f 77 65 72 53 65 | 74 27 0a 28 2a 0a 20 2a |'PowerSe|t'.(*. *|
|00003c30| 20 50 6f 77 65 72 53 65 | 74 0a 20 2a 0a 20 2a 20 | PowerSe|t. *. * |
|00003c40| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 67 65 |This fun|ction ge|
|00003c50| 6e 65 72 61 74 65 73 20 | 61 6c 6c 20 73 75 62 73 |nerates |all subs|
|00003c60| 65 74 73 20 6f 66 20 61 | 20 67 69 76 65 6e 20 73 |ets of a| given s|
|00003c70| 65 74 2e 20 20 53 65 74 | 73 20 61 72 65 20 0a 20 |et. Set|s are . |
|00003c80| 2a 20 72 65 70 72 65 73 | 65 6e 74 65 64 20 61 73 |* repres|ented as|
|00003c90| 20 73 65 71 75 65 6e 63 | 65 73 20 6f 66 20 64 69 | sequenc|es of di|
|00003ca0| 73 74 69 6e 63 74 20 65 | 6c 65 6d 65 6e 74 73 2e |stinct e|lements.|
|00003cb0| 0a 20 2a 0a 20 2a 20 45 | 78 61 6d 70 6c 65 73 3a |. *. * E|xamples:|
|00003cc0| 0a 20 2a 0a 20 2a 20 20 | 20 20 20 20 3c 3e 20 3a |. *. * | <> :|
|00003cd0| 20 50 6f 77 65 72 53 65 | 74 20 2d 3e 20 3c 3c 3e | PowerSe|t -> <<>|
|00003ce0| 3e 0a 20 2a 0a 20 2a 20 | 20 20 20 20 20 3c 61 20 |>. *. * | <a |
|00003cf0| 62 20 63 3e 20 3a 20 50 | 6f 77 65 72 53 65 74 20 |b c> : P|owerSet |
|00003d00| 2d 3e 20 3c 3c 61 2c 62 | 2c 63 3e 2c 3c 61 2c 62 |-> <<a,b|,c>,<a,b|
|00003d10| 3e 2c 3c 61 2c 63 3e 2c | 3c 61 3e 2c 3c 62 2c 63 |>,<a,c>,|<a>,<b,c|
|00003d20| 3e 2c 3c 62 3e 2c 3c 63 | 3e 2c 3c 3e 3e 0a 20 2a |>,<b>,<c|>,<>>. *|
|00003d30| 29 0a 0a 44 45 46 20 50 | 6f 77 65 72 53 65 74 20 |)..DEF P|owerSet |
|00003d40| 41 53 0a 20 20 20 49 46 | 20 6e 75 6c 6c 20 54 48 |AS. IF| null TH|
|00003d50| 45 4e 20 5b 69 64 5d 20 | 0a 20 20 20 45 4c 53 45 |EN [id] |. ELSE|
|00003d60| 20 0a 20 20 20 20 20 20 | 5b 31 2c 20 74 6c 20 7c | . |[1, tl ||
|00003d70| 20 50 6f 77 65 72 53 65 | 74 5d 20 7c 0a 20 20 20 | PowerSe|t] |. |
|00003d80| 20 20 20 5b 0a 20 20 20 | 20 20 20 20 20 20 64 69 | [. | di|
|00003d90| 73 74 6c 20 7c 20 45 41 | 43 48 20 61 70 6e 64 6c |stl | EA|CH apndl|
|00003da0| 20 45 4e 44 2c 0a 09 20 | 32 20 0a 20 20 20 20 20 | END,.. |2 . |
|00003db0| 20 5d 20 0a 20 20 20 20 | 20 20 7c 20 63 61 74 20 | ] . | | cat |
|00003dc0| 0a 20 20 20 45 4e 44 3b | 0a 0a 53 48 41 52 5f 45 |. END;|..SHAR_E|
|00003dd0| 4f 46 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 51 |OF.if te|st -f 'Q|
|00003de0| 75 69 63 6b 53 6f 72 74 | 27 0a 74 68 65 6e 0a 09 |uickSort|'.then..|
|00003df0| 65 63 68 6f 20 73 68 61 | 72 3a 20 6f 76 65 72 2d |echo sha|r: over-|
|00003e00| 77 72 69 74 69 6e 67 20 | 65 78 69 73 74 69 6e 67 |writing |existing|
|00003e10| 20 66 69 6c 65 20 22 27 | 51 75 69 63 6b 53 6f 72 | file "'|QuickSor|
|00003e20| 74 27 22 0a 66 69 0a 63 | 61 74 20 3c 3c 20 5c 53 |t'".fi.c|at << \S|
|00003e30| 48 41 52 5f 45 4f 46 20 | 3e 20 27 51 75 69 63 6b |HAR_EOF |> 'Quick|
|00003e40| 53 6f 72 74 27 0a 28 2a | 0a 20 2a 20 51 75 69 63 |Sort'.(*|. * Quic|
|00003e50| 6b 53 6f 72 74 0a 20 2a | 0a 20 2a 20 54 68 69 73 |kSort. *|. * This|
|00003e60| 20 66 75 6e 63 74 69 6f | 6e 20 73 6f 72 74 73 20 | functio|n sorts |
|00003e70| 61 20 73 65 71 75 65 6e | 63 65 20 6f 66 20 6e 75 |a sequen|ce of nu|
|00003e80| 6d 62 65 72 73 20 6f 72 | 20 73 74 72 69 6e 67 73 |mbers or| strings|
|00003e90| 20 69 6e 74 6f 20 61 73 | 63 65 6e 64 69 6e 67 20 | into as|cending |
|00003ea0| 6f 72 64 65 72 0a 20 2a | 20 75 73 69 6e 67 20 74 |order. *| using t|
|00003eb0| 68 65 20 51 75 69 63 6b | 73 6f 72 74 20 61 6c 67 |he Quick|sort alg|
|00003ec0| 6f 72 69 74 68 6d 2e 0a | 20 2a 0a 20 2a 20 45 78 |orithm..| *. * Ex|
|00003ed0| 61 6d 70 6c 65 73 3a 0a | 20 2a 0a 20 2a 20 20 20 |amples:.| *. * |
|00003ee0| 20 20 20 3c 33 20 31 20 | 34 20 31 20 35 20 39 20 | <3 1 |4 1 5 9 |
|00003ef0| 32 3e 20 3a 20 51 75 69 | 63 6b 53 6f 72 74 20 3d |2> : Qui|ckSort =|
|00003f00| 3d 20 3c 31 20 31 20 32 | 20 33 20 34 20 35 20 39 |= <1 1 2| 3 4 5 9|
|00003f10| 3e 0a 20 2a 0a 20 2a 20 | 20 20 20 20 20 3c 61 6c |>. *. * | <al|
|00003f20| 6c 20 77 6f 72 6b 20 61 | 6e 64 20 6e 6f 20 70 6c |l work a|nd no pl|
|00003f30| 61 79 3e 20 3a 20 51 75 | 69 63 6b 53 6f 72 74 20 |ay> : Qu|ickSort |
|00003f40| 3d 3d 20 3c 61 6c 6c 20 | 61 6e 64 20 6e 6f 20 70 |== <all |and no p|
|00003f50| 6c 61 79 20 77 6f 72 6b | 3e 0a 20 2a 0a 20 2a 20 |lay work|>. *. * |
|00003f60| 54 68 65 20 73 65 71 75 | 65 6e 63 65 20 6d 61 79 |The sequ|ence may|
|00003f70| 20 6e 6f 74 20 6d 69 78 | 20 73 74 72 69 6e 67 73 | not mix| strings|
|00003f80| 20 61 6e 64 20 6e 75 6d | 62 65 72 73 2e 0a 20 2a | and num|bers.. *|
|00003f90| 29 0a 0a 44 45 46 20 51 | 75 69 63 6b 53 6f 72 74 |)..DEF Q|uickSort|
|00003fa0| 20 41 53 0a 20 20 20 49 | 46 20 5b 6c 65 6e 67 74 | AS. I|F [lengt|
|00003fb0| 68 2c 23 32 5d 20 7c 20 | 3c 20 54 48 45 4e 20 69 |h,#2] | |< THEN i|
|00003fc0| 64 0a 20 20 20 45 4c 53 | 45 0a 20 20 20 20 20 20 |d. ELS|E. |
|00003fd0| 5b 69 64 2c 31 5d 20 7c | 20 64 69 73 74 72 20 7c |[id,1] || distr ||
|00003fe0| 0a 20 20 20 20 20 20 5b | 20 20 20 20 20 20 0a 20 |. [| . |
|00003ff0| 20 20 20 20 20 20 20 20 | 46 49 4c 54 45 52 20 3c | |FILTER <|
|00004000| 20 45 4e 44 20 7c 20 45 | 41 43 48 20 31 20 45 4e | END | E|ACH 1 EN|
|00004010| 44 20 7c 20 51 75 69 63 | 6b 53 6f 72 74 2c 0a 20 |D | Quic|kSort,. |
|00004020| 20 20 20 20 20 20 20 20 | 46 49 4c 54 45 52 20 3d | |FILTER =|
|00004030| 20 45 4e 44 20 7c 20 45 | 41 43 48 20 31 20 45 4e | END | E|ACH 1 EN|
|00004040| 44 2c 0a 20 20 20 20 20 | 20 20 20 20 46 49 4c 54 |D,. | FILT|
|00004050| 45 52 20 3e 20 45 4e 44 | 20 7c 20 45 41 43 48 20 |ER > END| | EACH |
|00004060| 31 20 45 4e 44 20 7c 20 | 51 75 69 63 6b 53 6f 72 |1 END | |QuickSor|
|00004070| 74 0a 20 20 20 20 20 20 | 5d 20 7c 20 63 61 74 0a |t. |] | cat.|
|00004080| 20 20 20 45 4e 44 3b 0a | 0a 53 48 41 52 5f 45 4f | END;.|.SHAR_EO|
|00004090| 46 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 53 65 |F.if tes|t -f 'Se|
|000040a0| 6c 53 6f 72 74 27 0a 74 | 68 65 6e 0a 09 65 63 68 |lSort'.t|hen..ech|
|000040b0| 6f 20 73 68 61 72 3a 20 | 6f 76 65 72 2d 77 72 69 |o shar: |over-wri|
|000040c0| 74 69 6e 67 20 65 78 69 | 73 74 69 6e 67 20 66 69 |ting exi|sting fi|
|000040d0| 6c 65 20 22 27 53 65 6c | 53 6f 72 74 27 22 0a 66 |le "'Sel|Sort'".f|
|000040e0| 69 0a 63 61 74 20 3c 3c | 20 5c 53 48 41 52 5f 45 |i.cat <<| \SHAR_E|
|000040f0| 4f 46 20 3e 20 27 53 65 | 6c 53 6f 72 74 27 0a 28 |OF > 'Se|lSort'.(|
|00004100| 2a 0a 20 2a 20 53 65 6c | 65 63 74 69 6f 6e 20 73 |*. * Sel|ection s|
|00004110| 6f 72 74 0a 20 2a 0a 20 | 2a 20 45 78 61 6d 70 6c |ort. *. |* Exampl|
|00004120| 65 3a 0a 20 2a 0a 20 2a | 20 20 20 20 20 20 3c 33 |e:. *. *| <3|
|00004130| 20 31 20 34 20 31 20 35 | 20 39 20 32 3e 20 3a 20 | 1 4 1 5| 9 2> : |
|00004140| 53 65 6c 53 6f 72 74 20 | 3d 3d 20 3c 31 20 31 20 |SelSort |== <1 1 |
|00004150| 32 20 33 20 34 20 35 20 | 39 3e 0a 20 2a 0a 20 2a |2 3 4 5 |9>. *. *|
|00004160| 20 54 68 65 20 73 65 71 | 75 65 6e 63 65 20 6d 75 | The seq|uence mu|
|00004170| 73 74 20 62 65 20 6e 75 | 6d 65 72 69 63 2e 0a 20 |st be nu|meric.. |
|00004180| 2a 29 0a 44 45 46 20 53 | 65 6c 53 6f 72 74 20 41 |*).DEF S|elSort A|
|00004190| 53 0a 20 20 20 49 46 20 | 5b 6c 65 6e 67 74 68 2c |S. IF |[length,|
|000041a0| 23 32 5d 20 7c 20 3c 20 | 54 48 45 4e 20 69 64 0a |#2] | < |THEN id.|
|000041b0| 20 20 20 45 4c 53 45 20 | 0a 20 20 20 20 20 20 5b | ELSE |. [|
|000041c0| 49 4e 53 45 52 54 20 6d | 69 6e 20 45 4e 44 2c 69 |INSERT m|in END,i|
|000041d0| 64 5d 20 7c 20 64 69 73 | 74 6c 20 7c 0a 20 20 20 |d] | dis|tl |. |
|000041e0| 20 20 20 5b 0a 20 20 20 | 20 20 20 20 20 20 46 49 | [. | FI|
|000041f0| 4c 54 45 52 20 20 3d 20 | 45 4e 44 20 7c 20 45 41 |LTER = |END | EA|
|00004200| 43 48 20 32 20 45 4e 44 | 2c 0a 20 20 20 20 20 20 |CH 2 END|,. |
|00004210| 20 20 20 46 49 4c 54 45 | 52 20 7e 3d 20 45 4e 44 | FILTE|R ~= END|
|00004220| 20 7c 20 45 41 43 48 20 | 32 20 45 4e 44 20 7c 20 | | EACH |2 END | |
|00004230| 53 65 6c 53 6f 72 74 0a | 20 20 20 20 20 20 5d 20 |SelSort.| ] |
|00004240| 7c 20 63 61 74 0a 20 20 | 20 45 4e 44 3b 0a 0a 53 || cat. | END;..S|
|00004250| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|00004260| 2d 66 20 27 53 6c 6f 77 | 53 6f 72 74 27 0a 74 68 |-f 'Slow|Sort'.th|
|00004270| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 6f |en..echo| shar: o|
|00004280| 76 65 72 2d 77 72 69 74 | 69 6e 67 20 65 78 69 73 |ver-writ|ing exis|
|00004290| 74 69 6e 67 20 66 69 6c | 65 20 22 27 53 6c 6f 77 |ting fil|e "'Slow|
|000042a0| 53 6f 72 74 27 22 0a 66 | 69 0a 63 61 74 20 3c 3c |Sort'".f|i.cat <<|
|000042b0| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 53 6c | \SHAR_E|OF > 'Sl|
|000042c0| 6f 77 53 6f 72 74 27 0a | 28 2a 0a 20 2a 20 53 6c |owSort'.|(*. * Sl|
|000042d0| 6f 77 53 6f 72 74 0a 20 | 2a 0a 20 2a 20 53 6f 72 |owSort. |*. * Sor|
|000042e0| 74 20 61 20 73 65 71 75 | 65 6e 63 65 20 74 68 65 |t a sequ|ence the|
|000042f0| 20 68 61 72 64 20 77 61 | 79 2c 20 69 2e 65 2e 20 | hard wa|y, i.e. |
|00004300| 74 61 6b 65 20 61 6c 6c | 20 70 65 72 6d 75 74 61 |take all| permuta|
|00004310| 74 69 6f 6e 73 0a 20 2a | 20 61 6e 64 20 70 69 63 |tions. *| and pic|
|00004320| 6b 20 6f 6e 65 20 66 6f | 72 20 77 68 69 63 68 20 |k one fo|r which |
|00004330| 61 6c 6c 20 65 6c 65 6d | 65 6e 74 73 20 61 72 65 |all elem|ents are|
|00004340| 20 69 6e 20 6f 72 64 65 | 72 2e 0a 20 2a 29 0a 44 | in orde|r.. *).D|
|00004350| 45 46 20 53 6c 6f 77 53 | 6f 72 74 20 41 53 0a 20 |EF SlowS|ort AS. |
|00004360| 20 20 50 65 72 6d 75 74 | 65 20 7c 20 0a 20 20 20 | Permut|e | . |
|00004370| 46 49 4c 54 45 52 20 0a | 20 20 20 20 20 20 5b 74 |FILTER .| [t|
|00004380| 6c 2c 74 6c 72 5d 7c 74 | 72 61 6e 73 20 7c 20 45 |l,tlr]|t|rans | E|
|00004390| 41 43 48 20 3e 3d 20 45 | 4e 44 20 7c 20 61 6c 6c |ACH >= E|ND | all|
|000043a0| 20 0a 20 20 20 45 4e 44 | 20 7c 20 31 3b 0a 0a 53 | . END| | 1;..S|
|000043b0| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|000043c0| 2d 66 20 27 53 71 75 61 | 72 65 27 0a 74 68 65 6e |-f 'Squa|re'.then|
|000043d0| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 6f 76 65 |..echo s|har: ove|
|000043e0| 72 2d 77 72 69 74 69 6e | 67 20 65 78 69 73 74 69 |r-writin|g existi|
|000043f0| 6e 67 20 66 69 6c 65 20 | 22 27 53 71 75 61 72 65 |ng file |"'Square|
|00004400| 27 22 0a 66 69 0a 63 61 | 74 20 3c 3c 20 5c 53 48 |'".fi.ca|t << \SH|
|00004410| 41 52 5f 45 4f 46 20 3e | 20 27 53 71 75 61 72 65 |AR_EOF >| 'Square|
|00004420| 27 0a 28 2a 20 53 71 75 | 61 72 65 20 61 20 6e 75 |'.(* Squ|are a nu|
|00004430| 6d 62 65 72 20 2d 20 65 | 2e 67 2e 20 33 3a 53 71 |mber - e|.g. 3:Sq|
|00004440| 75 61 72 65 20 2d 3e 20 | 39 20 2a 29 0a 0a 44 45 |uare -> |9 *)..DE|
|00004450| 46 20 53 71 75 61 72 65 | 20 41 53 20 5b 69 64 2c |F Square| AS [id,|
|00004460| 69 64 5d 7c 2a 3b 0a 0a | 53 48 41 52 5f 45 4f 46 |id]|*;..|SHAR_EOF|
|00004470| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 54 61 6e |.if test| -f 'Tan|
|00004480| 67 65 6e 74 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |gent'.th|en..echo|
|00004490| 20 73 68 61 72 3a 20 6f | 76 65 72 2d 77 72 69 74 | shar: o|ver-writ|
|000044a0| 69 6e 67 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ing exis|ting fil|
|000044b0| 65 20 22 27 54 61 6e 67 | 65 6e 74 27 22 0a 66 69 |e "'Tang|ent'".fi|
|000044c0| 0a 63 61 74 20 3c 3c 20 | 5c 53 48 41 52 5f 45 4f |.cat << |\SHAR_EO|
|000044d0| 46 20 3e 20 27 54 61 6e | 67 65 6e 74 27 0a 28 2a |F > 'Tan|gent'.(*|
|000044e0| 20 54 72 69 67 6f 6e 6f | 6d 65 74 72 69 63 20 74 | Trigono|metric t|
|000044f0| 61 6e 67 65 6e 74 20 66 | 75 6e 63 74 69 6f 6e 20 |angent f|unction |
|00004500| 2a 29 0a 0a 44 45 46 20 | 54 61 6e 67 65 6e 74 20 |*)..DEF |Tangent |
|00004510| 41 53 20 5b 73 69 6e 2c | 63 6f 73 5d 7c 25 3b 0a |AS [sin,|cos]|%;.|
|00004520| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|00004530| 20 2d 66 20 27 54 65 78 | 74 27 0a 74 68 65 6e 0a | -f 'Tex|t'.then.|
|00004540| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 6f 76 65 72 |.echo sh|ar: over|
|00004550| 2d 77 72 69 74 69 6e 67 | 20 65 78 69 73 74 69 6e |-writing| existin|
|00004560| 67 20 66 69 6c 65 20 22 | 27 54 65 78 74 27 22 0a |g file "|'Text'".|
|00004570| 66 69 0a 63 61 74 20 3c | 3c 20 5c 53 48 41 52 5f |fi.cat <|< \SHAR_|
|00004580| 45 4f 46 20 3e 20 27 54 | 65 78 74 27 0a 28 2a 0a |EOF > 'T|ext'.(*.|
|00004590| 20 2a 20 54 65 78 74 0a | 20 2a 20 0a 20 2a 20 45 | * Text.| * . * E|
|000045a0| 78 61 6d 70 6c 65 20 70 | 69 65 63 65 20 6f 66 20 |xample p|iece of |
|000045b0| 74 65 78 74 20 66 6f 72 | 20 75 73 65 20 77 69 74 |text for| use wit|
|000045c0| 68 20 50 69 67 4c 61 74 | 69 6e 20 66 75 6e 63 74 |h PigLat|in funct|
|000045d0| 69 6f 6e 2e 0a 20 2a 0a | 20 2a 20 45 78 61 6d 70 |ion.. *.| * Examp|
|000045e0| 6c 65 3a 0a 20 2a 0a 20 | 2a 09 30 20 3a 20 54 65 |le:. *. |*.0 : Te|
|000045f0| 78 74 20 7c 20 50 69 67 | 4c 61 74 69 6e 20 2d 3e |xt | Pig|Latin ->|
|00004600| 20 2e 2e 2e 0a 20 2a 29 | 0a 0a 44 45 46 20 54 65 | .... *)|..DEF Te|
|00004610| 78 74 20 41 53 0a 20 20 | 20 23 3c 41 6c 6c 20 77 |xt AS. | #<All w|
|00004620| 6f 72 6b 20 61 6e 64 20 | 6e 6f 20 70 6c 61 79 20 |ork and |no play |
|00004630| 6d 61 6b 65 73 20 4a 61 | 63 6b 20 61 20 64 75 6c |makes Ja|ck a dul|
|00004640| 6c 20 62 6f 79 3e 3b 0a | 53 48 41 52 5f 45 4f 46 |l boy>;.|SHAR_EOF|
|00004650| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 56 6f 77 |.if test| -f 'Vow|
|00004660| 65 6c 27 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |el'.then|..echo s|
|00004670| 68 61 72 3a 20 6f 76 65 | 72 2d 77 72 69 74 69 6e |har: ove|r-writin|
|00004680| 67 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |g existi|ng file |
|00004690| 22 27 56 6f 77 65 6c 27 | 22 0a 66 69 0a 63 61 74 |"'Vowel'|".fi.cat|
|000046a0| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|000046b0| 27 56 6f 77 65 6c 27 0a | 28 2a 0a 20 2a 20 44 65 |'Vowel'.|(*. * De|
|000046c0| 74 65 72 6d 69 6e 65 20 | 69 66 20 61 20 6c 65 74 |termine |if a let|
|000046d0| 74 65 72 20 69 73 20 61 | 20 76 6f 77 65 6c 2e 0a |ter is a| vowel..|
|000046e0| 20 2a 0a 20 2a 20 45 2e | 67 2e 0a 20 2a 20 20 20 | *. * E.|g.. * |
|000046f0| 20 20 20 41 20 3a 20 56 | 6f 77 65 6c 20 2d 3e 20 | A : V|owel -> |
|00004700| 74 0a 20 2a 20 20 20 20 | 20 20 75 20 3a 20 56 6f |t. * | u : Vo|
|00004710| 77 65 6c 20 2d 3e 20 74 | 0a 20 2a 20 20 20 20 20 |wel -> t|. * |
|00004720| 20 52 20 3a 20 56 6f 77 | 65 6c 20 2d 3e 20 66 0a | R : Vow|el -> f.|
|00004730| 20 2a 0a 20 2a 20 54 68 | 69 73 20 66 75 6e 63 74 | *. * Th|is funct|
|00004740| 69 6f 6e 20 69 73 20 75 | 73 65 64 20 62 79 20 66 |ion is u|sed by f|
|00004750| 75 6e 63 74 69 6f 6e 20 | 50 69 67 4c 61 74 69 6e |unction |PigLatin|
|00004760| 2e 0a 20 2a 29 0a 0a 44 | 45 46 20 56 6f 77 65 6c |.. *)..D|EF Vowel|
|00004770| 20 41 53 20 0a 20 20 20 | 5b 23 3c 61 20 65 20 69 | AS . |[#<a e i|
|00004780| 20 6f 20 75 20 41 20 45 | 20 49 20 4f 20 55 3e 2c | o u A E| I O U>,|
|00004790| 20 69 64 5d 20 7c 20 6d | 65 6d 62 65 72 3b 0a 53 | id] | m|ember;.S|
|000047a0| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|000047b0| 2d 66 20 27 63 6f 74 61 | 6e 27 0a 74 68 65 6e 0a |-f 'cota|n'.then.|
|000047c0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 6f 76 65 72 |.echo sh|ar: over|
|000047d0| 2d 77 72 69 74 69 6e 67 | 20 65 78 69 73 74 69 6e |-writing| existin|
|000047e0| 67 20 66 69 6c 65 20 22 | 27 63 6f 74 61 6e 27 22 |g file "|'cotan'"|
|000047f0| 0a 66 69 0a 63 61 74 20 | 3c 3c 20 5c 53 48 41 52 |.fi.cat |<< \SHAR|
|00004800| 5f 45 4f 46 20 3e 20 27 | 63 6f 74 61 6e 27 0a 28 |_EOF > '|cotan'.(|
|00004810| 2a 0a 20 2a 20 54 72 69 | 67 6f 6e 6d 65 74 72 69 |*. * Tri|gonmetri|
|00004820| 63 20 63 6f 74 61 6e 67 | 65 6e 74 20 66 75 6e 63 |c cotang|ent func|
|00004830| 74 69 6f 6e 0a 20 2a 29 | 0a 0a 44 45 46 20 63 6f |tion. *)|..DEF co|
|00004840| 74 61 6e 20 41 53 20 5b | 63 6f 73 2c 73 69 6e 5d |tan AS [|cos,sin]|
|00004850| 20 7c 20 25 3b 0a 0a 53 | 48 41 52 5f 45 4f 46 0a | | %;..S|HAR_EOF.|
|00004860| 69 66 20 74 65 73 74 20 | 2d 66 20 27 45 75 6c 65 |if test |-f 'Eule|
|00004870| 72 27 0a 74 68 65 6e 0a | 09 65 63 68 6f 20 73 68 |r'.then.|.echo sh|
|00004880| 61 72 3a 20 6f 76 65 72 | 2d 77 72 69 74 69 6e 67 |ar: over|-writing|
|00004890| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 22 | existin|g file "|
|000048a0| 27 45 75 6c 65 72 27 22 | 0a 66 69 0a 63 61 74 20 |'Euler'"|.fi.cat |
|000048b0| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|000048c0| 45 75 6c 65 72 27 0a 28 | 2a 0a 20 2a 20 43 6f 6d |Euler'.(|*. * Com|
|000048d0| 70 75 74 65 20 45 75 6c | 65 72 27 73 20 70 68 69 |pute Eul|er's phi|
|000048e0| 2d 66 75 6e 63 74 69 6f | 6e 2c 20 69 2e 65 2e 20 |-functio|n, i.e. |
|000048f0| 6e 75 6d 62 65 72 20 6f | 66 20 6e 75 6d 62 65 72 |number o|f number|
|00004900| 20 72 65 6c 2e 20 70 72 | 69 6d 65 20 74 6f 20 6e | rel. pr|ime to n|
|00004910| 2e 0a 20 2a 0a 20 2a 20 | 45 2e 67 2e 20 38 3a 45 |.. *. * |E.g. 8:E|
|00004920| 75 6c 65 72 20 2d 3e 20 | 34 20 73 69 6e 63 65 20 |uler -> |4 since |
|00004930| 31 2c 33 2c 35 2c 37 20 | 61 72 65 20 72 65 6c 61 |1,3,5,7 |are rela|
|00004940| 74 69 76 65 6c 79 20 70 | 72 69 6d 65 20 74 6f 20 |tively p|rime to |
|00004950| 38 0a 20 2a 29 0a 44 45 | 46 20 45 75 6c 65 72 20 |8. *).DE|F Euler |
|00004960| 41 53 0a 20 20 20 5b 69 | 64 2c 69 6f 74 61 5d 20 |AS. [i|d,iota] |
|00004970| 7c 20 64 69 73 74 6c 20 | 7c 0a 20 20 20 45 41 43 || distl ||. EAC|
|00004980| 48 20 0a 20 20 20 20 20 | 20 57 48 49 4c 45 20 5b |H . | WHILE [|
|00004990| 32 2c 23 30 5d 7c 3e 20 | 44 4f 20 5b 32 2c 6d 6f |2,#0]|> |DO [2,mo|
|000049a0| 64 5d 20 45 4e 44 20 7c | 0a 20 20 20 20 20 20 49 |d] END ||. I|
|000049b0| 46 20 5b 31 2c 20 23 31 | 5d 7c 3d 20 54 48 45 4e |F [1, #1|]|= THEN|
|000049c0| 20 23 31 20 45 4c 53 45 | 20 23 30 20 45 4e 44 20 | #1 ELSE| #0 END |
|000049d0| 0a 20 20 20 45 4e 44 20 | 7c 20 73 75 6d 3b 0a 0a |. END || sum;..|
|000049e0| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|000049f0| 20 2d 66 20 27 25 44 4f | 43 27 0a 74 68 65 6e 0a | -f '%DO|C'.then.|
|00004a00| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 6f 76 65 72 |.echo sh|ar: over|
|00004a10| 2d 77 72 69 74 69 6e 67 | 20 65 78 69 73 74 69 6e |-writing| existin|
|00004a20| 67 20 66 69 6c 65 20 22 | 27 25 44 4f 43 27 22 0a |g file "|'%DOC'".|
|00004a30| 66 69 0a 63 61 74 20 3c | 3c 20 5c 53 48 41 52 5f |fi.cat <|< \SHAR_|
|00004a40| 45 4f 46 20 3e 20 27 25 | 44 4f 43 27 0a 54 68 69 |EOF > '%|DOC'.Thi|
|00004a50| 73 20 64 69 72 65 63 74 | 6f 72 79 20 63 6f 6e 74 |s direct|ory cont|
|00004a60| 61 69 6e 73 20 64 65 6d | 6f 6e 73 74 72 61 74 69 |ains dem|onstrati|
|00004a70| 6f 6e 20 66 75 6e 63 74 | 69 6f 6e 73 2e 20 20 54 |on funct|ions. T|
|00004a80| 6f 20 75 73 65 20 6f 6e | 65 2c 20 65 6e 74 65 72 |o use on|e, enter|
|00004a90| 20 74 68 65 0a 49 46 50 | 20 63 6f 6d 6d 61 6e 64 | the.IFP| command|
|00004aa0| 0a 0a 20 20 20 20 20 73 | 68 6f 77 20 69 6e 70 75 |.. s|how inpu|
|00004ab0| 74 20 3a 20 66 75 6e 63 | 74 69 6f 6e 20 3b 0a 0a |t : func|tion ;..|
|00004ac0| 77 68 65 72 65 20 69 6e | 70 75 74 20 69 73 20 61 |where in|put is a|
|00004ad0| 6e 20 61 70 70 72 6f 70 | 72 69 61 74 65 20 6f 62 |n approp|riate ob|
|00004ae0| 6a 65 63 74 20 61 6e 64 | 20 66 75 6e 63 74 69 6f |ject and| functio|
|00004af0| 6e 20 69 73 20 6f 6e 65 | 20 6f 66 20 74 68 65 20 |n is one| of the |
|00004b00| 66 75 6e 63 74 69 6f 6e | 73 20 62 65 6c 6f 77 3a |function|s below:|
|00004b10| 0a 0a 20 20 20 20 20 41 | 62 73 20 2d 20 61 62 73 |.. A|bs - abs|
|00004b20| 6f 6c 75 74 65 20 76 61 | 6c 75 65 20 6f 66 20 61 |olute va|lue of a|
|00004b30| 20 6e 75 6d 62 65 72 0a | 20 20 20 20 20 63 6f 74 | number.| cot|
|00004b40| 61 6e 20 2d 20 66 69 6e | 64 20 74 72 69 67 6f 6e |an - fin|d trigon|
|00004b50| 6f 6d 65 74 72 69 63 20 | 63 6f 74 61 6e 67 65 6e |ometric |cotangen|
|00004b60| 74 20 6f 66 20 61 6e 67 | 6c 65 20 65 78 70 72 65 |t of ang|le expre|
|00004b70| 73 73 65 64 20 69 6e 20 | 72 61 64 69 61 6e 73 0a |ssed in |radians.|
|00004b80| 20 20 20 20 20 44 65 62 | 75 67 20 2d 20 76 65 72 | Deb|ug - ver|
|00004b90| 73 69 6f 6e 20 6f 66 20 | 46 69 62 20 77 69 74 68 |sion of |Fib with|
|00004ba0| 20 64 65 62 75 67 67 69 | 6e 67 20 6d 65 73 73 61 | debuggi|ng messa|
|00004bb0| 67 65 73 0a 20 20 20 20 | 20 44 6f 75 62 6c 65 20 |ges. | Double |
|00004bc0| 2d 20 64 6f 75 62 6c 65 | 20 61 20 6e 75 6d 62 65 |- double| a numbe|
|00004bd0| 72 0a 20 20 20 20 20 45 | 75 6c 65 72 20 2d 20 45 |r. E|uler - E|
|00004be0| 75 6c 65 72 20 74 6f 74 | 69 65 6e 74 20 28 70 68 |uler tot|ient (ph|
|00004bf0| 69 29 20 66 75 6e 63 74 | 69 6f 6e 0a 20 20 20 20 |i) funct|ion. |
|00004c00| 20 46 69 62 20 2d 20 66 | 69 6e 64 20 66 69 72 73 | Fib - f|ind firs|
|00004c10| 74 20 6e 20 66 69 62 6f | 6e 61 63 63 69 20 6e 75 |t n fibo|nacci nu|
|00004c20| 6d 62 65 72 73 0a 20 20 | 20 20 20 49 6e 6e 65 72 |mbers. | Inner|
|00004c30| 20 2d 20 66 69 6e 64 20 | 69 6e 6e 65 72 20 70 72 | - find |inner pr|
|00004c40| 6f 64 75 63 74 20 6f 66 | 20 74 77 6f 20 76 65 63 |oduct of| two vec|
|00004c50| 74 6f 72 73 0a 20 20 20 | 20 20 49 6e 74 65 72 20 |tors. | Inter |
|00004c60| 2d 20 73 65 74 20 69 6e | 74 65 72 73 65 63 74 69 |- set in|tersecti|
|00004c70| 6f 6e 0a 20 20 20 20 20 | 4d 65 6d 62 65 72 20 2d |on. |Member -|
|00004c80| 20 73 65 74 20 6d 65 6d | 62 65 72 73 68 69 70 0a | set mem|bership.|
|00004c90| 20 20 20 20 20 50 69 67 | 4c 61 74 69 6e 20 2d 20 | Pig|Latin - |
|00004ca0| 63 6f 6e 76 65 72 74 73 | 20 73 65 71 75 65 6e 63 |converts| sequenc|
|00004cb0| 65 20 6f 66 20 77 6f 72 | 64 73 20 74 6f 20 50 69 |e of wor|ds to Pi|
|00004cc0| 67 20 4c 61 74 69 6e 0a | 20 20 20 20 20 50 61 73 |g Latin.| Pas|
|00004cd0| 54 72 69 20 2d 20 66 69 | 6e 64 20 66 69 72 73 74 |Tri - fi|nd first|
|00004ce0| 20 6e 20 72 6f 77 73 20 | 6f 66 20 50 61 73 63 61 | n rows |of Pasca|
|00004cf0| 6c 27 73 20 74 72 69 61 | 6e 67 6c 65 0a 20 20 20 |l's tria|ngle. |
|00004d00| 20 20 51 75 69 63 6b 53 | 6f 72 74 20 2d 20 73 6f | QuickS|ort - so|
|00004d10| 72 74 20 61 20 73 65 71 | 75 65 6e 63 65 20 6f 66 |rt a seq|uence of|
|00004d20| 20 6e 75 6d 62 65 72 73 | 20 6f 72 20 73 65 71 75 | numbers| or sequ|
|00004d30| 65 6e 63 65 20 6f 66 20 | 73 74 72 69 6e 67 73 0a |ence of |strings.|
|00004d40| 20 20 20 20 20 53 71 75 | 61 72 65 20 2d 20 73 71 | Squ|are - sq|
|00004d50| 75 61 72 65 20 61 20 6e | 75 6d 62 65 72 0a 20 20 |uare a n|umber. |
|00004d60| 20 20 20 56 6f 77 65 6c | 20 2d 20 64 65 74 65 72 | Vowel| - deter|
|00004d70| 6d 69 6e 65 20 69 66 20 | 61 20 73 74 72 69 6e 67 |mine if |a string|
|00004d80| 20 69 73 20 61 20 76 6f | 77 65 6c 20 20 20 20 20 | is a vo|wel |
|00004d90| 0a 0a 41 6c 6c 20 49 46 | 50 20 70 72 69 6d 69 74 |..All IF|P primit|
|00004da0| 69 76 65 73 20 61 72 65 | 20 69 6d 70 6f 72 74 65 |ives are| importe|
|00004db0| 64 20 69 6e 74 6f 20 74 | 68 69 73 20 64 69 72 65 |d into t|his dire|
|00004dc0| 63 74 6f 72 79 20 61 6c | 73 6f 2c 20 73 6f 20 79 |ctory al|so, so y|
|00004dd0| 6f 75 20 63 61 6e 0a 65 | 78 70 65 72 69 6d 65 6e |ou can.e|xperimen|
|00004de0| 74 20 77 69 74 68 20 74 | 68 65 6d 2e 20 20 4c 6f |t with t|hem. Lo|
|00004df0| 6f 6b 20 69 6e 20 25 49 | 4d 50 4f 52 54 20 66 6f |ok in %I|MPORT fo|
|00004e00| 72 20 74 68 65 69 72 20 | 6e 61 6d 65 73 2e 20 20 |r their |names. |
|00004e10| 54 68 65 20 66 75 6e 63 | 74 69 6f 6e 73 0a 61 72 |The func|tions.ar|
|00004e20| 65 20 64 65 74 61 69 6c | 65 64 20 69 6e 20 74 68 |e detail|ed in th|
|00004e30| 65 20 66 69 6c 65 20 5c | 49 46 50 2e 54 58 54 0a |e file \|IFP.TXT.|
|00004e40| 0a 53 48 41 52 5f 45 4f | 46 0a 63 64 20 2e 2e 0a |.SHAR_EO|F.cd ...|
|00004e50| 69 66 20 74 65 73 74 20 | 21 20 2d 64 20 27 6d 61 |if test |! -d 'ma|
|00004e60| 74 68 27 0a 74 68 65 6e | 0a 09 6d 6b 64 69 72 20 |th'.then|..mkdir |
|00004e70| 27 6d 61 74 68 27 0a 66 | 69 0a 63 64 20 27 6d 61 |'math'.f|i.cd 'ma|
|00004e80| 74 68 27 0a 69 66 20 74 | 65 73 74 20 21 20 2d 64 |th'.if t|est ! -d|
|00004e90| 20 27 61 72 69 74 68 27 | 0a 74 68 65 6e 0a 09 6d | 'arith'|.then..m|
|00004ea0| 6b 64 69 72 20 27 61 72 | 69 74 68 27 0a 66 69 0a |kdir 'ar|ith'.fi.|
|00004eb0| 63 64 20 27 61 72 69 74 | 68 27 0a 69 66 20 74 65 |cd 'arit|h'.if te|
|00004ec0| 73 74 20 2d 66 20 27 70 | 72 6f 64 27 0a 74 68 65 |st -f 'p|rod'.the|
|00004ed0| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 6f 76 |n..echo |shar: ov|
|00004ee0| 65 72 2d 77 72 69 74 69 | 6e 67 20 65 78 69 73 74 |er-writi|ng exist|
|00004ef0| 69 6e 67 20 66 69 6c 65 | 20 22 27 70 72 6f 64 27 |ing file| "'prod'|
|00004f00| 22 0a 66 69 0a 63 61 74 | 20 3c 3c 20 5c 53 48 41 |".fi.cat| << \SHA|
|00004f10| 52 5f 45 4f 46 20 3e 20 | 27 70 72 6f 64 27 0a 28 |R_EOF > |'prod'.(|
|00004f20| 2a 0a 20 2a 20 70 72 6f | 64 0a 20 2a 0a 20 2a 20 |*. * pro|d. *. * |
|00004f30| 43 6f 6d 70 75 74 65 20 | 70 72 6f 64 75 63 74 20 |Compute |product |
|00004f40| 6f 66 20 73 65 71 75 65 | 6e 63 65 2e 0a 20 2a 0a |of seque|nce.. *.|
|00004f50| 20 2a 20 45 2e 67 2e 20 | 3c 31 30 20 32 20 33 20 | * E.g. |<10 2 3 |
|00004f60| 34 3e 20 3a 20 70 72 6f | 64 20 2d 3e 20 32 34 30 |4> : pro|d -> 240|
|00004f70| 0a 20 2a 29 0a 0a 44 45 | 46 20 70 72 6f 64 20 41 |. *)..DE|F prod A|
|00004f80| 53 0a 20 20 20 49 46 20 | 2e 2e 2f 6c 6f 67 69 63 |S. IF |../logic|
|00004f90| 2f 6e 75 6c 6c 20 54 48 | 45 4e 20 23 31 0a 20 20 |/null TH|EN #1. |
|00004fa0| 20 45 4c 53 45 0a 20 20 | 20 20 20 20 49 4e 53 45 | ELSE. | INSE|
|00004fb0| 52 54 20 2a 20 45 4e 44 | 0a 20 20 20 45 4e 44 3b |RT * END|. END;|
|00004fc0| 0a 53 48 41 52 5f 45 4f | 46 0a 63 64 20 2e 2e 0a |.SHAR_EO|F.cd ...|
|00004fd0| 69 66 20 74 65 73 74 20 | 21 20 2d 64 20 27 6c 69 |if test |! -d 'li|
|00004fe0| 6e 65 61 72 27 0a 74 68 | 65 6e 0a 09 6d 6b 64 69 |near'.th|en..mkdi|
|00004ff0| 72 20 27 6c 69 6e 65 61 | 72 27 0a 66 69 0a 63 64 |r 'linea|r'.fi.cd|
|00005000| 20 27 6c 69 6e 65 61 72 | 27 0a 69 66 20 74 65 73 | 'linear|'.if tes|
|00005010| 74 20 2d 66 20 27 25 49 | 4d 50 4f 52 54 27 0a 74 |t -f '%I|MPORT'.t|
|00005020| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|00005030| 6f 76 65 72 2d 77 72 69 | 74 69 6e 67 20 65 78 69 |over-wri|ting exi|
|00005040| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 25 49 4d |sting fi|le "'%IM|
|00005050| 50 4f 52 54 27 22 0a 66 | 69 0a 63 61 74 20 3c 3c |PORT'".f|i.cat <<|
|00005060| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 25 49 | \SHAR_E|OF > '%I|
|00005070| 4d 50 4f 52 54 27 0a 46 | 52 4f 4d 20 2f 73 79 73 |MPORT'.F|ROM /sys|
|00005080| 20 49 4d 50 4f 52 54 0a | 20 20 20 61 70 6e 64 6c | IMPORT.| apndl|
|00005090| 2c 61 70 6e 64 72 2c 63 | 61 74 2c 64 69 73 74 72 |,apndr,c|at,distr|
|000050a0| 2c 64 69 73 74 6c 2c 69 | 64 2c 69 6f 74 61 2c 6c |,distl,i|d,iota,l|
|000050b0| 65 6e 67 74 68 2c 74 6c | 2c 74 72 61 6e 73 3b 0a |ength,tl|,trans;.|
|000050c0| 0a 46 52 4f 4d 20 2f 6d | 61 74 68 2f 61 72 69 74 |.FROM /m|ath/arit|
|000050d0| 68 20 49 4d 50 4f 52 54 | 0a 20 20 20 2b 2c 2d 2c |h IMPORT|. +,-,|
|000050e0| 2a 2c 25 2c 65 78 70 2c | 6c 6e 2c 73 75 6d 3b 0a |*,%,exp,|ln,sum;.|
|000050f0| 0a 46 52 4f 4d 20 2f 6d | 61 74 68 2f 6c 6f 67 69 |.FROM /m|ath/logi|
|00005100| 63 20 49 4d 50 4f 52 54 | 20 3d 2c 6e 75 6c 6c 3b |c IMPORT| =,null;|
|00005110| 0a 53 48 41 52 5f 45 4f | 46 0a 69 66 20 74 65 73 |.SHAR_EO|F.if tes|
|00005120| 74 20 2d 66 20 27 41 27 | 0a 74 68 65 6e 0a 09 65 |t -f 'A'|.then..e|
|00005130| 63 68 6f 20 73 68 61 72 | 3a 20 6f 76 65 72 2d 77 |cho shar|: over-w|
|00005140| 72 69 74 69 6e 67 20 65 | 78 69 73 74 69 6e 67 20 |riting e|xisting |
|00005150| 66 69 6c 65 20 22 27 41 | 27 22 0a 66 69 0a 63 61 |file "'A|'".fi.ca|
|00005160| 74 20 3c 3c 20 5c 53 48 | 41 52 5f 45 4f 46 20 3e |t << \SH|AR_EOF >|
|00005170| 20 27 41 27 0a 28 2a 20 | 54 65 73 74 20 63 61 73 | 'A'.(* |Test cas|
|00005180| 65 20 67 65 6e 65 72 61 | 74 6f 72 20 66 6f 72 20 |e genera|tor for |
|00005190| 4c 20 61 6e 64 20 55 20 | 2d 20 63 68 65 63 6b 20 |L and U |- check |
|000051a0| 62 79 20 74 72 79 69 6e | 67 20 41 20 7c 20 5b 4c |by tryin|g A | [L|
|000051b0| 2c 55 5d 20 7c 20 4d 61 | 74 4d 75 6c 20 2a 29 0a |,U] | Ma|tMul *).|
|000051c0| 0a 44 45 46 20 41 20 41 | 53 0a 20 20 20 23 3c 0a |.DEF A A|S. #<.|
|000051d0| 20 20 20 20 20 20 20 3c | 20 32 2e 33 20 20 34 2e | <| 2.3 4.|
|000051e0| 37 20 2d 32 2e 37 20 20 | 35 2e 37 20 20 37 2e 34 |7 -2.7 |5.7 7.4|
|000051f0| 20 32 2e 31 20 31 32 2e | 37 20 20 31 2e 31 20 33 | 2.1 12.|7 1.1 3|
|00005200| 32 2e 31 20 20 34 2e 35 | 20 20 31 2e 31 20 20 38 |2.1 4.5| 1.1 8|
|00005210| 2e 33 3e 0a 20 20 20 20 | 20 20 20 3c 20 31 2e 37 |.3>. | < 1.7|
|00005220| 20 2d 31 2e 37 20 20 35 | 2e 32 20 20 33 2e 32 20 | -1.7 5|.2 3.2 |
|00005230| 20 31 2e 32 20 33 2e 35 | 20 20 32 2e 34 20 20 32 | 1.2 3.5| 2.4 2|
|00005240| 2e 39 20 20 31 2e 39 20 | 20 31 2e 37 20 2d 34 2e |.9 1.9 | 1.7 -4.|
|00005250| 35 20 2d 39 2e 39 3e 0a | 20 20 20 20 20 20 20 3c |5 -9.9>.| <|
|00005260| 20 36 2e 31 20 20 33 2e | 34 20 20 31 2e 32 20 31 | 6.1 3.|4 1.2 1|
|00005270| 30 2e 36 20 20 32 2e 39 | 20 31 2e 37 20 20 31 2e |0.6 2.9| 1.7 1.|
|00005280| 31 20 2d 30 2e 33 20 20 | 31 2e 32 20 20 33 2e 32 |1 -0.3 |1.2 3.2|
|00005290| 20 20 31 2e 36 20 20 31 | 2e 33 3e 0a 20 20 20 20 | 1.6 1|.3>. |
|000052a0| 20 20 20 3c 32 33 2e 33 | 20 2d 39 2e 37 20 20 32 | <23.3| -9.7 2|
|000052b0| 2e 34 20 20 35 2e 32 20 | 20 37 2e 36 20 31 2e 31 |.4 5.2 | 7.6 1.1|
|000052c0| 20 38 36 2e 32 20 20 31 | 2e 37 20 20 33 2e 32 20 | 86.2 1|.7 3.2 |
|000052d0| 20 39 2e 37 20 20 31 2e | 32 20 38 37 2e 31 3e 0a | 9.7 1.|2 87.1>.|
|000052e0| 20 20 20 20 20 20 20 3c | 20 31 2e 32 20 20 33 2e | <| 1.2 3.|
|000052f0| 34 20 20 34 2e 35 20 20 | 36 2e 37 20 20 39 2e 38 |4 4.5 |6.7 9.8|
|00005300| 20 30 2e 31 20 20 32 2e | 31 20 20 35 2e 37 20 2d | 0.1 2.|1 5.7 -|
|00005310| 39 2e 31 20 2d 35 2e 32 | 20 20 30 2e 32 20 20 31 |9.1 -5.2| 0.2 1|
|00005320| 2e 37 3e 0a 20 20 20 20 | 20 20 20 3c 31 32 2e 33 |.7>. | <12.3|
|00005330| 20 20 31 2e 32 20 20 38 | 2e 37 20 31 32 2e 33 20 | 1.2 8|.7 12.3 |
|00005340| 2d 34 2e 37 20 2d 2e 31 | 20 20 33 2e 32 20 20 32 |-4.7 -.1| 3.2 2|
|00005350| 2e 31 20 20 34 2e 33 20 | 20 31 2e 38 20 20 31 2e |.1 4.3 | 1.8 1.|
|00005360| 39 20 20 32 2e 33 3e 0a | 20 20 20 20 20 20 20 3c |9 2.3>.| <|
|00005370| 20 35 2e 37 20 20 34 2e | 37 20 2d 32 2e 38 20 20 | 5.7 4.|7 -2.8 |
|00005380| 35 2e 37 20 20 37 2e 34 | 20 32 2e 31 20 31 32 2e |5.7 7.4| 2.1 12.|
|00005390| 37 20 20 31 2e 31 20 33 | 32 2e 31 20 20 34 2e 35 |7 1.1 3|2.1 4.5|
|000053a0| 20 20 31 2e 31 20 20 38 | 2e 33 3e 0a 20 20 20 20 | 1.1 8|.3>. |
|000053b0| 20 20 20 3c 20 31 2e 37 | 20 2d 36 2e 37 20 20 35 | < 1.7| -6.7 5|
|000053c0| 2e 36 20 20 37 2e 34 20 | 20 31 2e 32 20 33 2e 35 |.6 7.4 | 1.2 3.5|
|000053d0| 20 20 32 2e 37 20 20 32 | 2e 38 20 20 31 2e 39 20 | 2.7 2|.8 1.9 |
|000053e0| 20 31 2e 37 20 2d 34 2e | 35 20 2d 39 2e 39 3e 0a | 1.7 -4.|5 -9.9>.|
|000053f0| 20 20 20 20 20 20 20 3c | 20 33 2e 31 20 2d 33 2e | <| 3.1 -3.|
|00005400| 34 20 2d 39 2e 32 20 31 | 30 2e 36 20 20 38 2e 39 |4 -9.2 1|0.6 8.9|
|00005410| 20 31 2e 37 20 2d 31 2e | 31 20 2d 30 2e 33 20 20 | 1.7 -1.|1 -0.3 |
|00005420| 33 2e 32 20 20 33 2e 32 | 20 20 31 2e 36 20 20 31 |3.2 3.2| 1.6 1|
|00005430| 2e 33 3e 0a 20 20 20 20 | 20 20 20 3c 31 33 2e 33 |.3>. | <13.3|
|00005440| 20 2d 39 2e 37 20 20 35 | 2e 32 20 20 37 2e 36 20 | -9.7 5|.2 7.6 |
|00005450| 31 2e 31 20 38 36 2e 32 | 20 20 31 2e 33 20 20 33 |1.1 86.2| 1.3 3|
|00005460| 2e 32 20 20 39 2e 37 20 | 20 31 2e 32 20 38 37 2e |.2 9.7 | 1.2 87.|
|00005470| 31 20 2d 39 2e 32 3e 0a | 20 20 20 20 20 20 20 3c |1 -9.2>.| <|
|00005480| 20 31 2e 32 20 20 33 2e | 34 20 2d 34 2e 35 20 2d | 1.2 3.|4 -4.5 -|
|00005490| 36 2e 37 20 20 39 2e 38 | 20 30 2e 31 20 2d 32 2e |6.7 9.8| 0.1 -2.|
|000054a0| 31 20 20 35 2e 38 20 2d | 39 2e 31 20 2d 35 2e 32 |1 5.8 -|9.1 -5.2|
|000054b0| 20 20 30 2e 32 20 20 31 | 2e 37 3e 0a 20 20 20 20 | 0.2 1|.7>. |
|000054c0| 20 20 20 3c 31 32 2e 33 | 20 20 31 2e 32 20 2d 38 | <12.3| 1.2 -8|
|000054d0| 2e 37 20 31 32 2e 33 20 | 2d 34 2e 37 20 2d 2e 31 |.7 12.3 |-4.7 -.1|
|000054e0| 20 2d 33 2e 32 20 20 31 | 2e 38 20 20 31 2e 39 20 | -3.2 1|.8 1.9 |
|000054f0| 20 32 2e 33 20 20 33 2e | 31 20 20 34 2e 33 3e 20 | 2.3 3.|1 4.3> |
|00005500| 0a 20 20 20 3e 3b 0a 0a | 53 48 41 52 5f 45 4f 46 |. >;..|SHAR_EOF|
|00005510| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 41 69 6b |.if test| -f 'Aik|
|00005520| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|00005530| 72 3a 20 6f 76 65 72 2d | 77 72 69 74 69 6e 67 20 |r: over-|writing |
|00005540| 65 78 69 73 74 69 6e 67 | 20 66 69 6c 65 20 22 27 |existing| file "'|
|00005550| 41 69 6b 27 22 0a 66 69 | 0a 63 61 74 20 3c 3c 20 |Aik'".fi|.cat << |
|00005560| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 41 69 6b |\SHAR_EO|F > 'Aik|
|00005570| 27 0a 28 2a 20 54 61 69 | 6c 20 6f 66 20 6d 61 74 |'.(* Tai|l of mat|
|00005580| 72 69 78 20 61 66 74 65 | 72 20 67 61 75 73 73 69 |rix afte|r gaussi|
|00005590| 61 6e 20 65 6c 69 6d 69 | 6e 61 74 69 6f 6e 20 6f |an elimi|nation o|
|000055a0| 6e 20 28 31 7c 31 29 20 | 2a 29 0a 0a 44 45 46 20 |n (1|1) |*)..DEF |
|000055b0| 41 69 6b 20 41 53 20 0a | 20 20 20 5b 0a 20 20 20 |Aik AS .| [. |
|000055c0| 20 20 20 4d 61 74 54 61 | 69 6c 2c 20 0a 20 20 20 | MatTa|il, . |
|000055d0| 20 20 20 5b 4c 69 31 7c | 74 6c 2c 55 31 6b 7c 74 | [Li1||tl,U1k|t|
|000055e0| 6c 5d 20 7c 20 4f 75 74 | 65 72 0a 20 20 20 5d 20 |l] | Out|er. ] |
|000055f0| 7c 20 4d 61 74 53 75 62 | 3b 0a 0a 53 48 41 52 5f || MatSub|;..SHAR_|
|00005600| 45 4f 46 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |EOF.if t|est -f '|
|00005610| 41 70 6e 64 6c 43 6f 6c | 27 0a 74 68 65 6e 0a 09 |ApndlCol|'.then..|
|00005620| 65 63 68 6f 20 73 68 61 | 72 3a 20 6f 76 65 72 2d |echo sha|r: over-|
|00005630| 77 72 69 74 69 6e 67 20 | 65 78 69 73 74 69 6e 67 |writing |existing|
|00005640| 20 66 69 6c 65 20 22 27 | 41 70 6e 64 6c 43 6f 6c | file "'|ApndlCol|
|00005650| 27 22 0a 66 69 0a 63 61 | 74 20 3c 3c 20 5c 53 48 |'".fi.ca|t << \SH|
|00005660| 41 52 5f 45 4f 46 20 3e | 20 27 41 70 6e 64 6c 43 |AR_EOF >| 'ApndlC|
|00005670| 6f 6c 27 0a 28 2a 20 41 | 70 70 65 6e 64 20 63 6f |ol'.(* A|ppend co|
|00005680| 6c 75 6d 6e 20 28 31 29 | 20 74 6f 20 6c 65 66 74 |lumn (1)| to left|
|00005690| 20 73 69 64 65 20 6f 66 | 20 6d 61 74 72 69 78 20 | side of| matrix |
|000056a0| 28 32 29 20 2a 29 0a 0a | 44 45 46 20 41 70 6e 64 |(2) *)..|DEF Apnd|
|000056b0| 6c 43 6f 6c 20 41 53 20 | 5b 31 2c 32 7c 74 72 61 |lCol AS |[1,2|tra|
|000056c0| 6e 73 5d 20 7c 20 61 70 | 6e 64 6c 20 7c 20 74 72 |ns] | ap|ndl | tr|
|000056d0| 61 6e 73 3b 0a 0a 53 48 | 41 52 5f 45 4f 46 0a 69 |ans;..SH|AR_EOF.i|
|000056e0| 66 20 74 65 73 74 20 2d | 66 20 27 41 70 6e 64 72 |f test -|f 'Apndr|
|000056f0| 43 6f 6c 27 0a 74 68 65 | 6e 0a 09 65 63 68 6f 20 |Col'.the|n..echo |
|00005700| 73 68 61 72 3a 20 6f 76 | 65 72 2d 77 72 69 74 69 |shar: ov|er-writi|
|00005710| 6e 67 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |ng exist|ing file|
|00005720| 20 22 27 41 70 6e 64 72 | 43 6f 6c 27 22 0a 66 69 | "'Apndr|Col'".fi|
|00005730| 0a 63 61 74 20 3c 3c 20 | 5c 53 48 41 52 5f 45 4f |.cat << |\SHAR_EO|
|00005740| 46 20 3e 20 27 41 70 6e | 64 72 43 6f 6c 27 0a 28 |F > 'Apn|drCol'.(|
|00005750| 2a 20 41 70 70 65 6e 64 | 20 63 6f 6c 75 6d 6e 20 |* Append| column |
|00005760| 28 32 29 20 74 6f 20 72 | 69 67 68 74 20 73 69 64 |(2) to r|ight sid|
|00005770| 65 20 6f 66 20 6d 61 74 | 72 69 78 20 28 31 29 20 |e of mat|rix (1) |
|00005780| 2a 29 0a 44 45 46 20 41 | 70 6e 64 72 43 6f 6c 20 |*).DEF A|pndrCol |
|00005790| 5b 31 7c 74 72 61 6e 73 | 2c 32 5d 20 7c 20 61 70 |[1|trans|,2] | ap|
|000057a0| 6e 64 72 20 7c 20 74 72 | 61 6e 73 3b 0a 0a 53 48 |ndr | tr|ans;..SH|
|000057b0| 41 52 5f 45 4f 46 0a 69 | 66 20 74 65 73 74 20 2d |AR_EOF.i|f test -|
|000057c0| 66 20 27 4d 61 74 54 61 | 69 6c 27 0a 74 68 65 6e |f 'MatTa|il'.then|
|000057d0| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 6f 76 65 |..echo s|har: ove|
|000057e0| 72 2d 77 72 69 74 69 6e | 67 20 65 78 69 73 74 69 |r-writin|g existi|
|000057f0| 6e 67 20 66 69 6c 65 20 | 22 27 4d 61 74 54 61 69 |ng file |"'MatTai|
|00005800| 6c 27 22 0a 66 69 0a 63 | 61 74 20 3c 3c 20 5c 53 |l'".fi.c|at << \S|
|00005810| 48 41 52 5f 45 4f 46 20 | 3e 20 27 4d 61 74 54 61 |HAR_EOF |> 'MatTa|
|00005820| 69 6c 27 0a 28 2a 20 44 | 65 6c 65 74 65 73 20 66 |il'.(* D|eletes f|
|00005830| 69 72 73 74 20 72 6f 77 | 20 61 6e 64 20 63 6f 6c |irst row| and col|
|00005840| 75 6d 6e 20 6f 66 20 6d | 61 74 72 69 78 20 2a 29 |umn of m|atrix *)|
|00005850| 0a 44 45 46 20 4d 61 74 | 54 61 69 6c 20 41 53 20 |.DEF Mat|Tail AS |
|00005860| 74 6c 20 7c 20 45 41 43 | 48 20 74 6c 20 45 4e 44 |tl | EAC|H tl END|
|00005870| 3b 0a 0a 53 48 41 52 5f | 45 4f 46 0a 69 66 20 74 |;..SHAR_|EOF.if t|
|00005880| 65 73 74 20 2d 66 20 27 | 4f 75 74 65 72 27 0a 74 |est -f '|Outer'.t|
|00005890| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|000058a0| 6f 76 65 72 2d 77 72 69 | 74 69 6e 67 20 65 78 69 |over-wri|ting exi|
|000058b0| 73 74 69 6e 67 20 66 69 | 6c 65 20 22 27 4f 75 74 |sting fi|le "'Out|
|000058c0| 65 72 27 22 0a 66 69 0a | 63 61 74 20 3c 3c 20 5c |er'".fi.|cat << \|
|000058d0| 53 48 41 52 5f 45 4f 46 | 20 3e 20 27 4f 75 74 65 |SHAR_EOF| > 'Oute|
|000058e0| 72 27 0a 28 2a 20 4f 75 | 74 65 72 20 70 72 6f 64 |r'.(* Ou|ter prod|
|000058f0| 75 63 74 20 6f 66 20 74 | 77 6f 20 76 65 63 74 6f |uct of t|wo vecto|
|00005900| 72 73 20 2a 29 0a 44 45 | 46 20 4f 75 74 65 72 20 |rs *).DE|F Outer |
|00005910| 41 53 20 43 61 72 74 20 | 7c 20 45 41 43 48 20 45 |AS Cart || EACH E|
|00005920| 41 43 48 20 2a 20 45 4e | 44 20 45 4e 44 3b 0a 0a |ACH * EN|D END;..|
|00005930| 53 48 41 52 5f 45 4f 46 | 0a 69 66 20 74 65 73 74 |SHAR_EOF|.if test|
|00005940| 20 2d 66 20 27 25 44 4f | 43 27 0a 74 68 65 6e 0a | -f '%DO|C'.then.|
|00005950| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 6f 76 65 72 |.echo sh|ar: over|
|00005960| 2d 77 72 69 74 69 6e 67 | 20 65 78 69 73 74 69 6e |-writing| existin|
|00005970| 67 20 66 69 6c 65 20 22 | 27 25 44 4f 43 27 22 0a |g file "|'%DOC'".|
|00005980| 66 69 0a 63 61 74 20 3c | 3c 20 5c 53 48 41 52 5f |fi.cat <|< \SHAR_|
|00005990| 45 4f 46 20 3e 20 27 25 | 44 4f 43 27 0a 54 68 69 |EOF > '%|DOC'.Thi|
|000059a0| 73 20 64 69 72 65 63 74 | 6f 72 79 20 63 6f 6e 74 |s direct|ory cont|
|000059b0| 61 69 6e 73 20 66 75 6e | 63 74 69 6f 6e 73 20 66 |ains fun|ctions f|
|000059c0| 6f 72 20 6c 69 6e 65 61 | 72 20 6d 61 74 72 69 78 |or linea|r matrix|
|000059d0| 20 6d 61 6e 69 70 75 6c | 61 74 69 6f 6e 2e 0a 49 | manipul|ation..I|
|000059e0| 6e 20 70 61 72 74 69 63 | 75 6c 61 72 2c 20 69 74 |n partic|ular, it|
|000059f0| 20 63 6f 6e 74 61 69 6e | 73 20 4c 20 61 6e 64 20 | contain|s L and |
|00005a00| 55 2c 20 77 68 69 63 68 | 20 74 61 6b 65 20 74 68 |U, which| take th|
|00005a10| 65 20 6c 6f 77 65 72 20 | 61 6e 64 20 75 70 70 65 |e lower |and uppe|
|00005a20| 72 20 0a 70 61 72 74 73 | 20 6f 66 20 74 68 65 20 |r .parts| of the |
|00005a30| 4c 55 20 64 65 63 6f 6d | 70 6f 73 69 74 69 6f 6e |LU decom|position|
|00005a40| 20 6f 66 20 61 20 6d 61 | 74 72 69 78 2e 0a 53 48 | of a ma|trix..SH|
|00005a50| 41 52 5f 45 4f 46 0a 69 | 66 20 74 65 73 74 20 2d |AR_EOF.i|f test -|
|00005a60| 66 20 27 53 69 6e 67 6c | 65 74 6f 6e 27 0a 74 68 |f 'Singl|eton'.th|
|00005a70| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 6f |en..echo| shar: o|
|00005a80| 76 65 72 2d 77 72 69 74 | 69 6e 67 20 65 78 69 73 |ver-writ|ing exis|
|00005a90| 74 69 6e 67 20 66 69 6c | 65 20 22 27 53 69 6e 67 |ting fil|e "'Sing|
|00005aa0| 6c 65 74 6f 6e 27 22 0a | 66 69 0a 63 61 74 20 3c |leton'".|fi.cat <|
|00005ab0| 3c 20 5c 53 48 41 52 5f | 45 4f 46 20 3e 20 27 53 |< \SHAR_|EOF > 'S|
|00005ac0| 69 6e 67 6c 65 74 6f 6e | 27 0a 28 2a 20 43 68 65 |ingleton|'.(* Che|
|00005ad0| 63 6b 20 69 66 20 6d 61 | 74 72 69 78 20 69 73 20 |ck if ma|trix is |
|00005ae0| 61 20 73 69 6e 67 6c 65 | 74 6f 6e 20 2a 29 0a 0a |a single|ton *)..|
|00005af0| 44 45 46 20 53 69 6e 67 | 6c 65 74 6f 6e 20 41 53 |DEF Sing|leton AS|
|00005b00| 20 5b 6c 65 6e 67 74 68 | 2c 23 31 5d 7c 3d 3b 0a | [length|,#1]|=;.|
|00005b10| 0a 53 48 41 52 5f 45 4f | 46 0a 69 66 20 74 65 73 |.SHAR_EO|F.if tes|
|00005b20| 74 20 2d 66 20 27 55 27 | 0a 74 68 65 6e 0a 09 65 |t -f 'U'|.then..e|
|00005b30| 63 68 6f 20 73 68 61 72 | 3a 20 6f 76 65 72 2d 77 |cho shar|: over-w|
|00005b40| 72 69 74 69 6e 67 20 65 | 78 69 73 74 69 6e 67 20 |riting e|xisting |
|00005b50| 66 69 6c 65 20 22 27 55 | 27 22 0a 66 69 0a 63 61 |file "'U|'".fi.ca|
|00005b60| 74 20 3c 3c 20 5c 53 48 | 41 52 5f 45 4f 46 20 3e |t << \SH|AR_EOF >|
|00005b70| 20 27 55 27 0a 28 2a 20 | 55 20 70 61 72 74 20 6f | 'U'.(* |U part o|
|00005b80| 66 20 4c 55 20 64 65 63 | 6f 6d 70 6f 73 69 74 69 |f LU dec|ompositi|
|00005b90| 6f 6e 20 6f 66 20 6d 61 | 74 72 69 78 20 2a 29 0a |on of ma|trix *).|
|00005ba0| 0a 44 45 46 20 55 20 41 | 53 0a 20 20 20 49 46 20 |.DEF U A|S. IF |
|00005bb0| 53 69 6e 67 6c 65 74 6f | 6e 20 54 48 45 4e 20 69 |Singleto|n THEN i|
|00005bc0| 64 0a 20 20 20 45 4c 53 | 45 0a 20 20 20 20 20 20 |d. ELS|E. |
|00005bd0| 5b 0a 20 20 20 20 20 20 | 20 20 20 55 31 6b 2c 0a |[. | U1k,.|
|00005be0| 09 20 41 69 6b 20 7c 20 | 5b 45 41 43 48 20 23 30 |. Aik | |[EACH #0|
|00005bf0| 20 45 4e 44 2c 55 5d 20 | 7c 20 41 70 6e 64 6c 43 | END,U] || ApndlC|
|00005c00| 6f 6c 0a 20 20 20 20 20 | 20 5d 20 7c 20 61 70 6e |ol. | ] | apn|
|00005c10| 64 6c 0a 20 20 20 45 4e | 44 3b 0a 0a 53 48 41 52 |dl. EN|D;..SHAR|
|00005c20| 5f 45 4f 46 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |_EOF.if |test -f |
|00005c30| 27 55 31 6b 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |'U1k'.th|en..echo|
|00005c40| 20 73 68 61 72 3a 20 6f | 76 65 72 2d 77 72 69 74 | shar: o|ver-writ|
|00005c50| 69 6e 67 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ing exis|ting fil|
|00005c60| 65 20 22 27 55 31 6b 27 | 22 0a 66 69 0a 63 61 74 |e "'U1k'|".fi.cat|
|00005c70| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00005c80| 27 55 31 6b 27 0a 28 2a | 20 46 69 72 73 74 20 72 |'U1k'.(*| First r|
|00005c90| 6f 77 20 6f 66 20 55 20 | 70 61 72 74 20 2a 29 0a |ow of U |part *).|
|00005ca0| 44 45 46 20 55 31 6b 20 | 41 53 20 31 3b 0a 0a 53 |DEF U1k |AS 1;..S|
|00005cb0| 48 41 52 5f 45 4f 46 0a | 69 66 20 74 65 73 74 20 |HAR_EOF.|if test |
|00005cc0| 2d 66 20 27 43 61 72 74 | 27 0a 74 68 65 6e 0a 09 |-f 'Cart|'.then..|
|00005cd0| 65 63 68 6f 20 73 68 61 | 72 3a 20 6f 76 65 72 2d |echo sha|r: over-|
|00005ce0| 77 72 69 74 69 6e 67 20 | 65 78 69 73 74 69 6e 67 |writing |existing|
|00005cf0| 20 66 69 6c 65 20 22 27 | 43 61 72 74 27 22 0a 66 | file "'|Cart'".f|
|00005d00| 69 0a 63 61 74 20 3c 3c | 20 5c 53 48 41 52 5f 45 |i.cat <<| \SHAR_E|
|00005d10| 4f 46 20 3e 20 27 43 61 | 72 74 27 0a 28 2a 20 43 |OF > 'Ca|rt'.(* C|
|00005d20| 61 72 74 65 73 69 61 6e | 20 70 72 6f 64 75 63 74 |artesian| product|
|00005d30| 20 6f 66 20 74 77 6f 20 | 76 65 63 74 6f 72 73 20 | of two |vectors |
|00005d40| 2a 29 0a 44 45 46 20 43 | 61 72 74 20 41 53 20 64 |*).DEF C|art AS d|
|00005d50| 69 73 74 72 20 7c 20 45 | 41 43 48 20 64 69 73 74 |istr | E|ACH dist|
|00005d60| 6c 20 45 4e 44 3b 0a 0a | 53 48 41 52 5f 45 4f 46 |l END;..|SHAR_EOF|
|00005d70| 0a 69 66 20 74 65 73 74 | 20 2d 66 20 27 49 6e 6e |.if test| -f 'Inn|
|00005d80| 65 72 27 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |er'.then|..echo s|
|00005d90| 68 61 72 3a 20 6f 76 65 | 72 2d 77 72 69 74 69 6e |har: ove|r-writin|
|00005da0| 67 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |g existi|ng file |
|00005db0| 22 27 49 6e 6e 65 72 27 | 22 0a 66 69 0a 63 61 74 |"'Inner'|".fi.cat|
|00005dc0| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00005dd0| 27 49 6e 6e 65 72 27 0a | 28 2a 20 49 6e 6e 65 72 |'Inner'.|(* Inner|
|00005de0| 20 70 72 6f 64 75 63 74 | 20 2a 29 0a 0a 44 45 46 | product| *)..DEF|
|00005df0| 20 49 6e 6e 65 72 20 41 | 53 20 0a 20 20 20 74 72 | Inner A|S . tr|
|00005e00| 61 6e 73 20 7c 20 45 41 | 43 48 20 2a 20 45 4e 44 |ans | EA|CH * END|
|00005e10| 20 7c 20 0a 20 20 20 49 | 46 20 6e 75 6c 6c 20 54 | | . I|F null T|
|00005e20| 48 45 4e 20 23 30 20 0a | 20 20 20 45 4c 53 45 20 |HEN #0 .| ELSE |
|00005e30| 49 4e 53 45 52 54 20 2b | 20 45 4e 44 20 0a 20 20 |INSERT +| END . |
|00005e40| 20 45 4e 44 3b 0a 53 48 | 41 52 5f 45 4f 46 0a 69 | END;.SH|AR_EOF.i|
|00005e50| 66 20 74 65 73 74 20 2d | 66 20 27 4c 27 0a 74 68 |f test -|f 'L'.th|
|00005e60| 65 6e 0a 09 65 63 68 6f | 20 73 68 61 72 3a 20 6f |en..echo| shar: o|
|00005e70| 76 65 72 2d 77 72 69 74 | 69 6e 67 20 65 78 69 73 |ver-writ|ing exis|
|00005e80| 74 69 6e 67 20 66 69 6c | 65 20 22 27 4c 27 22 0a |ting fil|e "'L'".|
|00005e90| 66 69 0a 63 61 74 20 3c | 3c 20 5c 53 48 41 52 5f |fi.cat <|< \SHAR_|
|00005ea0| 45 4f 46 20 3e 20 27 4c | 27 0a 28 2a 20 4c 20 70 |EOF > 'L|'.(* L p|
|00005eb0| 61 72 74 20 6f 66 20 4c | 55 20 64 65 63 6f 6d 70 |art of L|U decomp|
|00005ec0| 6f 73 69 74 69 6f 6e 20 | 6f 66 20 6d 61 74 72 69 |osition |of matri|
|00005ed0| 78 20 2a 29 0a 44 45 46 | 20 4c 20 41 53 0a 20 20 |x *).DEF| L AS. |
|00005ee0| 20 49 46 20 53 69 6e 67 | 6c 65 74 6f 6e 20 54 48 | IF Sing|leton TH|
|00005ef0| 45 4e 20 23 3c 3c 31 2e | 30 3e 3e 0a 20 20 20 45 |EN #<<1.|0>>. E|
|00005f00| 4c 53 45 20 0a 20 20 20 | 20 20 20 5b 0a 20 20 20 |LSE . | [. |
|00005f10| 20 20 20 20 20 20 4c 69 | 31 2c 0a 09 20 41 69 6b | Li|1,.. Aik|
|00005f20| 20 7c 20 5b 45 41 43 48 | 20 23 30 20 45 4e 44 2c | | [EACH| #0 END,|
|00005f30| 4c 5d 20 7c 20 61 70 6e | 64 6c 0a 20 20 20 20 20 |L] | apn|dl. |
|00005f40| 20 5d 20 7c 20 41 70 6e | 64 6c 43 6f 6c 0a 20 20 | ] | Apn|dlCol. |
|00005f50| 20 45 4e 44 3b 0a 0a 53 | 48 41 52 5f 45 4f 46 0a | END;..S|HAR_EOF.|
|00005f60| 69 66 20 74 65 73 74 20 | 2d 66 20 27 4c 55 27 0a |if test |-f 'LU'.|
|00005f70| 74 68 65 6e 0a 09 65 63 | 68 6f 20 73 68 61 72 3a |then..ec|ho shar:|
|00005f80| 20 6f 76 65 72 2d 77 72 | 69 74 69 6e 67 20 65 78 | over-wr|iting ex|
|00005f90| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 22 27 4c 55 |isting f|ile "'LU|
|00005fa0| 27 22 0a 66 69 0a 63 61 | 74 20 3c 3c 20 5c 53 48 |'".fi.ca|t << \SH|
|00005fb0| 41 52 5f 45 4f 46 20 3e | 20 27 4c 55 27 0a 28 2a |AR_EOF >| 'LU'.(*|
|00005fc0| 20 0a 20 2a 20 4c 55 0a | 20 2a 0a 20 2a 20 5b 4c | . * LU.| *. * [L|
|00005fd0| 2c 55 5d 20 64 65 63 6f | 6d 70 6f 73 69 74 69 6f |,U] deco|mpositio|
|00005fe0| 6e 20 6f 66 20 6d 61 74 | 72 69 78 20 77 72 69 74 |n of mat|rix writ|
|00005ff0| 74 65 6e 20 61 73 20 73 | 69 6e 67 6c 65 20 66 75 |ten as s|ingle fu|
|00006000| 6e 63 74 69 6f 6e 2e 0a | 20 2a 20 54 68 69 73 20 |nction..| * This |
|00006010| 66 75 6e 63 74 69 6f 6e | 20 69 73 20 66 75 6e 63 |function| is func|
|00006020| 74 69 6f 6e 61 6c 6c 79 | 20 69 64 65 6e 74 69 63 |tionally| identic|
|00006030| 61 6c 20 74 6f 20 5b 4c | 2c 55 5d 0a 20 2a 29 0a |al to [L|,U]. *).|
|00006040| 0a 44 45 46 20 4c 55 20 | 41 53 0a 20 20 20 49 46 |.DEF LU |AS. IF|
|00006050| 20 53 69 6e 67 6c 65 74 | 6f 6e 20 54 48 45 4e 20 | Singlet|on THEN |
|00006060| 5b 23 3c 3c 31 2e 30 3e | 3e 2c 69 64 5d 20 20 20 |[#<<1.0>|>,id] |
|00006070| 20 20 20 20 20 28 2a 20 | 64 65 66 69 6e 69 74 69 | (* |definiti|
|00006080| 6f 6e 20 6f 66 20 4c 20 | 2a 29 0a 20 20 20 45 4c |on of L |*). EL|
|00006090| 53 45 20 0a 20 20 20 20 | 20 20 5b 0a 20 20 20 20 |SE . | [. |
|000060a0| 20 20 20 20 20 4c 69 31 | 2c 0a 20 20 20 20 20 20 | Li1|,. |
|000060b0| 20 20 20 41 69 6b 20 7c | 20 5b 45 41 43 48 20 23 | Aik || [EACH #|
|000060c0| 30 20 45 4e 44 2c 4c 55 | 5d 2c 0a 09 20 55 31 6b |0 END,LU|],.. U1k|
|000060d0| 0a 20 20 20 20 20 20 5d | 20 7c 20 0a 20 20 20 20 |. ]| | . |
|000060e0| 20 20 5b 0a 09 20 5b 0a | 09 20 20 20 20 31 2c 0a | [.. [.|. 1,.|
|000060f0| 09 20 20 20 20 32 20 7c | 20 5b 31 2c 32 7c 31 5d |. 2 || [1,2|1]|
|00006100| 20 7c 20 61 70 6e 64 6c | 0a 09 20 5d 20 7c 20 41 | | apndl|.. ] | A|
|00006110| 70 6e 64 6c 43 6f 6c 2c | 0a 09 20 5b 0a 09 20 20 |pndlCol,|.. [.. |
|00006120| 20 20 33 2c 0a 09 20 20 | 20 20 32 20 7c 20 5b 31 | 3,.. | 2 | [1|
|00006130| 2c 32 7c 32 5d 20 7c 20 | 41 70 6e 64 6c 43 6f 6c |,2|2] | |ApndlCol|
|00006140| 0a 09 20 5d 20 7c 20 61 | 70 6e 64 6c 0a 20 20 20 |.. ] | a|pndl. |
|00006150| 20 20 20 5d 0a 20 20 20 | 45 4e 44 3b 0a 53 48 41 | ]. |END;.SHA|
|00006160| 52 5f 45 4f 46 0a 69 66 | 20 74 65 73 74 20 2d 66 |R_EOF.if| test -f|
|00006170| 20 27 4c 69 31 27 0a 74 | 68 65 6e 0a 09 65 63 68 | 'Li1'.t|hen..ech|
|00006180| 6f 20 73 68 61 72 3a 20 | 6f 76 65 72 2d 77 72 69 |o shar: |over-wri|
|00006190| 74 69 6e 67 20 65 78 69 | 73 74 69 6e 67 20 66 69 |ting exi|sting fi|
|000061a0| 6c 65 20 22 27 4c 69 31 | 27 22 0a 66 69 0a 63 61 |le "'Li1|'".fi.ca|
|000061b0| 74 20 3c 3c 20 5c 53 48 | 41 52 5f 45 4f 46 20 3e |t << \SH|AR_EOF >|
|000061c0| 20 27 4c 69 31 27 0a 28 | 2a 20 46 69 72 73 74 20 | 'Li1'.(|* First |
|000061d0| 63 6f 6c 75 6d 6e 20 6f | 66 20 4c 20 70 61 72 74 |column o|f L part|
|000061e0| 20 2a 29 0a 44 45 46 20 | 4c 69 31 20 41 53 20 5b | *).DEF |Li1 AS [|
|000061f0| 45 41 43 48 20 31 20 45 | 4e 44 2c 31 7c 31 5d 20 |EACH 1 E|ND,1|1] |
|00006200| 7c 20 64 69 73 74 72 20 | 7c 20 45 41 43 48 20 25 || distr || EACH %|
|00006210| 20 45 4e 44 3b 0a 0a 53 | 48 41 52 5f 45 4f 46 0a | END;..S|HAR_EOF.|
|00006220| 69 66 20 74 65 73 74 20 | 2d 66 20 27 4d 61 74 41 |if test |-f 'MatA|
|00006230| 64 64 27 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |dd'.then|..echo s|
|00006240| 68 61 72 3a 20 6f 76 65 | 72 2d 77 72 69 74 69 6e |har: ove|r-writin|
|00006250| 67 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |g existi|ng file |
|00006260| 22 27 4d 61 74 41 64 64 | 27 22 0a 66 69 0a 63 61 |"'MatAdd|'".fi.ca|
|00006270| 74 20 3c 3c 20 5c 53 48 | 41 52 5f 45 4f 46 20 3e |t << \SH|AR_EOF >|
|00006280| 20 27 4d 61 74 41 64 64 | 27 0a 28 2a 20 4d 61 74 | 'MatAdd|'.(* Mat|
|00006290| 72 69 78 20 61 64 64 69 | 74 69 6f 6e 20 2a 29 0a |rix addi|tion *).|
|000062a0| 44 45 46 20 4d 61 74 41 | 64 64 20 41 53 20 4d 61 |DEF MatA|dd AS Ma|
|000062b0| 74 43 61 74 20 7c 20 45 | 41 43 48 20 45 41 43 48 |tCat | E|ACH EACH|
|000062c0| 20 2b 20 45 4e 44 20 45 | 4e 44 3b 0a 0a 53 48 41 | + END E|ND;..SHA|
|000062d0| 52 5f 45 4f 46 0a 69 66 | 20 74 65 73 74 20 2d 66 |R_EOF.if| test -f|
|000062e0| 20 27 4d 61 74 43 61 74 | 27 0a 74 68 65 6e 0a 09 | 'MatCat|'.then..|
|000062f0| 65 63 68 6f 20 73 68 61 | 72 3a 20 6f 76 65 72 2d |echo sha|r: over-|
|00006300| 77 72 69 74 69 6e 67 20 | 65 78 69 73 74 69 6e 67 |writing |existing|
|00006310| 20 66 69 6c 65 20 22 27 | 4d 61 74 43 61 74 27 22 | file "'|MatCat'"|
|00006320| 0a 66 69 0a 63 61 74 20 | 3c 3c 20 5c 53 48 41 52 |.fi.cat |<< \SHAR|
|00006330| 5f 45 4f 46 20 3e 20 27 | 4d 61 74 43 61 74 27 0a |_EOF > '|MatCat'.|
|00006340| 28 2a 20 43 6f 6e 76 65 | 72 74 73 20 70 61 69 72 |(* Conve|rts pair|
|00006350| 20 6f 66 20 6d 61 74 72 | 69 63 65 73 20 74 6f 20 | of matr|ices to |
|00006360| 6d 61 74 72 69 78 20 6f | 66 20 70 61 69 72 73 20 |matrix o|f pairs |
|00006370| 2a 29 0a 0a 44 45 46 20 | 4d 61 74 43 61 74 20 41 |*)..DEF |MatCat A|
|00006380| 53 20 74 72 61 6e 73 20 | 7c 20 45 41 43 48 20 74 |S trans || EACH t|
|00006390| 72 61 6e 73 20 45 4e 44 | 3b 0a 0a 53 48 41 52 5f |rans END|;..SHAR_|
|000063a0| 45 4f 46 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |EOF.if t|est -f '|
|000063b0| 4d 61 74 4d 75 6c 27 0a | 74 68 65 6e 0a 09 65 63 |MatMul'.|then..ec|
|000063c0| 68 6f 20 73 68 61 72 3a | 20 6f 76 65 72 2d 77 72 |ho shar:| over-wr|
|000063d0| 69 74 69 6e 67 20 65 78 | 69 73 74 69 6e 67 20 66 |iting ex|isting f|
|000063e0| 69 6c 65 20 22 27 4d 61 | 74 4d 75 6c 27 22 0a 66 |ile "'Ma|tMul'".f|
|000063f0| 69 0a 63 61 74 20 3c 3c | 20 5c 53 48 41 52 5f 45 |i.cat <<| \SHAR_E|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.