chemruby 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. data/README +120 -0
  2. data/Rakefile +195 -0
  3. data/ext/extconf.rb +4 -0
  4. data/ext/subcomp.c +416 -0
  5. data/lib/chem.rb +130 -0
  6. data/lib/chem/appl.rb +1 -0
  7. data/lib/chem/appl/chem3dole.rb +36 -0
  8. data/lib/chem/appl/tinker/nucleic.rb +40 -0
  9. data/lib/chem/appl/tinker/tinker_reader.rb +43 -0
  10. data/lib/chem/data.rb +4 -0
  11. data/lib/chem/data/atomic_weight.rb +124 -0
  12. data/lib/chem/data/character.rb +2 -0
  13. data/lib/chem/data/electronegativity.rb +14 -0
  14. data/lib/chem/data/periodic_table.rb +6 -0
  15. data/lib/chem/data/prime_numbers.rb +1 -0
  16. data/lib/chem/data/vdw_radii.rb +1 -0
  17. data/lib/chem/db.rb +64 -0
  18. data/lib/chem/db/cansmi.rb +234 -0
  19. data/lib/chem/db/cdx.rb +1525 -0
  20. data/lib/chem/db/eps.rb +164 -0
  21. data/lib/chem/db/g98.rb +909 -0
  22. data/lib/chem/db/gspan.rb +130 -0
  23. data/lib/chem/db/iupac.rb +5 -0
  24. data/lib/chem/db/iupac/a_1.rb +46 -0
  25. data/lib/chem/db/iupac/iuparser.rb +226 -0
  26. data/lib/chem/db/iupac/iuparser.ry +97 -0
  27. data/lib/chem/db/iupac/postfix.rb +2 -0
  28. data/lib/chem/db/kcf.rb +390 -0
  29. data/lib/chem/db/kcf_glycan.rb +19 -0
  30. data/lib/chem/db/kegg.rb +516 -0
  31. data/lib/chem/db/linucs/linparser.rb +144 -0
  32. data/lib/chem/db/linucs/linucs.ry +53 -0
  33. data/lib/chem/db/mdl.rb +379 -0
  34. data/lib/chem/db/molconnz.rb +12 -0
  35. data/lib/chem/db/mopac.rb +88 -0
  36. data/lib/chem/db/msi.rb +107 -0
  37. data/lib/chem/db/pdb_dic.rb +115 -0
  38. data/lib/chem/db/pdf.rb +131 -0
  39. data/lib/chem/db/pubchem.rb +113 -0
  40. data/lib/chem/db/rmagick.rb +70 -0
  41. data/lib/chem/db/sdf.rb +37 -0
  42. data/lib/chem/db/smbl.rb +88 -0
  43. data/lib/chem/db/smiles.rb +2 -0
  44. data/lib/chem/db/smiles/smiles.ry +203 -0
  45. data/lib/chem/db/smiles/smiparser.rb +375 -0
  46. data/lib/chem/db/swf.rb +74 -0
  47. data/lib/chem/db/sybyl.rb +150 -0
  48. data/lib/chem/db/tinker.rb +77 -0
  49. data/lib/chem/db/types/type_cansmi.rb +9 -0
  50. data/lib/chem/db/types/type_cdx.rb +24 -0
  51. data/lib/chem/db/types/type_gspan.rb +31 -0
  52. data/lib/chem/db/types/type_kcf.rb +28 -0
  53. data/lib/chem/db/types/type_kcf_glycan.rb +26 -0
  54. data/lib/chem/db/types/type_kegg.rb +92 -0
  55. data/lib/chem/db/types/type_mdl.rb +31 -0
  56. data/lib/chem/db/types/type_pdf.rb +33 -0
  57. data/lib/chem/db/types/type_png.rb +31 -0
  58. data/lib/chem/db/types/type_rxn.rb +25 -0
  59. data/lib/chem/db/types/type_sdf.rb +25 -0
  60. data/lib/chem/db/types/type_sybyl.rb +30 -0
  61. data/lib/chem/db/types/type_xyz.rb +26 -0
  62. data/lib/chem/db/vector.rb +128 -0
  63. data/lib/chem/db/xyz.rb +39 -0
  64. data/lib/chem/model.rb +119 -0
  65. data/lib/chem/model/skeleton.rb +37 -0
  66. data/lib/chem/utils.rb +11 -0
  67. data/lib/chem/utils/geometry.rb +27 -0
  68. data/lib/chem/utils/graph_db.rb +146 -0
  69. data/lib/chem/utils/math.rb +17 -0
  70. data/lib/chem/utils/prop.rb +123 -0
  71. data/lib/chem/utils/sssr.rb +101 -0
  72. data/lib/chem/utils/sub.rb +78 -0
  73. data/lib/chem/utils/transform.rb +110 -0
  74. data/lib/chem/utils/traverse.rb +37 -0
  75. data/lib/chem/utils/ullmann.rb +134 -0
  76. data/lib/graph.rb +41 -0
  77. data/lib/graph/cluster.rb +20 -0
  78. data/lib/graph/morgan.rb +38 -0
  79. data/sample/frequent_subgraph.rb +46 -0
  80. data/sample/images/ex1.rb +11 -0
  81. data/sample/images/ex2.rb +4 -0
  82. data/sample/images/ex3.rb +5 -0
  83. data/sample/images/ex4.rb +17 -0
  84. data/sample/images/ex5.rb +10 -0
  85. data/sample/images/mol/adenine.mol +26 -0
  86. data/sample/images/mol/atp.mol +69 -0
  87. data/sample/images/temp/ex5.mol +344 -0
  88. data/sample/kegg_db.rb +116 -0
  89. data/setup.rb +1551 -0
  90. data/test/all.rb +6 -0
  91. data/test/coord_test.rb +17 -0
  92. data/test/ctab_test.rb +31 -0
  93. data/test/data/A_21.tar.gz +0 -0
  94. data/test/data/A_21/aceanthrylene.cdx +0 -0
  95. data/test/data/A_21/aceanthrylene.mol +40 -0
  96. data/test/data/A_21/acenaphthylene.cdx +0 -0
  97. data/test/data/A_21/acenaphthylene.mol +31 -0
  98. data/test/data/A_21/acephenanthrylene.cdx +0 -0
  99. data/test/data/A_21/acephenanthrylene.mol +40 -0
  100. data/test/data/A_21/anthracene.cdx +0 -0
  101. data/test/data/A_21/anthracene.mol +35 -0
  102. data/test/data/A_21/as-indacene.cdx +0 -0
  103. data/test/data/A_21/as-indacene.mol +31 -0
  104. data/test/data/A_21/azulene.cdx +0 -0
  105. data/test/data/A_21/azulene.mol +26 -0
  106. data/test/data/A_21/biphenylene.cdx +0 -0
  107. data/test/data/A_21/biphenylene.mol +31 -0
  108. data/test/data/A_21/chrysene.cdx +0 -0
  109. data/test/data/A_21/chrysene.mol +44 -0
  110. data/test/data/A_21/coronen.cdx +0 -0
  111. data/test/data/A_21/coronen.mol +59 -0
  112. data/test/data/A_21/fluoranthene.cdx +0 -0
  113. data/test/data/A_21/fluoranthene.mol +40 -0
  114. data/test/data/A_21/fluorene.cdx +0 -0
  115. data/test/data/A_21/fluorene.mol +33 -0
  116. data/test/data/A_21/heptacene.cdx +0 -0
  117. data/test/data/A_21/heptacene.mol +71 -0
  118. data/test/data/A_21/heptalene.cdx +0 -0
  119. data/test/data/A_21/heptalene.mol +30 -0
  120. data/test/data/A_21/heptaphene.cdx +0 -0
  121. data/test/data/A_21/heptaphene.mol +71 -0
  122. data/test/data/A_21/hexacene.cdx +0 -0
  123. data/test/data/A_21/hexacene.mol +62 -0
  124. data/test/data/A_21/hexaphene.cdx +0 -0
  125. data/test/data/A_21/hexaphene.mol +62 -0
  126. data/test/data/A_21/indene.cdx +0 -0
  127. data/test/data/A_21/indene.mol +24 -0
  128. data/test/data/A_21/iupac.txt +41 -0
  129. data/test/data/A_21/naphthacene.cdx +0 -0
  130. data/test/data/A_21/naphthacene.mol +44 -0
  131. data/test/data/A_21/naphthalene.cdx +0 -0
  132. data/test/data/A_21/naphthalene.mol +26 -0
  133. data/test/data/A_21/ovalene.cdx +0 -0
  134. data/test/data/A_21/ovalene.mol +78 -0
  135. data/test/data/A_21/pentacene.cdx +0 -0
  136. data/test/data/A_21/pentacene.mol +53 -0
  137. data/test/data/A_21/pentalene.cdx +0 -0
  138. data/test/data/A_21/pentalene.mol +22 -0
  139. data/test/data/A_21/pentaphene.cdx +0 -0
  140. data/test/data/A_21/pentaphene.mol +53 -0
  141. data/test/data/A_21/perylene.cdx +0 -0
  142. data/test/data/A_21/perylene.mol +49 -0
  143. data/test/data/A_21/phenalene.cdx +0 -0
  144. data/test/data/A_21/phenalene.mol +33 -0
  145. data/test/data/A_21/phenanthrene.cdx +0 -0
  146. data/test/data/A_21/phenanthrene.mol +35 -0
  147. data/test/data/A_21/picene.cdx +0 -0
  148. data/test/data/A_21/picene.mol +53 -0
  149. data/test/data/A_21/pleiadene.cdx +0 -0
  150. data/test/data/A_21/pleiadene.mol +44 -0
  151. data/test/data/A_21/pyranthrene.cdx +0 -0
  152. data/test/data/A_21/pyranthrene.mol +72 -0
  153. data/test/data/A_21/pyrene.cdx +0 -0
  154. data/test/data/A_21/pyrene.mol +40 -0
  155. data/test/data/A_21/rubicene.cdx +0 -0
  156. data/test/data/A_21/rubicene.mol +63 -0
  157. data/test/data/A_21/s-indacene.cdx +0 -0
  158. data/test/data/A_21/s-indacene.mol +31 -0
  159. data/test/data/A_21/tetraphenylene.cdx +0 -0
  160. data/test/data/A_21/tetraphenylene.mol +57 -0
  161. data/test/data/A_21/trinaphthylene.cdx +0 -0
  162. data/test/data/A_21/trinaphthylene.mol +71 -0
  163. data/test/data/A_21/triphenylene.cdx +0 -0
  164. data/test/data/A_21/triphenylene.mol +44 -0
  165. data/test/data/C00147.kcf +25 -0
  166. data/test/data/G00147.kcf +13 -0
  167. data/test/data/atp.mol +69 -0
  168. data/test/data/cyclohexane.mol +17 -0
  169. data/test/data/cyclohexane.ps +485 -0
  170. data/test/data/fullerene.mol +155 -0
  171. data/test/data/glycan +33 -0
  172. data/test/data/hypericin.cdx +0 -0
  173. data/test/data/hypericin.cdxml +596 -0
  174. data/test/data/hypericin.chm +0 -0
  175. data/test/data/hypericin.ct +85 -0
  176. data/test/data/hypericin.f1d +0 -0
  177. data/test/data/hypericin.f1q +0 -0
  178. data/test/data/hypericin.gif +0 -0
  179. data/test/data/hypericin.mol +88 -0
  180. data/test/data/hypericin.mol2 +159 -0
  181. data/test/data/hypericin.msm +123 -0
  182. data/test/data/hypericin.pdf +359 -0
  183. data/test/data/hypericin.png +0 -0
  184. data/test/data/hypericin.ps +0 -0
  185. data/test/data/hypericin.skc +0 -0
  186. data/test/data/hypericin2.gif +0 -0
  187. data/test/data/hypericin2.ps +0 -0
  188. data/test/data/kegg/genomes/hsa/hsa_enzyme.list +4 -0
  189. data/test/data/kegg/genomes/hsa/hsa_pfam.list +4 -0
  190. data/test/data/kegg/ligand/mol/C00147.mol +26 -0
  191. data/test/data/kegg/ligand/reaction +14 -0
  192. data/test/data/kegg/ligand/reaction.lst +1 -0
  193. data/test/data/kegg/ligand/reaction_mapformula.lst +3 -0
  194. data/test/data/reaction +14 -0
  195. data/test/data/reaction.lst +1 -0
  196. data/test/data/reaction_mapformula.lst +3 -0
  197. data/test/data/rxn/C00001.mol +6 -0
  198. data/test/data/rxn/C00011.mol +10 -0
  199. data/test/data/rxn/C00014.mol +6 -0
  200. data/test/data/rxn/C01010.mol +18 -0
  201. data/test/data/rxn/sample.rxn +50 -0
  202. data/test/data/rxn/substitution.rxn +45 -0
  203. data/test/data/test.eps +0 -0
  204. data/test/data/test.mol +28 -0
  205. data/test/data/test.sdf +143 -0
  206. data/test/data/test.skc +0 -0
  207. data/test/data/test.xyz +4 -0
  208. data/test/data/test_lf.sdf +143 -0
  209. data/test/heavy_test_pubchem.rb +16 -0
  210. data/test/multiple_test.rb +22 -0
  211. data/test/test_adj.rb +54 -0
  212. data/test/test_canonical_smiles.rb +46 -0
  213. data/test/test_cdx.rb +32 -0
  214. data/test/test_chem.rb +18 -0
  215. data/test/test_cluster.rb +19 -0
  216. data/test/test_db.rb +11 -0
  217. data/test/test_eps.rb +24 -0
  218. data/test/test_geometry.rb +11 -0
  219. data/test/test_gspan.rb +28 -0
  220. data/test/test_iupac.rb +36 -0
  221. data/test/test_kcf.rb +24 -0
  222. data/test/test_kcf_glycan.rb +10 -0
  223. data/test/test_kegg.rb +118 -0
  224. data/test/test_linucs.rb +21 -0
  225. data/test/test_mdl.rb +45 -0
  226. data/test/test_mol2.rb +62 -0
  227. data/test/test_morgan.rb +21 -0
  228. data/test/test_pdf.rb +12 -0
  229. data/test/test_prop.rb +86 -0
  230. data/test/test_rmagick.rb +15 -0
  231. data/test/test_sbdb.rb +23 -0
  232. data/test/test_sdf.rb +30 -0
  233. data/test/test_smiles.rb +84 -0
  234. data/test/test_sssr.rb +18 -0
  235. data/test/test_sub.rb +47 -0
  236. data/test/test_subcomp.rb +37 -0
  237. data/test/test_traverse.rb +29 -0
  238. data/test/test_writer.rb +13 -0
  239. data/test/test_xyz.rb +15 -0
  240. data/test/type_test.rb +25 -0
  241. metadata +290 -0
