ruby-dcl 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (319) hide show
  1. data/ChangeLog +321 -0
  2. data/GenWrapper/Makefile +14 -0
  3. data/GenWrapper/cproto2init.rb +41 -0
  4. data/GenWrapper/dcl_narrayed_funcs.rb +181 -0
  5. data/GenWrapper/dcl_rb_footing +29 -0
  6. data/GenWrapper/dcl_rb_heading +129 -0
  7. data/GenWrapper/def.rb +20 -0
  8. data/GenWrapper/elim_ary_size.rb +398 -0
  9. data/GenWrapper/etc/Mk_proto +375 -0
  10. data/GenWrapper/etc/dcl_gen +13 -0
  11. data/GenWrapper/etc/p_header +63 -0
  12. data/GenWrapper/etc/p_init +410 -0
  13. data/GenWrapper/pparse.rb +137 -0
  14. data/GenWrapper/proto/Makefile +35 -0
  15. data/GenWrapper/proto/grph1_00 +17 -0
  16. data/GenWrapper/proto/grph1_csgi.fp +27 -0
  17. data/GenWrapper/proto/grph1_scpack.fp +442 -0
  18. data/GenWrapper/proto/grph1_sgpack.fp +1406 -0
  19. data/GenWrapper/proto/grph1_slpack.fp +316 -0
  20. data/GenWrapper/proto/grph1_stpack.fp +411 -0
  21. data/GenWrapper/proto/grph1_swpack.fp +746 -0
  22. data/GenWrapper/proto/grph2_00 +16 -0
  23. data/GenWrapper/proto/grph2_grpack.fp +139 -0
  24. data/GenWrapper/proto/grph2_ucpack.fp +522 -0
  25. data/GenWrapper/proto/grph2_udpack.fp +692 -0
  26. data/GenWrapper/proto/grph2_uepack.fp +601 -0
  27. data/GenWrapper/proto/grph2_ugpack.fp +436 -0
  28. data/GenWrapper/proto/grph2_uhpack.fp +246 -0
  29. data/GenWrapper/proto/grph2_ulpack.fp +516 -0
  30. data/GenWrapper/proto/grph2_umpack.fp +676 -0
  31. data/GenWrapper/proto/grph2_uspack.fp +989 -0
  32. data/GenWrapper/proto/grph2_uupack.fp +663 -0
  33. data/GenWrapper/proto/grph2_uvpack.fp +246 -0
  34. data/GenWrapper/proto/grph2_uwpack.fp +203 -0
  35. data/GenWrapper/proto/grph2_uxpack.fp +295 -0
  36. data/GenWrapper/proto/grph2_uypack.fp +295 -0
  37. data/GenWrapper/proto/grph2_uzpack.fp +574 -0
  38. data/GenWrapper/proto/math1_00 +12 -0
  39. data/GenWrapper/proto/math1_blklib.fp +58 -0
  40. data/GenWrapper/proto/math1_chrlib.fp +83 -0
  41. data/GenWrapper/proto/math1_fnclib.fp +79 -0
  42. data/GenWrapper/proto/math1_gnmlib.fp +118 -0
  43. data/GenWrapper/proto/math1_gt2dlib.fp +144 -0
  44. data/GenWrapper/proto/math1_ifalib.fp +123 -0
  45. data/GenWrapper/proto/math1_indxlib.fp +222 -0
  46. data/GenWrapper/proto/math1_intlib.fp +46 -0
  47. data/GenWrapper/proto/math1_lrllib.fp +276 -0
  48. data/GenWrapper/proto/math1_maplib.fp +24 -0
  49. data/GenWrapper/proto/math1_oslib.fp +28 -0
  50. data/GenWrapper/proto/math1_rfalib.fp +420 -0
  51. data/GenWrapper/proto/math1_rfblib.fp +51 -0
  52. data/GenWrapper/proto/math1_sublib.fp +60 -0
  53. data/GenWrapper/proto/math1_syslib.fp +767 -0
  54. data/GenWrapper/proto/math1_vialib.fp +339 -0
  55. data/GenWrapper/proto/math1_viblib.fp +264 -0
  56. data/GenWrapper/proto/math1_vralib.fp +339 -0
  57. data/GenWrapper/proto/math1_vrblib.fp +264 -0
  58. data/GenWrapper/proto/math1_xfclib.fp +68 -0
  59. data/GenWrapper/proto/math2_00 +12 -0
  60. data/GenWrapper/proto/math2_fftlib.fp +803 -0
  61. data/GenWrapper/proto/math2_intrlib.fp +32 -0
  62. data/GenWrapper/proto/math2_odelib.fp_notused +568 -0
  63. data/GenWrapper/proto/math2_rnmlib.fp +54 -0
  64. data/GenWrapper/proto/math2_shtlib.fp +1292 -0
  65. data/GenWrapper/proto/math2_shtlib.fp_old +1294 -0
  66. data/GenWrapper/proto/math2_vstlib.fp +84 -0
  67. data/GenWrapper/proto/misc1_00 +17 -0
  68. data/GenWrapper/proto/misc1_chnlib.fp +47 -0
  69. data/GenWrapper/proto/misc1_datelib.fp +352 -0
  70. data/GenWrapper/proto/misc1_fmtlib.fp +19 -0
  71. data/GenWrapper/proto/misc1_misclib.fp +26 -0
  72. data/GenWrapper/proto/misc1_randlib.fp +36 -0
  73. data/GenWrapper/proto/misc1_timelib.fp +151 -0
  74. data/GenWrapper/proto2c.rb +13 -0
  75. data/GenWrapper/prototype.rb +209 -0
  76. data/GenWrapper/util.rb +9 -0
  77. data/GenWrapper/variable.rb +671 -0
  78. data/README +29 -0
  79. data/Rakefile +44 -0
  80. data/ToDo +2 -0
  81. data/dcl_cary2obj.c +354 -0
  82. data/dcl_narrayed_funcs.c +518 -0
  83. data/dcl_obj2cary.c +512 -0
  84. data/dcl_rubydcloriginal.c +129 -0
  85. data/demo/gokuraku/hop/hop.rb +26 -0
  86. data/demo/gokuraku/jump/jump1.rb +64 -0
  87. data/demo/gokuraku/jump/jump2.rb +50 -0
  88. data/demo/gokuraku/layout/lay1.rb +46 -0
  89. data/demo/gokuraku/layout/lay2.rb +44 -0
  90. data/demo/gokuraku/step/step0.rb +34 -0
  91. data/demo/gokuraku/step/step1.rb +84 -0
  92. data/demo/gokuraku/step/step2.rb +62 -0
  93. data/demo/gokuraku/u1d/u1d1.rb +37 -0
  94. data/demo/gokuraku/u1d/u1d2.rb +50 -0
  95. data/demo/gokuraku/u2d/u2d1.rb +46 -0
  96. data/demo/gokuraku/u2d/u2d2.rb +49 -0
  97. data/demo/gokuraku/u2d/u2d3.rb +45 -0
  98. data/demo/gokuraku/u2d/u2d4.rb +61 -0
  99. data/demo/grph1/scpack/scpkt2.rb +40 -0
  100. data/demo/grph1/scpack/scpkt3.rb +102 -0
  101. data/demo/grph1/scpack/scpkt6.rb +84 -0
  102. data/demo/grph1/scpack/scpkt7.rb +59 -0
  103. data/demo/grph1/scpack/scpkt8.rb +60 -0
  104. data/demo/grph1/scpack/t810630.dat +296 -0
  105. data/demo/grph1/scpack/t811231.dat +296 -0
  106. data/demo/grph1/sgpack/sgfont.rb +52 -0
  107. data/demo/grph1/sgpack/sgfonz.rb +53 -0
  108. data/demo/grph1/sgpack/sgksx1.rb +44 -0
  109. data/demo/grph1/sgpack/sgksx2.rb +90 -0
  110. data/demo/grph1/sgpack/sgksx3.rb +75 -0
  111. data/demo/grph1/sgpack/sglidx.rb +40 -0
  112. data/demo/grph1/sgpack/sgltyp.rb +48 -0
  113. data/demo/grph1/sgpack/sgpk01.rb +39 -0
  114. data/demo/grph1/sgpack/sgpk02.rb +79 -0
  115. data/demo/grph1/sgpack/sgpk03.rb +107 -0
  116. data/demo/grph1/sgpack/sgpk04.rb +86 -0
  117. data/demo/grph1/sgpack/sgpk05.rb +66 -0
  118. data/demo/grph1/sgpack/sgpk06.rb +91 -0
  119. data/demo/grph1/sgpack/sgpk07.rb +66 -0
  120. data/demo/grph1/sgpack/sgpk08.rb +67 -0
  121. data/demo/grph1/sgpack/sgpk09.rb +61 -0
  122. data/demo/grph1/sgpack/sgpk10.rb +58 -0
  123. data/demo/grph1/sgpack/sgtclr.rb +59 -0
  124. data/demo/grph1/sgpack/sgtone.rb +70 -0
  125. data/demo/grph1/sgpack/sgtonz.rb +66 -0
  126. data/demo/grph1/slpack/slpk01.rb +37 -0
  127. data/demo/grph1/slpack/slpk02.rb +29 -0
  128. data/demo/grph1/slpack/slpk03.rb +36 -0
  129. data/demo/grph1/slpack/slpk04.rb +36 -0
  130. data/demo/grph2/g2pack/g2pk01.rb +78 -0
  131. data/demo/grph2/g2pack/g2pk02.rb +75 -0
  132. data/demo/grph2/grpack/grpk01.rb +65 -0
  133. data/demo/grph2/ucpack/ucpk01.rb +95 -0
  134. data/demo/grph2/ucpack/ucpk02.rb +95 -0
  135. data/demo/grph2/udegpk/u2df01.rb +50 -0
  136. data/demo/grph2/udegpk/u2df02.rb +76 -0
  137. data/demo/grph2/udegpk/u2df03.rb +80 -0
  138. data/demo/grph2/udegpk/u2df04.rb +52 -0
  139. data/demo/grph2/udegpk/u2df05.rb +70 -0
  140. data/demo/grph2/udegpk/u2df06.rb +59 -0
  141. data/demo/grph2/udegpk/u2df07.rb +68 -0
  142. data/demo/grph2/udegpk/u2df08.rb +91 -0
  143. data/demo/grph2/udegpk/u2df09b.rb +88 -0
  144. data/demo/grph2/udegpk/u2df09c.rb +89 -0
  145. data/demo/grph2/udegpk/u2df09e.rb +88 -0
  146. data/demo/grph2/udegpk/u2df09f.rb +89 -0
  147. data/demo/grph2/ulpack/ulpk01.rb +111 -0
  148. data/demo/grph2/ulpack/ulpk01n.rb +111 -0
  149. data/demo/grph2/ulpack/ulpk02.rb +111 -0
  150. data/demo/grph2/ulpack/ulpk02n.rb +111 -0
  151. data/demo/grph2/umpack/t811231.dat +296 -0
  152. data/demo/grph2/umpack/test01.rb +69 -0
  153. data/demo/grph2/umpack/test02.rb +64 -0
  154. data/demo/grph2/umpack/test03.rb +84 -0
  155. data/demo/grph2/umpack/test04.rb +54 -0
  156. data/demo/grph2/umpack/test05.rb +85 -0
  157. data/demo/grph2/umpack/test06.rb +44 -0
  158. data/demo/grph2/umpack/test07.rb +43 -0
  159. data/demo/grph2/umpack/test08.rb +37 -0
  160. data/demo/grph2/umpack/test09.rb +86 -0
  161. data/demo/grph2/umpack/test10.rb +52 -0
  162. data/demo/grph2/umpack/umpk01.rb +65 -0
  163. data/demo/grph2/umpack/umpk02.rb +54 -0
  164. data/demo/grph2/umpack/umpk03.rb +46 -0
  165. data/demo/grph2/umpack/umpk04.rb +65 -0
  166. data/demo/grph2/umpack/umpk05.rb +84 -0
  167. data/demo/grph2/uspack/uspk01.rb +39 -0
  168. data/demo/grph2/uspack/uspk02.rb +47 -0
  169. data/demo/grph2/uspack/uspk03.rb +38 -0
  170. data/demo/grph2/uspack/uspk04.rb +64 -0
  171. data/demo/grph2/uspack/uspk05.rb +68 -0
  172. data/demo/grph2/uspack/uspk06.rb +43 -0
  173. data/demo/grph2/uspack/uspk07.rb +62 -0
  174. data/demo/grph2/uspack/uspk08.rb +46 -0
  175. data/demo/grph2/uspack/uspk09.rb +89 -0
  176. data/demo/grph2/uspack/uspk10.rb +48 -0
  177. data/demo/grph2/uspack/uspk11.rb +71 -0
  178. data/demo/grph2/uspack/uspk12.rb +51 -0
  179. data/demo/grph2/uupack/uupk01.rb +50 -0
  180. data/demo/grph2/uupack/uupk02.rb +74 -0
  181. data/demo/grph2/uupack/uupk03.rb +56 -0
  182. data/demo/grph2/uupack/uupk04.rb +84 -0
  183. data/demo/grph2/uupack/uupk05.rb +74 -0
  184. data/demo/grph2/uupack/uupk06.rb +77 -0
  185. data/demo/grph2/uupack/uupk07.rb +88 -0
  186. data/demo/grph2/uxyzpk/uxyz01.rb +38 -0
  187. data/demo/grph2/uxyzpk/uxyz02.rb +36 -0
  188. data/demo/grph2/uxyzpk/uxyz03.rb +37 -0
  189. data/demo/grph2/uxyzpk/uxyz04.rb +54 -0
  190. data/demo/grph2/uxyzpk/uxyz05.rb +41 -0
  191. data/demo/grph2/uxyzpk/uxyz06.rb +42 -0
  192. data/demo/grph2/uxyzpk/uxyz07.rb +38 -0
  193. data/demo/grph2/uxyzpk/uxyz08.rb +60 -0
  194. data/demo/grph2/uxyzpk/uxyz09.rb +52 -0
  195. data/demo/grph2/uxyzpk/uxyz10.rb +57 -0
  196. data/demo/grph2/ximage/MEMO +23 -0
  197. data/demo/grph2/ximage/tomsclm.dat +1344 -0
  198. data/demo/grph2/ximage/ximg01.rb +145 -0
  199. data/demo/math1/gt2dlib/gt2d01.rb +33 -0
  200. data/demo/math2/fftlib/fftl01.rb +28 -0
  201. data/demo/math2/fftlib/fftl02.rb +224 -0
  202. data/demo/math2/intrlib/intr01.rb +22 -0
  203. data/demo/math2/rnmlib/rnml01.rb +21 -0
  204. data/demo/math2/vstlib/vstl01.rb +29 -0
  205. data/demo/math2/vstlib/vstl02.rb +38 -0
  206. data/demo/rakuraku/color/color1.rb +61 -0
  207. data/demo/rakuraku/color/color2.rb +57 -0
  208. data/demo/rakuraku/color/color3.rb +81 -0
  209. data/demo/rakuraku/kihon/kihon1.rb +39 -0
  210. data/demo/rakuraku/kihon/kihon2.rb +56 -0
  211. data/demo/rakuraku/kihon/kihon3.rb +57 -0
  212. data/demo/rakuraku/kihon/kihon4.rb +70 -0
  213. data/demo/rakuraku/kihon/kihon5.rb +56 -0
  214. data/demo/rakuraku/kihon/kihon6.rb +40 -0
  215. data/demo/rakuraku/kihon/kihon7.rb +98 -0
  216. data/demo/rakuraku/kihon/kihon8.rb +93 -0
  217. data/demo/rakuraku/kihon/kihon9.rb +77 -0
  218. data/demo/rakuraku/kihon/kihona.rb +123 -0
  219. data/demo/rakuraku/kihon/kihonb.rb +73 -0
  220. data/demo/rakuraku/kihon/kihonc.rb +110 -0
  221. data/demo/rakuraku/layout/lay1.rb +29 -0
  222. data/demo/rakuraku/layout/lay2.rb +28 -0
  223. data/demo/rakuraku/layout/lay3.rb +29 -0
  224. data/demo/rakuraku/map3d/map3d1.rb +68 -0
  225. data/demo/rakuraku/map3d/map3d2.rb +67 -0
  226. data/demo/rakuraku/map3d/map3d3.rb +66 -0
  227. data/demo/rakuraku/map3d/map3d4.rb +107 -0
  228. data/demo/rakuraku/map3d/map3d5.rb +118 -0
  229. data/demo/rakuraku/map3d/map3d6.rb +96 -0
  230. data/demo/rakuraku/map3d/map3d7.rb +98 -0
  231. data/demo/rakuraku/miss/miss1.rb +76 -0
  232. data/demo/rakuraku/miss/miss2.rb +60 -0
  233. data/demo/rakuraku/quick/quick1.rb +35 -0
  234. data/demo/rakuraku/quick/quick2.rb +33 -0
  235. data/demo/rakuraku/quick/quick3.rb +46 -0
  236. data/demo/rakuraku/quick/quick4.rb +47 -0
  237. data/demo/rakuraku/quick/quick5.rb +46 -0
  238. data/demo/rakuraku/u2d/u2d1.rb +50 -0
  239. data/demo/rakuraku/u2d/u2d2.rb +51 -0
  240. data/demo/rakuraku/u2d/u2d3.rb +70 -0
  241. data/demo/rakuraku/u2d/u2d4.rb +59 -0
  242. data/demo/rakuraku/u2d/u2d5.rb +61 -0
  243. data/demo/rakuraku/u2d/u2d6.rb +57 -0
  244. data/demo/rakuraku/u2d/u2d7.rb +103 -0
  245. data/demo/rakuraku/uspack/uspac1.rb +35 -0
  246. data/demo/rakuraku/uspack/uspac2.rb +66 -0
  247. data/demo/rakuraku/uspack/uspac3.rb +37 -0
  248. data/demo/rakuraku/uspack/uspac4.rb +49 -0
  249. data/demo/rakuraku/uxyz/uxyz1.rb +37 -0
  250. data/demo/rakuraku/uxyz/uxyz2.rb +35 -0
  251. data/demo/rakuraku/uxyz/uxyz3.rb +38 -0
  252. data/demo/rakuraku/uxyz/uxyz4.rb +36 -0
  253. data/demo/rakuraku/uxyz/uxyz5.rb +57 -0
  254. data/demo/rakuraku/uxyz/uxyz6.rb +43 -0
  255. data/demo/rakuraku/uxyz/uxyz7.rb +39 -0
  256. data/demo/rakuraku/uxyz/uxyz8.rb +56 -0
  257. data/demo/rubydcloriginal/uemrkz1.rb +37 -0
  258. data/dummy.c +9 -0
  259. data/extconf.rb +133 -0
  260. data/grph1_csgi.c +119 -0
  261. data/grph1_scpack.c +1388 -0
  262. data/grph1_sgpack.c +3876 -0
  263. data/grph1_slpack.c +432 -0
  264. data/grph1_stpack.c +1044 -0
  265. data/grph1_swpack.c +1922 -0
  266. data/grph1_zgpack.c.org +141 -0
  267. data/grph2_grpack.c +368 -0
  268. data/grph2_ucpack.c +1232 -0
  269. data/grph2_udpack.c +1404 -0
  270. data/grph2_uepack.c +1443 -0
  271. data/grph2_ugpack.c +1073 -0
  272. data/grph2_uhpack.c +943 -0
  273. data/grph2_ulpack.c +1304 -0
  274. data/grph2_umpack.c +1540 -0
  275. data/grph2_uspack.c +2481 -0
  276. data/grph2_uupack.c +1689 -0
  277. data/grph2_uvpack.c +943 -0
  278. data/grph2_uwpack.c +552 -0
  279. data/grph2_uxpack.c +555 -0
  280. data/grph2_uypack.c +555 -0
  281. data/grph2_uzpack.c +1455 -0
  282. data/init.c.default +187 -0
  283. data/init.c.gtk +189 -0
  284. data/lib/dcl.rb +5084 -0
  285. data/math1_blklib.c +227 -0
  286. data/math1_chrlib.c +239 -0
  287. data/math1_fnclib.c +254 -0
  288. data/math1_gnmlib.c +356 -0
  289. data/math1_gt2dlib.c +514 -0
  290. data/math1_ifalib.c +427 -0
  291. data/math1_indxlib.c +709 -0
  292. data/math1_intlib.c +167 -0
  293. data/math1_lrllib.c +817 -0
  294. data/math1_maplib.c +172 -0
  295. data/math1_oslib.c +111 -0
  296. data/math1_rfalib.c +1417 -0
  297. data/math1_rfblib.c +232 -0
  298. data/math1_sublib.c +221 -0
  299. data/math1_syslib.c +2025 -0
  300. data/math1_vialib.c +1156 -0
  301. data/math1_viblib.c +1027 -0
  302. data/math1_vralib.c +1156 -0
  303. data/math1_vrblib.c +1027 -0
  304. data/math1_xfclib.c +142 -0
  305. data/math2_fftlib.c +833 -0
  306. data/math2_intrlib.c +138 -0
  307. data/math2_rnmlib.c +226 -0
  308. data/math2_shtlib.c +1568 -0
  309. data/math2_vstlib.c +366 -0
  310. data/misc1_chnlib.c +179 -0
  311. data/misc1_datelib.c +953 -0
  312. data/misc1_fmtlib.c +99 -0
  313. data/misc1_misclib.c +118 -0
  314. data/misc1_randlib.c +142 -0
  315. data/misc1_timelib.c +380 -0
  316. data/obsolete/README +2 -0
  317. data/obsolete/dcl_ext.html +112 -0
  318. data/obsolete/dcl_ext.rb +313 -0
  319. metadata +433 -0