@@ -0,0 +1,17 @@
1
+ cyclohexane.mol
2
+ ChemDraw06210509332D
3
+
4
+ 6 6 0 0 0 0 0 0 0 0999 V2000
5
+ -0.7145 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
6
+ -0.7145 -0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
7
+ 0.0000 -0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
8
+ 0.7145 -0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
9
+ 0.7145 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
10
+ 0.0000 0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
11
+ 1 2 1 0
12
+ 2 3 1 0
13
+ 3 4 1 0
14
+ 4 5 1 0
15
+ 5 6 1 0
16
+ 6 1 1 0
17
+ M END
@@ -0,0 +1,485 @@
1
+ %!PS-Adobe-3.0 EPSF-3.0
2
+ %%Creator: GNU libplot drawing library 4.1
3
+ %%Title: PostScript plot
4
+ %%CreationDate: Wed Jul 13 14:31:46 2005
5
+ %%DocumentData: Clean7Bit
6
+ %%LanguageLevel: 1
7
+ %%Pages: 1
8
+ %%PageOrder: Ascend
9
+ %%Orientation: Portrait
10
+ %%BoundingBox: -3 84 39 132
11
+ %%DocumentNeededResources:
12
+ %%DocumentSuppliedResources: procset GNU_libplot 1.0 0
13
+ %%EndComments
14
+
15
+ %%BeginDefaults
16
+ %%PageResources:
17
+ %%EndDefaults
18
+
19
+ %%BeginProlog
20
+ %%EndProlog
21
+
22
+ %%BeginSetup
23
+ /DrawDict 50 dict def
24
+ DrawDict begin
25
+ %%BeginResource procset GNU_libplot 1.0 0
26
+ /none null def
27
+ /numGraphicParameters 17 def
28
+ /stringLimit 65535 def
29
+ /arrowHeight 8 def
30
+ /eoFillRule true def
31
+
32
+ /Begin { save numGraphicParameters dict begin } def
33
+ /End { end restore } def
34
+
35
+ /SetB {
36
+ dup type /nulltype eq {
37
+ pop
38
+ false /brushRightArrow idef
39
+ false /brushLeftArrow idef
40
+ true /brushNone idef
41
+ } {
42
+ /brushDashOffset idef
43
+ /brushDashArray idef
44
+ 0 ne /brushRightArrow idef
45
+ 0 ne /brushLeftArrow idef
46
+ /brushWidth idef
47
+ false /brushNone idef
48
+ } ifelse
49
+ } def
50
+
51
+ /SetCFg {
52
+ /fgblue idef
53
+ /fggreen idef
54
+ /fgred idef
55
+ } def
56
+
57
+ /SetCBg {
58
+ /bgblue idef
59
+ /bggreen idef
60
+ /bgred idef
61
+ } def
62
+
63
+ /SetF {
64
+ /printSize idef
65
+ /printFont idef
66
+ } def
67
+
68
+ /SetP {
69
+ dup type /nulltype eq {
70
+ pop true /patternNone idef
71
+ } {
72
+ /patternGrayLevel idef
73
+ patternGrayLevel -1 eq {
74
+ /patternString idef
75
+ } if
76
+ false /patternNone idef
77
+ } ifelse
78
+ } def
79
+
80
+ /BSpl {
81
+ 0 begin
82
+ storexyn
83
+ newpath
84
+ n 1 gt {
85
+ 0 0 0 0 0 0 1 1 true subspline
86
+ n 2 gt {
87
+ 0 0 0 0 1 1 2 2 false subspline
88
+ 1 1 n 3 sub {
89
+ /i exch def
90
+ i 1 sub dup i dup i 1 add dup i 2 add dup false subspline
91
+ } for
92
+ n 3 sub dup n 2 sub dup n 1 sub dup 2 copy false subspline
93
+ } if
94
+ n 2 sub dup n 1 sub dup 2 copy 2 copy false subspline
95
+ patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if
96
+ brushNone not { istroke } if
97
+ 0 0 1 1 leftarrow
98
+ n 2 sub dup 1 sub dup rightarrow
99
+ } if
100
+ end
101
+ } dup 0 4 dict put def
102
+
103
+ /Circ {
104
+ newpath
105
+ 0 360 arc
106
+ closepath
107
+ patternNone not { ifill } if
108
+ brushNone not { istroke } if
109
+ } def
110
+
111
+ /CBSpl {
112
+ 0 begin
113
+ dup 2 gt {
114
+ storexyn
115
+ newpath
116
+ n 1 sub dup 0 0 1 1 2 2 true subspline
117
+ 1 1 n 3 sub {
118
+ /i exch def
119
+ i 1 sub dup i dup i 1 add dup i 2 add dup false subspline
120
+ } for
121
+ n 3 sub dup n 2 sub dup n 1 sub dup 0 0 false subspline
122
+ n 2 sub dup n 1 sub dup 0 0 1 1 false subspline
123
+ patternNone not { ifill } if
124
+ brushNone not { istroke } if
125
+ } {
126
+ Poly
127
+ } ifelse
128
+ end
129
+ } dup 0 4 dict put def
130
+
131
+ /Elli {
132
+ 0 begin
133
+ newpath
134
+ 4 2 roll
135
+ translate
136
+ scale
137
+ 0 0 1 0 360 arc
138
+ closepath
139
+ patternNone not { ifill } if
140
+ brushNone not { istroke } if
141
+ end
142
+ } dup 0 1 dict put def
143
+
144
+ /Line {
145
+ 0 begin
146
+ 2 storexyn
147
+ newpath
148
+ x 0 get y 0 get moveto
149
+ x 1 get y 1 get lineto
150
+ brushNone not { istroke } if
151
+ 0 0 1 1 leftarrow
152
+ 0 0 1 1 rightarrow
153
+ end
154
+ } dup 0 4 dict put def
155
+
156
+ /MLine {
157
+ 0 begin
158
+ storexyn
159
+ newpath
160
+ n 1 gt {
161
+ x 0 get y 0 get moveto
162
+ 1 1 n 1 sub {
163
+ /i exch def
164
+ x i get y i get lineto
165
+ } for
166
+ patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if
167
+ brushNone not { istroke } if
168
+ 0 0 1 1 leftarrow
169
+ n 2 sub dup n 1 sub dup rightarrow
170
+ } if
171
+ end
172
+ } dup 0 4 dict put def
173
+
174
+ /Poly {
175
+ 3 1 roll
176
+ newpath
177
+ moveto
178
+ -1 add
179
+ { lineto } repeat
180
+ closepath
181
+ patternNone not { ifill } if
182
+ brushNone not { istroke } if
183
+ } def
184
+
185
+ /Rect {
186
+ 0 begin
187
+ /t exch def
188
+ /r exch def
189
+ /b exch def
190
+ /l exch def
191
+ newpath
192
+ l b moveto
193
+ l t lineto
194
+ r t lineto
195
+ r b lineto
196
+ closepath
197
+ patternNone not { ifill } if
198
+ brushNone not { istroke } if
199
+ end
200
+ } dup 0 4 dict put def
201
+
202
+ /Text {
203
+ ishow
204
+ } def
205
+
206
+ /idef {
207
+ dup where { pop pop pop } { exch def } ifelse
208
+ } def
209
+
210
+ /ifill {
211
+ 0 begin
212
+ gsave
213
+ patternGrayLevel -1 ne {
214
+ fgred bgred fgred sub patternGrayLevel mul add
215
+ fggreen bggreen fggreen sub patternGrayLevel mul add
216
+ fgblue bgblue fgblue sub patternGrayLevel mul add setrgbcolor
217
+ eoFillRule { eofill } { fill } ifelse
218
+ } {
219
+ eoFillRule { eoclip } { clip } ifelse
220
+ originalCTM setmatrix
221
+ pathbbox /t exch def /r exch def /b exch def /l exch def
222
+ /w r l sub ceiling cvi def
223
+ /h t b sub ceiling cvi def
224
+ /imageByteWidth w 8 div ceiling cvi def
225
+ /imageHeight h def
226
+ bgred bggreen bgblue setrgbcolor
227
+ eoFillRule { eofill } { fill } ifelse
228
+ fgred fggreen fgblue setrgbcolor
229
+ w 0 gt h 0 gt and {
230
+ l b translate w h scale
231
+ w h true [w 0 0 h neg 0 h] { patternproc } imagemask
232
+ } if
233
+ } ifelse
234
+ grestore
235
+ end
236
+ } dup 0 8 dict put def
237
+
238
+ /istroke {
239
+ gsave
240
+ brushDashOffset -1 eq {
241
+ [] 0 setdash
242
+ 1 setgray
243
+ } {
244
+ brushDashArray brushDashOffset setdash
245
+ fgred fggreen fgblue setrgbcolor
246
+ } ifelse
247
+ brushWidth setlinewidth
248
+ originalCTM setmatrix
249
+ stroke
250
+ grestore
251
+ } def
252
+
253
+ /ishow {
254
+ 0 begin
255
+ gsave
256
+ fgred fggreen fgblue setrgbcolor
257
+ /fontDict printFont findfont printSize scalefont dup setfont def
258
+ /descender fontDict begin 0 [FontBBox] 1 get FontMatrix end
259
+ transform exch pop def
260
+ /vertoffset 1 printSize sub descender sub def {
261
+ 0 vertoffset moveto show
262
+ /vertoffset vertoffset printSize sub def
263
+ } forall
264
+ grestore
265
+ end
266
+ } dup 0 3 dict put def
267
+
268
+ /patternproc {
269
+ 0 begin
270
+ /patternByteLength patternString length def
271
+ /patternHeight patternByteLength 8 mul sqrt cvi def
272
+ /patternWidth patternHeight def
273
+ /patternByteWidth patternWidth 8 idiv def
274
+ /imageByteMaxLength imageByteWidth imageHeight mul
275
+ stringLimit patternByteWidth sub min def
276
+ /imageMaxHeight imageByteMaxLength imageByteWidth idiv patternHeight idiv
277
+ patternHeight mul patternHeight max def
278
+ /imageHeight imageHeight imageMaxHeight sub store
279
+ /imageString imageByteWidth imageMaxHeight mul patternByteWidth add string def
280
+ 0 1 imageMaxHeight 1 sub {
281
+ /y exch def
282
+ /patternRow y patternByteWidth mul patternByteLength mod def
283
+ /patternRowString patternString patternRow patternByteWidth getinterval def
284
+ /imageRow y imageByteWidth mul def
285
+ 0 patternByteWidth imageByteWidth 1 sub {
286
+ /x exch def
287
+ imageString imageRow x add patternRowString putinterval
288
+ } for
289
+ } for
290
+ imageString
291
+ end
292
+ } dup 0 12 dict put def
293
+
294
+ /min {
295
+ dup 3 2 roll dup 4 3 roll lt { exch } if pop
296
+ } def
297
+
298
+ /max {
299
+ dup 3 2 roll dup 4 3 roll gt { exch } if pop
300
+ } def
301
+
302
+ /midpoint {
303
+ 0 begin
304
+ /y1 exch def
305
+ /x1 exch def
306
+ /y0 exch def
307
+ /x0 exch def
308
+ x0 x1 add 2 div
309
+ y0 y1 add 2 div
310
+ end
311
+ } dup 0 4 dict put def
312
+
313
+ /thirdpoint {
314
+ 0 begin
315
+ /y1 exch def
316
+ /x1 exch def
317
+ /y0 exch def
318
+ /x0 exch def
319
+ x0 2 mul x1 add 3 div
320
+ y0 2 mul y1 add 3 div
321
+ end
322
+ } dup 0 4 dict put def
323
+
324
+ /subspline {
325
+ 0 begin
326
+ /movetoNeeded exch def
327
+ y exch get /y3 exch def
328
+ x exch get /x3 exch def
329
+ y exch get /y2 exch def
330
+ x exch get /x2 exch def
331
+ y exch get /y1 exch def
332
+ x exch get /x1 exch def
333
+ y exch get /y0 exch def
334
+ x exch get /x0 exch def
335
+ x1 y1 x2 y2 thirdpoint
336
+ /p1y exch def
337
+ /p1x exch def
338
+ x2 y2 x1 y1 thirdpoint
339
+ /p2y exch def
340
+ /p2x exch def
341
+ x1 y1 x0 y0 thirdpoint
342
+ p1x p1y midpoint
343
+ /p0y exch def
344
+ /p0x exch def
345
+ x2 y2 x3 y3 thirdpoint
346
+ p2x p2y midpoint
347
+ /p3y exch def
348
+ /p3x exch def
349
+ movetoNeeded { p0x p0y moveto } if
350
+ p1x p1y p2x p2y p3x p3y curveto
351
+ end
352
+ } dup 0 17 dict put def
353
+
354
+ /storexyn {
355
+ /n exch def
356
+ /y n array def
357
+ /x n array def
358
+ n 1 sub -1 0 {
359
+ /i exch def
360
+ y i 3 2 roll put
361
+ x i 3 2 roll put
362
+ } for
363
+ } def
364
+
365
+ /arrowhead {
366
+ 0 begin
367
+ transform originalCTM itransform
368
+ /taily exch def
369
+ /tailx exch def
370
+ transform originalCTM itransform
371
+ /tipy exch def
372
+ /tipx exch def
373
+ /dy tipy taily sub def
374
+ /dx tipx tailx sub def
375
+ /angle dx 0 ne dy 0 ne or { dy dx atan } { 90 } ifelse def
376
+ gsave
377
+ originalCTM setmatrix
378
+ tipx tipy translate
379
+ angle rotate
380
+ newpath
381
+ arrowHeight neg arrowWidth 2 div moveto
382
+ 0 0 lineto
383
+ arrowHeight neg arrowWidth 2 div neg lineto
384
+ patternNone not {
385
+ originalCTM setmatrix
386
+ /padtip arrowHeight 2 exp 0.25 arrowWidth 2 exp mul add sqrt brushWidth mul
387
+ arrowWidth div def
388
+ /padtail brushWidth 2 div def
389
+ tipx tipy translate
390
+ angle rotate
391
+ padtip 0 translate
392
+ arrowHeight padtip add padtail add arrowHeight div dup scale
393
+ arrowheadpath
394
+ ifill
395
+ } if
396
+ brushNone not {
397
+ originalCTM setmatrix
398
+ tipx tipy translate
399
+ angle rotate
400
+ arrowheadpath
401
+ istroke
402
+ } if
403
+ grestore
404
+ end
405
+ } dup 0 9 dict put def
406
+
407
+ /arrowheadpath {
408
+ newpath
409
+ arrowHeight neg arrowWidth 2 div moveto
410
+ 0 0 lineto
411
+ arrowHeight neg arrowWidth 2 div neg lineto
412
+ } def
413
+
414
+ /leftarrow {
415
+ 0 begin
416
+ y exch get /taily exch def
417
+ x exch get /tailx exch def
418
+ y exch get /tipy exch def
419
+ x exch get /tipx exch def
420
+ brushLeftArrow { tipx tipy tailx taily arrowhead } if
421
+ end
422
+ } dup 0 4 dict put def
423
+
424
+ /rightarrow {
425
+ 0 begin
426
+ y exch get /tipy exch def
427
+ x exch get /tipx exch def
428
+ y exch get /taily exch def
429
+ x exch get /tailx exch def
430
+ brushRightArrow { tipx tipy tailx taily arrowhead } if
431
+ end
432
+ } dup 0 4 dict put def
433
+ %%EndResource
434
+ %%EndSetup
435
+
436
+ %%Page: 1 1
437
+ %%PageResources:
438
+ %%PageBoundingBox: -3 84 39 132
439
+ %%BeginPageSetup
440
+ %I Idraw 8
441
+
442
+ Begin
443
+ %I b u
444
+ %I cfg u
445
+ %I cbg u
446
+ %I f u
447
+ %I p u
448
+ %I t
449
+ [ 1 0 0 1 0 0 ] concat
450
+ /originalCTM matrix currentmatrix def
451
+ /trueoriginalCTM matrix currentmatrix def
452
+ %%EndPageSetup
453
+
454
+ Begin %I Poly
455
+ [1.44 0 0 1.44 0 0 ] trueoriginalCTM originalCTM
456
+ concatmatrix pop
457
+ 0 setlinecap 0 setlinejoin 10.43 setmiterlimit
458
+ /eoFillRule true def
459
+ %I b 65535
460
+ 1 0 0 [ ] 0 SetB
461
+ %I cfg Black
462
+ 0 0 0 SetCFg
463
+ %I cbg White
464
+ 1 1 1 SetCBg
465
+ %I p
466
+ none SetP
467
+ %I t
468
+ [0.05 0 0 0.05 18 108 ] concat
469
+ %I 6
470
+ 0 461
471
+ 399 230
472
+ 399 -230
473
+ 0 -461
474
+ -399 -230
475
+ -399 230
476
+ 6 Poly
477
+ End
478
+
479
+ %%PageTrailer
480
+ End %I eop
481
+ showpage
482
+
483
+ %%Trailer
484
+ end
485
+ %%EOF