data/grph1_csgi.c ADDED
@@ -0,0 +1,119 @@
1
+ /*
2
+ * $Id: p_header,v 1.2 2011-02-23 17:47:10 koshiro Exp $
3
+ */
4
+
5
+ #include <stdio.h>
6
+ #include "ruby.h"
7
+ #include "libtinyf2c.h"
8
+ #include "narray.h"
9
+
10
+ /* for compatibility with ruby 1.6 */
11
+ #ifndef StringValuePtr
12
+ #define StringValuePtr(s) STR2CSTR(s)
13
+ #endif
14
+
15
+ #define DFLT_SIZE 32
16
+
17
+ extern char *dcl_obj2ccharary(VALUE, int, int);
18
+ extern integer *dcl_obj2cintegerary(VALUE);
19
+ extern real *dcl_obj2crealary(VALUE);
20
+ extern complex *dcl_obj2ccomplexary(VALUE);
21
+ extern logical *dcl_obj2clogicalary(VALUE);
22
+
23
+ extern VALUE dcl_ccharary2obj(char *, int, int);
24
+ extern VALUE dcl_cintegerary2obj(integer *, int, int, int *);
25
+ extern VALUE dcl_crealary2obj(real *, int, int, int *);
26
+ extern VALUE dcl_ccomplexary2obj(complex *, int, char *);
27
+ extern VALUE dcl_clogicalary2obj(logical *, int, int, int *);
28
+
29
+ extern void dcl_freeccharary(char *);
30
+ extern void dcl_freecintegerary(integer *);
31
+ extern void dcl_freecrealary(real *);
32
+ extern void dcl_freeccomplexary(complex *);
33
+ extern void dcl_freeclogicalary(logical *);
34
+
35
+ /* for functions which return real */
36
+ /* fnclib */
37
+ extern real rd2r_(real *);
38
+ extern real rr2d_(real *);
39
+ extern real rexp_(real *, integer *, integer *);
40
+ extern real rfpi_(void);
41
+ extern real rmod_(real *, real *);
42
+ /* gnmlib */
43
+ extern real rgnlt_(real *);
44
+ extern real rgnle_(real *);
45
+ extern real rgngt_(real *);
46
+ extern real rgnge_(real *);
47
+ /* rfalib */
48
+ extern real rmax_(real *, integer *, integer *);
49
+ extern real rmin_(real *, integer *, integer *);
50
+ extern real rsum_(real *, integer *, integer *);
51
+ extern real rave_(real *, integer *, integer *);
52
+ extern real rvar_(real *, integer *, integer *);
53
+ extern real rstd_(real *, integer *, integer *);
54
+ extern real rrms_(real *, integer *, integer *);
55
+ extern real ramp_(real *, integer *, integer *);
56
+ /* rfblib */
57
+ extern real rprd_(real *, real *, integer *, integer *, integer *);
58
+ extern real rcov_(real *, real *, integer *, integer *, integer *);
59
+ extern real rcor_(real *, real *, integer *, integer *, integer *);
60
+
61
+
62
+ extern VALUE mDCL;
63
+
64
+ static VALUE
65
+ dcl_csgi(obj, ic)
66
+ VALUE obj, ic;
67
+ {
68
+ integer i_ic;
69
+ char *o_rtn_val;
70
+ VALUE rtn_val;
71
+
72
+ if ((TYPE(ic) != T_BIGNUM) || (TYPE(ic) != T_FIXNUM)) {
73
+ ic = rb_funcall(ic, rb_intern("to_i"), 0);
74
+ }
75
+
76
+ i_ic = NUM2INT(ic);
77
+
78
+ o_rtn_val= ALLOCA_N(char, (2));
79
+ memset(o_rtn_val, '\0', 2);
80
+
81
+ csgi_(o_rtn_val, (ftnlen)1, &i_ic);
82
+
83
+ rtn_val = rb_str_new2(o_rtn_val);
84
+
85
+
86
+ return rtn_val;
87
+
88
+ }
89
+
90
+ static VALUE
91
+ dcl_isgc(obj, ch)
92
+ VALUE obj, ch;
93
+ {
94
+ char *i_ch;
95
+ integer o_rtn_val;
96
+ VALUE rtn_val;
97
+
98
+ if (TYPE(ch) != T_STRING) {
99
+ ch = rb_funcall(ch, rb_intern("to_str"), 0);
100
+ }
101
+
102
+ i_ch = StringValuePtr(ch);
103
+
104
+
105
+ o_rtn_val = isgc_(i_ch, (ftnlen)strlen(i_ch));
106
+
107
+ rtn_val = INT2NUM(o_rtn_val);
108
+
109
+
110
+ return rtn_val;
111
+
112
+ }
113
+ void
114
+ init_grph1_csgi(mDCL)
115
+ VALUE mDCL;
116
+ {
117
+ rb_define_module_function(mDCL, "csgi", dcl_csgi, 1);
118
+ rb_define_module_function(mDCL, "isgc", dcl_isgc, 1);
119
+ }
data/grph1_scpack.c ADDED
@@ -0,0 +1,1388 @@
1
+ /*
2
+ * $Id: p_header,v 1.2 2011-02-23 17:47:10 koshiro Exp $
3
+ */
4
+
5
+ #include <stdio.h>
6
+ #include "ruby.h"
7
+ #include "libtinyf2c.h"
8
+ #include "narray.h"
9
+
10
+ /* for compatibility with ruby 1.6 */
11
+ #ifndef StringValuePtr
12
+ #define StringValuePtr(s) STR2CSTR(s)
13
+ #endif
14
+
15
+ #define DFLT_SIZE 32
16
+
17
+ extern char *dcl_obj2ccharary(VALUE, int, int);
18
+ extern integer *dcl_obj2cintegerary(VALUE);
19
+ extern real *dcl_obj2crealary(VALUE);
20
+ extern complex *dcl_obj2ccomplexary(VALUE);
21
+ extern logical *dcl_obj2clogicalary(VALUE);
22
+
23
+ extern VALUE dcl_ccharary2obj(char *, int, int);
24
+ extern VALUE dcl_cintegerary2obj(integer *, int, int, int *);
25
+ extern VALUE dcl_crealary2obj(real *, int, int, int *);
26
+ extern VALUE dcl_ccomplexary2obj(complex *, int, char *);
27
+ extern VALUE dcl_clogicalary2obj(logical *, int, int, int *);
28
+
29
+ extern void dcl_freeccharary(char *);
30
+ extern void dcl_freecintegerary(integer *);
31
+ extern void dcl_freecrealary(real *);
32
+ extern void dcl_freeccomplexary(complex *);
33
+ extern void dcl_freeclogicalary(logical *);
34
+
35
+ /* for functions which return real */
36
+ /* fnclib */
37
+ extern real rd2r_(real *);
38
+ extern real rr2d_(real *);
39
+ extern real rexp_(real *, integer *, integer *);
40
+ extern real rfpi_(void);
41
+ extern real rmod_(real *, real *);
42
+ /* gnmlib */
43
+ extern real rgnlt_(real *);
44
+ extern real rgnle_(real *);
45
+ extern real rgngt_(real *);
46
+ extern real rgnge_(real *);
47
+ /* rfalib */
48
+ extern real rmax_(real *, integer *, integer *);
49
+ extern real rmin_(real *, integer *, integer *);
50
+ extern real rsum_(real *, integer *, integer *);
51
+ extern real rave_(real *, integer *, integer *);
52
+ extern real rvar_(real *, integer *, integer *);
53
+ extern real rstd_(real *, integer *, integer *);
54
+ extern real rrms_(real *, integer *, integer *);
55
+ extern real ramp_(real *, integer *, integer *);
56
+ /* rfblib */
57
+ extern real rprd_(real *, real *, integer *, integer *, integer *);
58
+ extern real rcov_(real *, real *, integer *, integer *, integer *);
59
+ extern real rcor_(real *, real *, integer *, integer *, integer *);
60
+
61
+
62
+ extern VALUE mDCL;
63
+
64
+ static VALUE
65
+ dcl_scsobj(obj, xobj3, yobj3, zobj3)
66
+ VALUE obj, xobj3, yobj3, zobj3;
67
+ {
68
+ real i_xobj3;
69
+ real i_yobj3;
70
+ real i_zobj3;
71
+
72
+ if (TYPE(xobj3) != T_FLOAT) {
73
+ xobj3 = rb_funcall(xobj3, rb_intern("to_f"), 0);
74
+ }
75
+ if (TYPE(yobj3) != T_FLOAT) {
76
+ yobj3 = rb_funcall(yobj3, rb_intern("to_f"), 0);
77
+ }
78
+ if (TYPE(zobj3) != T_FLOAT) {
79
+ zobj3 = rb_funcall(zobj3, rb_intern("to_f"), 0);
80
+ }
81
+
82
+ i_xobj3 = (real)NUM2DBL(xobj3);
83
+ i_yobj3 = (real)NUM2DBL(yobj3);
84
+ i_zobj3 = (real)NUM2DBL(zobj3);
85
+
86
+
87
+ scsobj_(&i_xobj3, &i_yobj3, &i_zobj3);
88
+
89
+ return Qnil;
90
+
91
+ }
92
+
93
+ static VALUE
94
+ dcl_scqobj(obj)
95
+ VALUE obj;
96
+ {
97
+ real o_xobj3;
98
+ real o_yobj3;
99
+ real o_zobj3;
100
+ VALUE xobj3;
101
+ VALUE yobj3;
102
+ VALUE zobj3;
103
+
104
+ scqobj_(&o_xobj3, &o_yobj3, &o_zobj3);
105
+
106
+ xobj3 = rb_float_new((double)o_xobj3);
107
+ yobj3 = rb_float_new((double)o_yobj3);
108
+ zobj3 = rb_float_new((double)o_zobj3);
109
+
110
+
111
+ return rb_ary_new3(3, xobj3, yobj3, zobj3);
112
+
113
+ }
114
+
115
+ static VALUE
116
+ dcl_scseye(obj, xeye3, yeye3, zeye3)
117
+ VALUE obj, xeye3, yeye3, zeye3;
118
+ {
119
+ real i_xeye3;
120
+ real i_yeye3;
121
+ real i_zeye3;
122
+
123
+ if (TYPE(xeye3) != T_FLOAT) {
124
+ xeye3 = rb_funcall(xeye3, rb_intern("to_f"), 0);
125
+ }
126
+ if (TYPE(yeye3) != T_FLOAT) {
127
+ yeye3 = rb_funcall(yeye3, rb_intern("to_f"), 0);
128
+ }
129
+ if (TYPE(zeye3) != T_FLOAT) {
130
+ zeye3 = rb_funcall(zeye3, rb_intern("to_f"), 0);
131
+ }
132
+
133
+ i_xeye3 = (real)NUM2DBL(xeye3);
134
+ i_yeye3 = (real)NUM2DBL(yeye3);
135
+ i_zeye3 = (real)NUM2DBL(zeye3);
136
+
137
+
138
+ scseye_(&i_xeye3, &i_yeye3, &i_zeye3);
139
+
140
+ return Qnil;
141
+
142
+ }
143
+
144
+ static VALUE
145
+ dcl_scqeye(obj)
146
+ VALUE obj;
147
+ {
148
+ real o_xeye3;
149
+ real o_yeye3;
150
+ real o_zeye3;
151
+ VALUE xeye3;
152
+ VALUE yeye3;
153
+ VALUE zeye3;
154
+
155
+ scqeye_(&o_xeye3, &o_yeye3, &o_zeye3);
156
+
157
+ xeye3 = rb_float_new((double)o_xeye3);
158
+ yeye3 = rb_float_new((double)o_yeye3);
159
+ zeye3 = rb_float_new((double)o_zeye3);
160
+
161
+
162
+ return rb_ary_new3(3, xeye3, yeye3, zeye3);
163
+
164
+ }
165
+
166
+ static VALUE
167
+ dcl_scspln(obj, ixax, iyax, sect)
168
+ VALUE obj, ixax, iyax, sect;
169
+ {
170
+ integer i_ixax;
171
+ integer i_iyax;
172
+ real i_sect;
173
+
174
+ if ((TYPE(ixax) != T_BIGNUM) || (TYPE(ixax) != T_FIXNUM)) {
175
+ ixax = rb_funcall(ixax, rb_intern("to_i"), 0);
176
+ }
177
+ if ((TYPE(iyax) != T_BIGNUM) || (TYPE(iyax) != T_FIXNUM)) {
178
+ iyax = rb_funcall(iyax, rb_intern("to_i"), 0);
179
+ }
180
+ if (TYPE(sect) != T_FLOAT) {
181
+ sect = rb_funcall(sect, rb_intern("to_f"), 0);
182
+ }
183
+
184
+ i_ixax = NUM2INT(ixax);
185
+ i_iyax = NUM2INT(iyax);
186
+ i_sect = (real)NUM2DBL(sect);
187
+
188
+
189
+ scspln_(&i_ixax, &i_iyax, &i_sect);
190
+
191
+ return Qnil;
192
+
193
+ }
194
+
195
+ static VALUE
196
+ dcl_scqpln(obj)
197
+ VALUE obj;
198
+ {
199
+ integer o_ixax;
200
+ integer o_iyax;
201
+ real o_sect;
202
+ VALUE ixax;
203
+ VALUE iyax;
204
+ VALUE sect;
205
+
206
+ scqpln_(&o_ixax, &o_iyax, &o_sect);
207
+
208
+ ixax = INT2NUM(o_ixax);
209
+ iyax = INT2NUM(o_iyax);
210
+ sect = rb_float_new((double)o_sect);
211
+
212
+
213
+ return rb_ary_new3(3, ixax, iyax, sect);
214
+
215
+ }
216
+
217
+ static VALUE
218
+ dcl_scsprj(obj)
219
+ VALUE obj;
220
+ {
221
+ scsprj_();
222
+
223
+ return Qnil;
224
+
225
+ }
226
+
227
+ static VALUE
228
+ dcl_scsvpt(obj, vxmin, vxmax, vymin, vymax, vzmin, vzmax)
229
+ VALUE obj, vxmin, vxmax, vymin, vymax, vzmin, vzmax;
230
+ {
231
+ real i_vxmin;
232
+ real i_vxmax;
233
+ real i_vymin;
234
+ real i_vymax;
235
+ real i_vzmin;
236
+ real i_vzmax;
237
+
238
+ if (TYPE(vxmin) != T_FLOAT) {
239
+ vxmin = rb_funcall(vxmin, rb_intern("to_f"), 0);
240
+ }
241
+ if (TYPE(vxmax) != T_FLOAT) {
242
+ vxmax = rb_funcall(vxmax, rb_intern("to_f"), 0);
243
+ }
244
+ if (TYPE(vymin) != T_FLOAT) {
245
+ vymin = rb_funcall(vymin, rb_intern("to_f"), 0);
246
+ }
247
+ if (TYPE(vymax) != T_FLOAT) {
248
+ vymax = rb_funcall(vymax, rb_intern("to_f"), 0);
249
+ }
250
+ if (TYPE(vzmin) != T_FLOAT) {
251
+ vzmin = rb_funcall(vzmin, rb_intern("to_f"), 0);
252
+ }
253
+ if (TYPE(vzmax) != T_FLOAT) {
254
+ vzmax = rb_funcall(vzmax, rb_intern("to_f"), 0);
255
+ }
256
+
257
+ i_vxmin = (real)NUM2DBL(vxmin);
258
+ i_vxmax = (real)NUM2DBL(vxmax);
259
+ i_vymin = (real)NUM2DBL(vymin);
260
+ i_vymax = (real)NUM2DBL(vymax);
261
+ i_vzmin = (real)NUM2DBL(vzmin);
262
+ i_vzmax = (real)NUM2DBL(vzmax);
263
+
264
+
265
+ scsvpt_(&i_vxmin, &i_vxmax, &i_vymin, &i_vymax, &i_vzmin, &i_vzmax);
266
+
267
+ return Qnil;
268
+
269
+ }
270
+
271
+ static VALUE
272
+ dcl_scqvpt(obj)
273
+ VALUE obj;
274
+ {
275
+ real o_vxmin;
276
+ real o_vxmax;
277
+ real o_vymin;
278
+ real o_vymax;
279
+ real o_vzmin;
280
+ real o_vzmax;
281
+ VALUE vxmin;
282
+ VALUE vxmax;
283
+ VALUE vymin;
284
+ VALUE vymax;
285
+ VALUE vzmin;
286
+ VALUE vzmax;
287
+
288
+ scqvpt_(&o_vxmin, &o_vxmax, &o_vymin, &o_vymax, &o_vzmin, &o_vzmax);
289
+
290
+ vxmin = rb_float_new((double)o_vxmin);
291
+ vxmax = rb_float_new((double)o_vxmax);
292
+ vymin = rb_float_new((double)o_vymin);
293
+ vymax = rb_float_new((double)o_vymax);
294
+ vzmin = rb_float_new((double)o_vzmin);
295
+ vzmax = rb_float_new((double)o_vzmax);
296
+
297
+
298
+ return rb_ary_new3(6, vxmin, vxmax, vymin, vymax, vzmin, vzmax);
299
+
300
+ }
301
+
302
+ static VALUE
303
+ dcl_scswnd(obj, uxmin, uxmax, uymin, uymax, uzmin, uzmax)
304
+ VALUE obj, uxmin, uxmax, uymin, uymax, uzmin, uzmax;
305
+ {
306
+ real i_uxmin;
307
+ real i_uxmax;
308
+ real i_uymin;
309
+ real i_uymax;
310
+ real i_uzmin;
311
+ real i_uzmax;
312
+
313
+ if (TYPE(uxmin) != T_FLOAT) {
314
+ uxmin = rb_funcall(uxmin, rb_intern("to_f"), 0);
315
+ }
316
+ if (TYPE(uxmax) != T_FLOAT) {
317
+ uxmax = rb_funcall(uxmax, rb_intern("to_f"), 0);
318
+ }
319
+ if (TYPE(uymin) != T_FLOAT) {
320
+ uymin = rb_funcall(uymin, rb_intern("to_f"), 0);
321
+ }
322
+ if (TYPE(uymax) != T_FLOAT) {
323
+ uymax = rb_funcall(uymax, rb_intern("to_f"), 0);
324
+ }
325
+ if (TYPE(uzmin) != T_FLOAT) {
326
+ uzmin = rb_funcall(uzmin, rb_intern("to_f"), 0);
327
+ }
328
+ if (TYPE(uzmax) != T_FLOAT) {
329
+ uzmax = rb_funcall(uzmax, rb_intern("to_f"), 0);
330
+ }
331
+
332
+ i_uxmin = (real)NUM2DBL(uxmin);
333
+ i_uxmax = (real)NUM2DBL(uxmax);
334
+ i_uymin = (real)NUM2DBL(uymin);
335
+ i_uymax = (real)NUM2DBL(uymax);
336
+ i_uzmin = (real)NUM2DBL(uzmin);
337
+ i_uzmax = (real)NUM2DBL(uzmax);
338
+
339
+
340
+ scswnd_(&i_uxmin, &i_uxmax, &i_uymin, &i_uymax, &i_uzmin, &i_uzmax);
341
+
342
+ return Qnil;
343
+
344
+ }
345
+
346
+ static VALUE
347
+ dcl_scqwnd(obj)
348
+ VALUE obj;
349
+ {
350
+ real o_uxmin;
351
+ real o_uxmax;
352
+ real o_uymin;
353
+ real o_uymax;
354
+ real o_uzmin;
355
+ real o_uzmax;
356
+ VALUE uxmin;
357
+ VALUE uxmax;
358
+ VALUE uymin;
359
+ VALUE uymax;
360
+ VALUE uzmin;
361
+ VALUE uzmax;
362
+
363
+ scqwnd_(&o_uxmin, &o_uxmax, &o_uymin, &o_uymax, &o_uzmin, &o_uzmax);
364
+
365
+ uxmin = rb_float_new((double)o_uxmin);
366
+ uxmax = rb_float_new((double)o_uxmax);
367
+ uymin = rb_float_new((double)o_uymin);
368
+ uymax = rb_float_new((double)o_uymax);
369
+ uzmin = rb_float_new((double)o_uzmin);
370
+ uzmax = rb_float_new((double)o_uzmax);
371
+
372
+
373
+ return rb_ary_new3(6, uxmin, uxmax, uymin, uymax, uzmin, uzmax);
374
+
375
+ }
376
+
377
+ static VALUE
378
+ dcl_scslog(obj, lxlog3, lylog3, lzlog3)
379
+ VALUE obj, lxlog3, lylog3, lzlog3;
380
+ {
381
+ logical i_lxlog3;
382
+ logical i_lylog3;
383
+ logical i_lzlog3;
384
+
385
+ i_lxlog3 = ((lxlog3 == Qnil)||(lxlog3 == Qfalse)) ? FALSE_ : TRUE_;
386
+ i_lylog3 = ((lylog3 == Qnil)||(lylog3 == Qfalse)) ? FALSE_ : TRUE_;
387
+ i_lzlog3 = ((lzlog3 == Qnil)||(lzlog3 == Qfalse)) ? FALSE_ : TRUE_;
388
+
389
+
390
+ scslog_(&i_lxlog3, &i_lylog3, &i_lzlog3);
391
+
392
+ return Qnil;
393
+
394
+ }
395
+
396
+ static VALUE
397
+ dcl_scqlog(obj)
398
+ VALUE obj;
399
+ {
400
+ logical o_lxlog3;
401
+ logical o_lylog3;
402
+ logical o_lzlog3;
403
+ VALUE lxlog3;
404
+ VALUE lylog3;
405
+ VALUE lzlog3;
406
+
407
+ scqlog_(&o_lxlog3, &o_lylog3, &o_lzlog3);
408
+
409
+ lxlog3 = (o_lxlog3 == FALSE_) ? Qfalse : Qtrue;
410
+ lylog3 = (o_lylog3 == FALSE_) ? Qfalse : Qtrue;
411
+ lzlog3 = (o_lzlog3 == FALSE_) ? Qfalse : Qtrue;
412
+
413
+
414
+ return rb_ary_new3(3, lxlog3, lylog3, lzlog3);
415
+
416
+ }
417
+
418
+ static VALUE
419
+ dcl_scsorg(obj, simfac, vxorg3, vyorg3, vzorg3)
420
+ VALUE obj, simfac, vxorg3, vyorg3, vzorg3;
421
+ {
422
+ real i_simfac;
423
+ real i_vxorg3;
424
+ real i_vyorg3;
425
+ real i_vzorg3;
426
+
427
+ if (TYPE(simfac) != T_FLOAT) {
428
+ simfac = rb_funcall(simfac, rb_intern("to_f"), 0);
429
+ }
430
+ if (TYPE(vxorg3) != T_FLOAT) {
431
+ vxorg3 = rb_funcall(vxorg3, rb_intern("to_f"), 0);
432
+ }
433
+ if (TYPE(vyorg3) != T_FLOAT) {
434
+ vyorg3 = rb_funcall(vyorg3, rb_intern("to_f"), 0);
435
+ }
436
+ if (TYPE(vzorg3) != T_FLOAT) {
437
+ vzorg3 = rb_funcall(vzorg3, rb_intern("to_f"), 0);
438
+ }
439
+
440
+ i_simfac = (real)NUM2DBL(simfac);
441
+ i_vxorg3 = (real)NUM2DBL(vxorg3);
442
+ i_vyorg3 = (real)NUM2DBL(vyorg3);
443
+ i_vzorg3 = (real)NUM2DBL(vzorg3);
444
+
445
+
446
+ scsorg_(&i_simfac, &i_vxorg3, &i_vyorg3, &i_vzorg3);
447
+
448
+ return Qnil;
449
+
450
+ }
451
+
452
+ static VALUE
453
+ dcl_scqorg(obj)
454
+ VALUE obj;
455
+ {
456
+ real o_simfac;
457
+ real o_vxorg3;
458
+ real o_vyorg3;
459
+ real o_vzorg3;
460
+ VALUE simfac;
461
+ VALUE vxorg3;
462
+ VALUE vyorg3;
463
+ VALUE vzorg3;
464
+
465
+ scqorg_(&o_simfac, &o_vxorg3, &o_vyorg3, &o_vzorg3);
466
+
467
+ simfac = rb_float_new((double)o_simfac);
468
+ vxorg3 = rb_float_new((double)o_vxorg3);
469
+ vyorg3 = rb_float_new((double)o_vyorg3);
470
+ vzorg3 = rb_float_new((double)o_vzorg3);
471
+
472
+
473
+ return rb_ary_new3(4, simfac, vxorg3, vyorg3, vzorg3);
474
+
475
+ }
476
+
477
+ static VALUE
478
+ dcl_scstrn(obj, itr3)
479
+ VALUE obj, itr3;
480
+ {
481
+ integer i_itr3;
482
+
483
+ if ((TYPE(itr3) != T_BIGNUM) || (TYPE(itr3) != T_FIXNUM)) {
484
+ itr3 = rb_funcall(itr3, rb_intern("to_i"), 0);
485
+ }
486
+
487
+ i_itr3 = NUM2INT(itr3);
488
+
489
+
490
+ scstrn_(&i_itr3);
491
+
492
+ return Qnil;
493
+
494
+ }
495
+
496
+ static VALUE
497
+ dcl_scqtrn(obj)
498
+ VALUE obj;
499
+ {
500
+ integer o_itr3;
501
+ VALUE itr3;
502
+
503
+ scqtrn_(&o_itr3);
504
+
505
+ itr3 = INT2NUM(o_itr3);
506
+
507
+
508
+ return itr3;
509
+
510
+ }
511
+
512
+ static VALUE
513
+ dcl_scstrf(obj)
514
+ VALUE obj;
515
+ {
516
+ scstrf_();
517
+
518
+ return Qnil;
519
+
520
+ }
521
+
522
+ static VALUE
523
+ dcl_scplu(obj, n, upx, upy, upz)
524
+ VALUE obj, n, upx, upy, upz;
525
+ {
526
+ integer i_n;
527
+ real *i_upx;
528
+ real *i_upy;
529
+ real *i_upz;
530
+
531
+ if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
532
+ n = rb_funcall(n, rb_intern("to_i"), 0);
533
+ }
534
+ if (TYPE(upx) == T_FLOAT) {
535
+ upx = rb_Array(upx);
536
+ }
537
+ /* if ((TYPE(upx) != T_ARRAY) &&
538
+ (rb_obj_is_kind_of(upx, cNArray) != Qtrue)) {
539
+ rb_raise(rb_eTypeError, "invalid type");
540
+ } -- no check since obj2c*ary will do that */
541
+ if (TYPE(upy) == T_FLOAT) {
542
+ upy = rb_Array(upy);
543
+ }
544
+ /* if ((TYPE(upy) != T_ARRAY) &&
545
+ (rb_obj_is_kind_of(upy, cNArray) != Qtrue)) {
546
+ rb_raise(rb_eTypeError, "invalid type");
547
+ } -- no check since obj2c*ary will do that */
548
+ if (TYPE(upz) == T_FLOAT) {
549
+ upz = rb_Array(upz);
550
+ }
551
+ /* if ((TYPE(upz) != T_ARRAY) &&
552
+ (rb_obj_is_kind_of(upz, cNArray) != Qtrue)) {
553
+ rb_raise(rb_eTypeError, "invalid type");
554
+ } -- no check since obj2c*ary will do that */
555
+
556
+ i_n = NUM2INT(n);
557
+ i_upx = dcl_obj2crealary(upx);
558
+ i_upy = dcl_obj2crealary(upy);
559
+ i_upz = dcl_obj2crealary(upz);
560
+
561
+
562
+ scplu_(&i_n, i_upx, i_upy, i_upz);
563
+
564
+ dcl_freecrealary(i_upx);
565
+ dcl_freecrealary(i_upy);
566
+ dcl_freecrealary(i_upz);
567
+
568
+ return Qnil;
569
+
570
+ }
571
+
572
+ static VALUE
573
+ dcl_scplv(obj, n, vpx, vpy, vpz)
574
+ VALUE obj, n, vpx, vpy, vpz;
575
+ {
576
+ integer i_n;
577
+ real *i_vpx;
578
+ real *i_vpy;
579
+ real *i_vpz;
580
+
581
+ if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
582
+ n = rb_funcall(n, rb_intern("to_i"), 0);
583
+ }
584
+ if (TYPE(vpx) == T_FLOAT) {
585
+ vpx = rb_Array(vpx);
586
+ }
587
+ /* if ((TYPE(vpx) != T_ARRAY) &&
588
+ (rb_obj_is_kind_of(vpx, cNArray) != Qtrue)) {
589
+ rb_raise(rb_eTypeError, "invalid type");
590
+ } -- no check since obj2c*ary will do that */
591
+ if (TYPE(vpy) == T_FLOAT) {
592
+ vpy = rb_Array(vpy);
593
+ }
594
+ /* if ((TYPE(vpy) != T_ARRAY) &&
595
+ (rb_obj_is_kind_of(vpy, cNArray) != Qtrue)) {
596
+ rb_raise(rb_eTypeError, "invalid type");
597
+ } -- no check since obj2c*ary will do that */
598
+ if (TYPE(vpz) == T_FLOAT) {
599
+ vpz = rb_Array(vpz);
600
+ }
601
+ /* if ((TYPE(vpz) != T_ARRAY) &&
602
+ (rb_obj_is_kind_of(vpz, cNArray) != Qtrue)) {
603
+ rb_raise(rb_eTypeError, "invalid type");
604
+ } -- no check since obj2c*ary will do that */
605
+
606
+ i_n = NUM2INT(n);
607
+ i_vpx = dcl_obj2crealary(vpx);
608
+ i_vpy = dcl_obj2crealary(vpy);
609
+ i_vpz = dcl_obj2crealary(vpz);
610
+
611
+
612
+ scplv_(&i_n, i_vpx, i_vpy, i_vpz);
613
+
614
+ dcl_freecrealary(i_vpx);
615
+ dcl_freecrealary(i_vpy);
616
+ dcl_freecrealary(i_vpz);
617
+
618
+ return Qnil;
619
+
620
+ }
621
+
622
+ static VALUE
623
+ dcl_scspli(obj, index)
624
+ VALUE obj, index;
625
+ {
626
+ integer i_index;
627
+
628
+ if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
629
+ index = rb_funcall(index, rb_intern("to_i"), 0);
630
+ }
631
+
632
+ i_index = NUM2INT(index);
633
+
634
+
635
+ scspli_(&i_index);
636
+
637
+ return Qnil;
638
+
639
+ }
640
+
641
+ static VALUE
642
+ dcl_scqpli(obj)
643
+ VALUE obj;
644
+ {
645
+ integer o_index;
646
+ VALUE index;
647
+
648
+ scqpli_(&o_index);
649
+
650
+ index = INT2NUM(o_index);
651
+
652
+
653
+ return index;
654
+
655
+ }
656
+
657
+ static VALUE
658
+ dcl_scplzu(obj, n, upx, upy, upz, index)
659
+ VALUE obj, n, upx, upy, upz, index;
660
+ {
661
+ integer i_n;
662
+ real *i_upx;
663
+ real *i_upy;
664
+ real *i_upz;
665
+ integer i_index;
666
+
667
+ if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
668
+ n = rb_funcall(n, rb_intern("to_i"), 0);
669
+ }
670
+ if (TYPE(upx) == T_FLOAT) {
671
+ upx = rb_Array(upx);
672
+ }
673
+ /* if ((TYPE(upx) != T_ARRAY) &&
674
+ (rb_obj_is_kind_of(upx, cNArray) != Qtrue)) {
675
+ rb_raise(rb_eTypeError, "invalid type");
676
+ } -- no check since obj2c*ary will do that */
677
+ if (TYPE(upy) == T_FLOAT) {
678
+ upy = rb_Array(upy);
679
+ }
680
+ /* if ((TYPE(upy) != T_ARRAY) &&
681
+ (rb_obj_is_kind_of(upy, cNArray) != Qtrue)) {
682
+ rb_raise(rb_eTypeError, "invalid type");
683
+ } -- no check since obj2c*ary will do that */
684
+ if (TYPE(upz) == T_FLOAT) {
685
+ upz = rb_Array(upz);
686
+ }
687
+ /* if ((TYPE(upz) != T_ARRAY) &&
688
+ (rb_obj_is_kind_of(upz, cNArray) != Qtrue)) {
689
+ rb_raise(rb_eTypeError, "invalid type");
690
+ } -- no check since obj2c*ary will do that */
691
+ if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
692
+ index = rb_funcall(index, rb_intern("to_i"), 0);
693
+ }
694
+
695
+ i_n = NUM2INT(n);
696
+ i_index = NUM2INT(index);
697
+ i_upx = dcl_obj2crealary(upx);
698
+ i_upy = dcl_obj2crealary(upy);
699
+ i_upz = dcl_obj2crealary(upz);
700
+
701
+
702
+ scplzu_(&i_n, i_upx, i_upy, i_upz, &i_index);
703
+
704
+ dcl_freecrealary(i_upx);
705
+ dcl_freecrealary(i_upy);
706
+ dcl_freecrealary(i_upz);
707
+
708
+ return Qnil;
709
+
710
+ }
711
+
712
+ static VALUE
713
+ dcl_scplzv(obj, n, vpx, vpy, vpz, index)
714
+ VALUE obj, n, vpx, vpy, vpz, index;
715
+ {
716
+ integer i_n;
717
+ real *i_vpx;
718
+ real *i_vpy;
719
+ real *i_vpz;
720
+ integer i_index;
721
+
722
+ if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
723
+ n = rb_funcall(n, rb_intern("to_i"), 0);
724
+ }
725
+ if (TYPE(vpx) == T_FLOAT) {
726
+ vpx = rb_Array(vpx);
727
+ }
728
+ /* if ((TYPE(vpx) != T_ARRAY) &&
729
+ (rb_obj_is_kind_of(vpx, cNArray) != Qtrue)) {
730
+ rb_raise(rb_eTypeError, "invalid type");
731
+ } -- no check since obj2c*ary will do that */
732
+ if (TYPE(vpy) == T_FLOAT) {
733
+ vpy = rb_Array(vpy);
734
+ }
735
+ /* if ((TYPE(vpy) != T_ARRAY) &&
736
+ (rb_obj_is_kind_of(vpy, cNArray) != Qtrue)) {
737
+ rb_raise(rb_eTypeError, "invalid type");
738
+ } -- no check since obj2c*ary will do that */
739
+ if (TYPE(vpz) == T_FLOAT) {
740
+ vpz = rb_Array(vpz);
741
+ }
742
+ /* if ((TYPE(vpz) != T_ARRAY) &&
743
+ (rb_obj_is_kind_of(vpz, cNArray) != Qtrue)) {
744
+ rb_raise(rb_eTypeError, "invalid type");
745
+ } -- no check since obj2c*ary will do that */
746
+ if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
747
+ index = rb_funcall(index, rb_intern("to_i"), 0);
748
+ }
749
+
750
+ i_n = NUM2INT(n);
751
+ i_index = NUM2INT(index);
752
+ i_vpx = dcl_obj2crealary(vpx);
753
+ i_vpy = dcl_obj2crealary(vpy);
754
+ i_vpz = dcl_obj2crealary(vpz);
755
+
756
+
757
+ scplzv_(&i_n, i_vpx, i_vpy, i_vpz, &i_index);
758
+
759
+ dcl_freecrealary(i_vpx);
760
+ dcl_freecrealary(i_vpy);
761
+ dcl_freecrealary(i_vpz);
762
+
763
+ return Qnil;
764
+
765
+ }
766
+
767
+ static VALUE
768
+ dcl_scpmu(obj, n, upx, upy, upz)
769
+ VALUE obj, n, upx, upy, upz;
770
+ {
771
+ integer i_n;
772
+ real *i_upx;
773
+ real *i_upy;
774
+ real *i_upz;
775
+
776
+ if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
777
+ n = rb_funcall(n, rb_intern("to_i"), 0);
778
+ }
779
+ if (TYPE(upx) == T_FLOAT) {
780
+ upx = rb_Array(upx);
781
+ }
782
+ /* if ((TYPE(upx) != T_ARRAY) &&
783
+ (rb_obj_is_kind_of(upx, cNArray) != Qtrue)) {
784
+ rb_raise(rb_eTypeError, "invalid type");
785
+ } -- no check since obj2c*ary will do that */
786
+ if (TYPE(upy) == T_FLOAT) {
787
+ upy = rb_Array(upy);
788
+ }
789
+ /* if ((TYPE(upy) != T_ARRAY) &&
790
+ (rb_obj_is_kind_of(upy, cNArray) != Qtrue)) {
791
+ rb_raise(rb_eTypeError, "invalid type");
792
+ } -- no check since obj2c*ary will do that */
793
+ if (TYPE(upz) == T_FLOAT) {
794
+ upz = rb_Array(upz);
795
+ }
796
+ /* if ((TYPE(upz) != T_ARRAY) &&
797
+ (rb_obj_is_kind_of(upz, cNArray) != Qtrue)) {
798
+ rb_raise(rb_eTypeError, "invalid type");
799
+ } -- no check since obj2c*ary will do that */
800
+
801
+ i_n = NUM2INT(n);
802
+ i_upx = dcl_obj2crealary(upx);
803
+ i_upy = dcl_obj2crealary(upy);
804
+ i_upz = dcl_obj2crealary(upz);
805
+
806
+
807
+ scpmu_(&i_n, i_upx, i_upy, i_upz);
808
+
809
+ dcl_freecrealary(i_upx);
810
+ dcl_freecrealary(i_upy);
811
+ dcl_freecrealary(i_upz);
812
+
813
+ return Qnil;
814
+
815
+ }
816
+
817
+ static VALUE
818
+ dcl_scpmv(obj, n, vpx, vpy, vpz)
819
+ VALUE obj, n, vpx, vpy, vpz;
820
+ {
821
+ integer i_n;
822
+ real *i_vpx;
823
+ real *i_vpy;
824
+ real *i_vpz;
825
+
826
+ if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
827
+ n = rb_funcall(n, rb_intern("to_i"), 0);
828
+ }
829
+ if (TYPE(vpx) == T_FLOAT) {
830
+ vpx = rb_Array(vpx);
831
+ }
832
+ /* if ((TYPE(vpx) != T_ARRAY) &&
833
+ (rb_obj_is_kind_of(vpx, cNArray) != Qtrue)) {
834
+ rb_raise(rb_eTypeError, "invalid type");
835
+ } -- no check since obj2c*ary will do that */
836
+ if (TYPE(vpy) == T_FLOAT) {
837
+ vpy = rb_Array(vpy);
838
+ }
839
+ /* if ((TYPE(vpy) != T_ARRAY) &&
840
+ (rb_obj_is_kind_of(vpy, cNArray) != Qtrue)) {
841
+ rb_raise(rb_eTypeError, "invalid type");
842
+ } -- no check since obj2c*ary will do that */
843
+ if (TYPE(vpz) == T_FLOAT) {
844
+ vpz = rb_Array(vpz);
845
+ }
846
+ /* if ((TYPE(vpz) != T_ARRAY) &&
847
+ (rb_obj_is_kind_of(vpz, cNArray) != Qtrue)) {
848
+ rb_raise(rb_eTypeError, "invalid type");
849
+ } -- no check since obj2c*ary will do that */
850
+
851
+ i_n = NUM2INT(n);
852
+ i_vpx = dcl_obj2crealary(vpx);
853
+ i_vpy = dcl_obj2crealary(vpy);
854
+ i_vpz = dcl_obj2crealary(vpz);
855
+
856
+
857
+ scpmv_(&i_n, i_vpx, i_vpy, i_vpz);
858
+
859
+ dcl_freecrealary(i_vpx);
860
+ dcl_freecrealary(i_vpy);
861
+ dcl_freecrealary(i_vpz);
862
+
863
+ return Qnil;
864
+
865
+ }
866
+
867
+ static VALUE
868
+ dcl_scspmt(obj, itype)
869
+ VALUE obj, itype;
870
+ {
871
+ integer i_itype;
872
+
873
+ if ((TYPE(itype) != T_BIGNUM) || (TYPE(itype) != T_FIXNUM)) {
874
+ itype = rb_funcall(itype, rb_intern("to_i"), 0);
875
+ }
876
+
877
+ i_itype = NUM2INT(itype);
878
+
879
+
880
+ scspmt_(&i_itype);
881
+
882
+ return Qnil;
883
+
884
+ }
885
+
886
+ static VALUE
887
+ dcl_scqpmt(obj)
888
+ VALUE obj;
889
+ {
890
+ integer o_itype;
891
+ VALUE itype;
892
+
893
+ scqpmt_(&o_itype);
894
+
895
+ itype = INT2NUM(o_itype);
896
+
897
+
898
+ return itype;
899
+
900
+ }
901
+
902
+ static VALUE
903
+ dcl_scspmi(obj, index)
904
+ VALUE obj, index;
905
+ {
906
+ integer i_index;
907
+
908
+ if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
909
+ index = rb_funcall(index, rb_intern("to_i"), 0);
910
+ }
911
+
912
+ i_index = NUM2INT(index);
913
+
914
+
915
+ scspmi_(&i_index);
916
+
917
+ return Qnil;
918
+
919
+ }
920
+
921
+ static VALUE
922
+ dcl_scqpmi(obj)
923
+ VALUE obj;
924
+ {
925
+ integer o_index;
926
+ VALUE index;
927
+
928
+ scqpmi_(&o_index);
929
+
930
+ index = INT2NUM(o_index);
931
+
932
+
933
+ return index;
934
+
935
+ }
936
+
937
+ static VALUE
938
+ dcl_scspms(obj, rsize)
939
+ VALUE obj, rsize;
940
+ {
941
+ real i_rsize;
942
+
943
+ if (TYPE(rsize) != T_FLOAT) {
944
+ rsize = rb_funcall(rsize, rb_intern("to_f"), 0);
945
+ }
946
+
947
+ i_rsize = (real)NUM2DBL(rsize);
948
+
949
+
950
+ scspms_(&i_rsize);
951
+
952
+ return Qnil;
953
+
954
+ }
955
+
956
+ static VALUE
957
+ dcl_scqpms(obj)
958
+ VALUE obj;
959
+ {
960
+ real o_rsize;
961
+ VALUE rsize;
962
+
963
+ scqpms_(&o_rsize);
964
+
965
+ rsize = rb_float_new((double)o_rsize);
966
+
967
+
968
+ return rsize;
969
+
970
+ }
971
+
972
+ static VALUE
973
+ dcl_scpmzu(obj, n, upx, upy, upz, itype, index, rsize)
974
+ VALUE obj, n, upx, upy, upz, itype, index, rsize;
975
+ {
976
+ integer i_n;
977
+ real *i_upx;
978
+ real *i_upy;
979
+ real *i_upz;
980
+ integer i_itype;
981
+ integer i_index;
982
+ real i_rsize;
983
+
984
+ if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
985
+ n = rb_funcall(n, rb_intern("to_i"), 0);
986
+ }
987
+ if (TYPE(upx) == T_FLOAT) {
988
+ upx = rb_Array(upx);
989
+ }
990
+ /* if ((TYPE(upx) != T_ARRAY) &&
991
+ (rb_obj_is_kind_of(upx, cNArray) != Qtrue)) {
992
+ rb_raise(rb_eTypeError, "invalid type");
993
+ } -- no check since obj2c*ary will do that */
994
+ if (TYPE(upy) == T_FLOAT) {
995
+ upy = rb_Array(upy);
996
+ }
997
+ /* if ((TYPE(upy) != T_ARRAY) &&
998
+ (rb_obj_is_kind_of(upy, cNArray) != Qtrue)) {
999
+ rb_raise(rb_eTypeError, "invalid type");
1000
+ } -- no check since obj2c*ary will do that */
1001
+ if (TYPE(upz) == T_FLOAT) {
1002
+ upz = rb_Array(upz);
1003
+ }
1004
+ /* if ((TYPE(upz) != T_ARRAY) &&
1005
+ (rb_obj_is_kind_of(upz, cNArray) != Qtrue)) {
1006
+ rb_raise(rb_eTypeError, "invalid type");
1007
+ } -- no check since obj2c*ary will do that */
1008
+ if ((TYPE(itype) != T_BIGNUM) || (TYPE(itype) != T_FIXNUM)) {
1009
+ itype = rb_funcall(itype, rb_intern("to_i"), 0);
1010
+ }
1011
+ if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
1012
+ index = rb_funcall(index, rb_intern("to_i"), 0);
1013
+ }
1014
+ if (TYPE(rsize) != T_FLOAT) {
1015
+ rsize = rb_funcall(rsize, rb_intern("to_f"), 0);
1016
+ }
1017
+
1018
+ i_n = NUM2INT(n);
1019
+ i_itype = NUM2INT(itype);
1020
+ i_index = NUM2INT(index);
1021
+ i_rsize = (real)NUM2DBL(rsize);
1022
+ i_upx = dcl_obj2crealary(upx);
1023
+ i_upy = dcl_obj2crealary(upy);
1024
+ i_upz = dcl_obj2crealary(upz);
1025
+
1026
+
1027
+ scpmzu_(&i_n, i_upx, i_upy, i_upz, &i_itype, &i_index, &i_rsize);
1028
+
1029
+ dcl_freecrealary(i_upx);
1030
+ dcl_freecrealary(i_upy);
1031
+ dcl_freecrealary(i_upz);
1032
+
1033
+ return Qnil;
1034
+
1035
+ }
1036
+
1037
+ static VALUE
1038
+ dcl_scpmzv(obj, n, vpx, vpy, vpz, itype, index, rsize)
1039
+ VALUE obj, n, vpx, vpy, vpz, itype, index, rsize;
1040
+ {
1041
+ integer i_n;
1042
+ real *i_vpx;
1043
+ real *i_vpy;
1044
+ real *i_vpz;
1045
+ integer i_itype;
1046
+ integer i_index;
1047
+ real i_rsize;
1048
+
1049
+ if ((TYPE(n) != T_BIGNUM) || (TYPE(n) != T_FIXNUM)) {
1050
+ n = rb_funcall(n, rb_intern("to_i"), 0);
1051
+ }
1052
+ if (TYPE(vpx) == T_FLOAT) {
1053
+ vpx = rb_Array(vpx);
1054
+ }
1055
+ /* if ((TYPE(vpx) != T_ARRAY) &&
1056
+ (rb_obj_is_kind_of(vpx, cNArray) != Qtrue)) {
1057
+ rb_raise(rb_eTypeError, "invalid type");
1058
+ } -- no check since obj2c*ary will do that */
1059
+ if (TYPE(vpy) == T_FLOAT) {
1060
+ vpy = rb_Array(vpy);
1061
+ }
1062
+ /* if ((TYPE(vpy) != T_ARRAY) &&
1063
+ (rb_obj_is_kind_of(vpy, cNArray) != Qtrue)) {
1064
+ rb_raise(rb_eTypeError, "invalid type");
1065
+ } -- no check since obj2c*ary will do that */
1066
+ if (TYPE(vpz) == T_FLOAT) {
1067
+ vpz = rb_Array(vpz);
1068
+ }
1069
+ /* if ((TYPE(vpz) != T_ARRAY) &&
1070
+ (rb_obj_is_kind_of(vpz, cNArray) != Qtrue)) {
1071
+ rb_raise(rb_eTypeError, "invalid type");
1072
+ } -- no check since obj2c*ary will do that */
1073
+ if ((TYPE(itype) != T_BIGNUM) || (TYPE(itype) != T_FIXNUM)) {
1074
+ itype = rb_funcall(itype, rb_intern("to_i"), 0);
1075
+ }
1076
+ if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
1077
+ index = rb_funcall(index, rb_intern("to_i"), 0);
1078
+ }
1079
+ if (TYPE(rsize) != T_FLOAT) {
1080
+ rsize = rb_funcall(rsize, rb_intern("to_f"), 0);
1081
+ }
1082
+
1083
+ i_n = NUM2INT(n);
1084
+ i_itype = NUM2INT(itype);
1085
+ i_index = NUM2INT(index);
1086
+ i_rsize = (real)NUM2DBL(rsize);
1087
+ i_vpx = dcl_obj2crealary(vpx);
1088
+ i_vpy = dcl_obj2crealary(vpy);
1089
+ i_vpz = dcl_obj2crealary(vpz);
1090
+
1091
+
1092
+ scpmzv_(&i_n, i_vpx, i_vpy, i_vpz, &i_itype, &i_index, &i_rsize);
1093
+
1094
+ dcl_freecrealary(i_vpx);
1095
+ dcl_freecrealary(i_vpy);
1096
+ dcl_freecrealary(i_vpz);
1097
+
1098
+ return Qnil;
1099
+
1100
+ }
1101
+
1102
+ static VALUE
1103
+ dcl_sctnu(obj, upx, upy, upz)
1104
+ VALUE obj, upx, upy, upz;
1105
+ {
1106
+ real *i_upx;
1107
+ real *i_upy;
1108
+ real *i_upz;
1109
+
1110
+ if (TYPE(upx) == T_FLOAT) {
1111
+ upx = rb_Array(upx);
1112
+ }
1113
+ /* if ((TYPE(upx) != T_ARRAY) &&
1114
+ (rb_obj_is_kind_of(upx, cNArray) != Qtrue)) {
1115
+ rb_raise(rb_eTypeError, "invalid type");
1116
+ } -- no check since obj2c*ary will do that */
1117
+ if (TYPE(upy) == T_FLOAT) {
1118
+ upy = rb_Array(upy);
1119
+ }
1120
+ /* if ((TYPE(upy) != T_ARRAY) &&
1121
+ (rb_obj_is_kind_of(upy, cNArray) != Qtrue)) {
1122
+ rb_raise(rb_eTypeError, "invalid type");
1123
+ } -- no check since obj2c*ary will do that */
1124
+ if (TYPE(upz) == T_FLOAT) {
1125
+ upz = rb_Array(upz);
1126
+ }
1127
+ /* if ((TYPE(upz) != T_ARRAY) &&
1128
+ (rb_obj_is_kind_of(upz, cNArray) != Qtrue)) {
1129
+ rb_raise(rb_eTypeError, "invalid type");
1130
+ } -- no check since obj2c*ary will do that */
1131
+
1132
+ i_upx = dcl_obj2crealary(upx);
1133
+ i_upy = dcl_obj2crealary(upy);
1134
+ i_upz = dcl_obj2crealary(upz);
1135
+
1136
+
1137
+ sctnu_(i_upx, i_upy, i_upz);
1138
+
1139
+ dcl_freecrealary(i_upx);
1140
+ dcl_freecrealary(i_upy);
1141
+ dcl_freecrealary(i_upz);
1142
+
1143
+ return Qnil;
1144
+
1145
+ }
1146
+
1147
+ static VALUE
1148
+ dcl_sctnv(obj, vpx, vpy, vpz)
1149
+ VALUE obj, vpx, vpy, vpz;
1150
+ {
1151
+ real *i_vpx;
1152
+ real *i_vpy;
1153
+ real *i_vpz;
1154
+
1155
+ if (TYPE(vpx) == T_FLOAT) {
1156
+ vpx = rb_Array(vpx);
1157
+ }
1158
+ /* if ((TYPE(vpx) != T_ARRAY) &&
1159
+ (rb_obj_is_kind_of(vpx, cNArray) != Qtrue)) {
1160
+ rb_raise(rb_eTypeError, "invalid type");
1161
+ } -- no check since obj2c*ary will do that */
1162
+ if (TYPE(vpy) == T_FLOAT) {
1163
+ vpy = rb_Array(vpy);
1164
+ }
1165
+ /* if ((TYPE(vpy) != T_ARRAY) &&
1166
+ (rb_obj_is_kind_of(vpy, cNArray) != Qtrue)) {
1167
+ rb_raise(rb_eTypeError, "invalid type");
1168
+ } -- no check since obj2c*ary will do that */
1169
+ if (TYPE(vpz) == T_FLOAT) {
1170
+ vpz = rb_Array(vpz);
1171
+ }
1172
+ /* if ((TYPE(vpz) != T_ARRAY) &&
1173
+ (rb_obj_is_kind_of(vpz, cNArray) != Qtrue)) {
1174
+ rb_raise(rb_eTypeError, "invalid type");
1175
+ } -- no check since obj2c*ary will do that */
1176
+
1177
+ i_vpx = dcl_obj2crealary(vpx);
1178
+ i_vpy = dcl_obj2crealary(vpy);
1179
+ i_vpz = dcl_obj2crealary(vpz);
1180
+
1181
+
1182
+ sctnv_(i_vpx, i_vpy, i_vpz);
1183
+
1184
+ dcl_freecrealary(i_vpx);
1185
+ dcl_freecrealary(i_vpy);
1186
+ dcl_freecrealary(i_vpz);
1187
+
1188
+ return Qnil;
1189
+
1190
+ }
1191
+
1192
+ static VALUE
1193
+ dcl_scstnp(obj, itpat1, itpat2)
1194
+ VALUE obj, itpat1, itpat2;
1195
+ {
1196
+ integer i_itpat1;
1197
+ integer i_itpat2;
1198
+
1199
+ if ((TYPE(itpat1) != T_BIGNUM) || (TYPE(itpat1) != T_FIXNUM)) {
1200
+ itpat1 = rb_funcall(itpat1, rb_intern("to_i"), 0);
1201
+ }
1202
+ if ((TYPE(itpat2) != T_BIGNUM) || (TYPE(itpat2) != T_FIXNUM)) {
1203
+ itpat2 = rb_funcall(itpat2, rb_intern("to_i"), 0);
1204
+ }
1205
+
1206
+ i_itpat1 = NUM2INT(itpat1);
1207
+ i_itpat2 = NUM2INT(itpat2);
1208
+
1209
+
1210
+ scstnp_(&i_itpat1, &i_itpat2);
1211
+
1212
+ return Qnil;
1213
+
1214
+ }
1215
+
1216
+ static VALUE
1217
+ dcl_scqtnp(obj)
1218
+ VALUE obj;
1219
+ {
1220
+ integer o_itpat1;
1221
+ integer o_itpat2;
1222
+ VALUE itpat1;
1223
+ VALUE itpat2;
1224
+
1225
+ scqtnp_(&o_itpat1, &o_itpat2);
1226
+
1227
+ itpat1 = INT2NUM(o_itpat1);
1228
+ itpat2 = INT2NUM(o_itpat2);
1229
+
1230
+
1231
+ return rb_ary_new3(2, itpat1, itpat2);
1232
+
1233
+ }
1234
+
1235
+ static VALUE
1236
+ dcl_sctnzu(obj, upx, upy, upz, itpat1, itpat2)
1237
+ VALUE obj, upx, upy, upz, itpat1, itpat2;
1238
+ {
1239
+ real *i_upx;
1240
+ real *i_upy;
1241
+ real *i_upz;
1242
+ integer i_itpat1;
1243
+ integer i_itpat2;
1244
+
1245
+ if (TYPE(upx) == T_FLOAT) {
1246
+ upx = rb_Array(upx);
1247
+ }
1248
+ /* if ((TYPE(upx) != T_ARRAY) &&
1249
+ (rb_obj_is_kind_of(upx, cNArray) != Qtrue)) {
1250
+ rb_raise(rb_eTypeError, "invalid type");
1251
+ } -- no check since obj2c*ary will do that */
1252
+ if (TYPE(upy) == T_FLOAT) {
1253
+ upy = rb_Array(upy);
1254
+ }
1255
+ /* if ((TYPE(upy) != T_ARRAY) &&
1256
+ (rb_obj_is_kind_of(upy, cNArray) != Qtrue)) {
1257
+ rb_raise(rb_eTypeError, "invalid type");
1258
+ } -- no check since obj2c*ary will do that */
1259
+ if (TYPE(upz) == T_FLOAT) {
1260
+ upz = rb_Array(upz);
1261
+ }
1262
+ /* if ((TYPE(upz) != T_ARRAY) &&
1263
+ (rb_obj_is_kind_of(upz, cNArray) != Qtrue)) {
1264
+ rb_raise(rb_eTypeError, "invalid type");
1265
+ } -- no check since obj2c*ary will do that */
1266
+ if ((TYPE(itpat1) != T_BIGNUM) || (TYPE(itpat1) != T_FIXNUM)) {
1267
+ itpat1 = rb_funcall(itpat1, rb_intern("to_i"), 0);
1268
+ }
1269
+ if ((TYPE(itpat2) != T_BIGNUM) || (TYPE(itpat2) != T_FIXNUM)) {
1270
+ itpat2 = rb_funcall(itpat2, rb_intern("to_i"), 0);
1271
+ }
1272
+
1273
+ i_itpat1 = NUM2INT(itpat1);
1274
+ i_itpat2 = NUM2INT(itpat2);
1275
+ i_upx = dcl_obj2crealary(upx);
1276
+ i_upy = dcl_obj2crealary(upy);
1277
+ i_upz = dcl_obj2crealary(upz);
1278
+
1279
+
1280
+ sctnzu_(i_upx, i_upy, i_upz, &i_itpat1, &i_itpat2);
1281
+
1282
+ dcl_freecrealary(i_upx);
1283
+ dcl_freecrealary(i_upy);
1284
+ dcl_freecrealary(i_upz);
1285
+
1286
+ return Qnil;
1287
+
1288
+ }
1289
+
1290
+ static VALUE
1291
+ dcl_sctnzv(obj, vpx, vpy, vpz, itpat1, itpat2)
1292
+ VALUE obj, vpx, vpy, vpz, itpat1, itpat2;
1293
+ {
1294
+ real *i_vpx;
1295
+ real *i_vpy;
1296
+ real *i_vpz;
1297
+ integer i_itpat1;
1298
+ integer i_itpat2;
1299
+
1300
+ if (TYPE(vpx) == T_FLOAT) {
1301
+ vpx = rb_Array(vpx);
1302
+ }
1303
+ /* if ((TYPE(vpx) != T_ARRAY) &&
1304
+ (rb_obj_is_kind_of(vpx, cNArray) != Qtrue)) {
1305
+ rb_raise(rb_eTypeError, "invalid type");
1306
+ } -- no check since obj2c*ary will do that */
1307
+ if (TYPE(vpy) == T_FLOAT) {
1308
+ vpy = rb_Array(vpy);
1309
+ }
1310
+ /* if ((TYPE(vpy) != T_ARRAY) &&
1311
+ (rb_obj_is_kind_of(vpy, cNArray) != Qtrue)) {
1312
+ rb_raise(rb_eTypeError, "invalid type");
1313
+ } -- no check since obj2c*ary will do that */
1314
+ if (TYPE(vpz) == T_FLOAT) {
1315
+ vpz = rb_Array(vpz);
1316
+ }
1317
+ /* if ((TYPE(vpz) != T_ARRAY) &&
1318
+ (rb_obj_is_kind_of(vpz, cNArray) != Qtrue)) {
1319
+ rb_raise(rb_eTypeError, "invalid type");
1320
+ } -- no check since obj2c*ary will do that */
1321
+ if ((TYPE(itpat1) != T_BIGNUM) || (TYPE(itpat1) != T_FIXNUM)) {
1322
+ itpat1 = rb_funcall(itpat1, rb_intern("to_i"), 0);
1323
+ }
1324
+ if ((TYPE(itpat2) != T_BIGNUM) || (TYPE(itpat2) != T_FIXNUM)) {
1325
+ itpat2 = rb_funcall(itpat2, rb_intern("to_i"), 0);
1326
+ }
1327
+
1328
+ i_itpat1 = NUM2INT(itpat1);
1329
+ i_itpat2 = NUM2INT(itpat2);
1330
+ i_vpx = dcl_obj2crealary(vpx);
1331
+ i_vpy = dcl_obj2crealary(vpy);
1332
+ i_vpz = dcl_obj2crealary(vpz);
1333
+
1334
+
1335
+ sctnzv_(i_vpx, i_vpy, i_vpz, &i_itpat1, &i_itpat2);
1336
+
1337
+ dcl_freecrealary(i_vpx);
1338
+ dcl_freecrealary(i_vpy);
1339
+ dcl_freecrealary(i_vpz);
1340
+
1341
+ return Qnil;
1342
+
1343
+ }
1344
+ void
1345
+ init_grph1_scpack(mDCL)
1346
+ VALUE mDCL;
1347
+ {
1348
+ rb_define_module_function(mDCL, "scsobj", dcl_scsobj, 3);
1349
+ rb_define_module_function(mDCL, "scqobj", dcl_scqobj, 0);
1350
+ rb_define_module_function(mDCL, "scseye", dcl_scseye, 3);
1351
+ rb_define_module_function(mDCL, "scqeye", dcl_scqeye, 0);
1352
+ rb_define_module_function(mDCL, "scspln", dcl_scspln, 3);
1353
+ rb_define_module_function(mDCL, "scqpln", dcl_scqpln, 0);
1354
+ rb_define_module_function(mDCL, "scsprj", dcl_scsprj, 0);
1355
+ rb_define_module_function(mDCL, "scsvpt", dcl_scsvpt, 6);
1356
+ rb_define_module_function(mDCL, "scqvpt", dcl_scqvpt, 0);
1357
+ rb_define_module_function(mDCL, "scswnd", dcl_scswnd, 6);
1358
+ rb_define_module_function(mDCL, "scqwnd", dcl_scqwnd, 0);
1359
+ rb_define_module_function(mDCL, "scslog", dcl_scslog, 3);
1360
+ rb_define_module_function(mDCL, "scqlog", dcl_scqlog, 0);
1361
+ rb_define_module_function(mDCL, "scsorg", dcl_scsorg, 4);
1362
+ rb_define_module_function(mDCL, "scqorg", dcl_scqorg, 0);
1363
+ rb_define_module_function(mDCL, "scstrn", dcl_scstrn, 1);
1364
+ rb_define_module_function(mDCL, "scqtrn", dcl_scqtrn, 0);
1365
+ rb_define_module_function(mDCL, "scstrf", dcl_scstrf, 0);
1366
+ rb_define_module_function(mDCL, "scplu", dcl_scplu, 4);
1367
+ rb_define_module_function(mDCL, "scplv", dcl_scplv, 4);
1368
+ rb_define_module_function(mDCL, "scspli", dcl_scspli, 1);
1369
+ rb_define_module_function(mDCL, "scqpli", dcl_scqpli, 0);
1370
+ rb_define_module_function(mDCL, "scplzu", dcl_scplzu, 5);
1371
+ rb_define_module_function(mDCL, "scplzv", dcl_scplzv, 5);
1372
+ rb_define_module_function(mDCL, "scpmu", dcl_scpmu, 4);
1373
+ rb_define_module_function(mDCL, "scpmv", dcl_scpmv, 4);
1374
+ rb_define_module_function(mDCL, "scspmt", dcl_scspmt, 1);
1375
+ rb_define_module_function(mDCL, "scqpmt", dcl_scqpmt, 0);
1376
+ rb_define_module_function(mDCL, "scspmi", dcl_scspmi, 1);
1377
+ rb_define_module_function(mDCL, "scqpmi", dcl_scqpmi, 0);
1378
+ rb_define_module_function(mDCL, "scspms", dcl_scspms, 1);
1379
+ rb_define_module_function(mDCL, "scqpms", dcl_scqpms, 0);
1380
+ rb_define_module_function(mDCL, "scpmzu", dcl_scpmzu, 7);
1381
+ rb_define_module_function(mDCL, "scpmzv", dcl_scpmzv, 7);
1382
+ rb_define_module_function(mDCL, "sctnu", dcl_sctnu, 3);
1383
+ rb_define_module_function(mDCL, "sctnv", dcl_sctnv, 3);
1384
+ rb_define_module_function(mDCL, "scstnp", dcl_scstnp, 2);
1385
+ rb_define_module_function(mDCL, "scqtnp", dcl_scqtnp, 0);
1386
+ rb_define_module_function(mDCL, "sctnzu", dcl_sctnzu, 5);
1387
+ rb_define_module_function(mDCL, "sctnzv", dcl_sctnzv, 5);
1388
+ }