ruby-dcl 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +321 -0
- data/GenWrapper/Makefile +14 -0
- data/GenWrapper/cproto2init.rb +41 -0
- data/GenWrapper/dcl_narrayed_funcs.rb +181 -0
- data/GenWrapper/dcl_rb_footing +29 -0
- data/GenWrapper/dcl_rb_heading +129 -0
- data/GenWrapper/def.rb +20 -0
- data/GenWrapper/elim_ary_size.rb +398 -0
- data/GenWrapper/etc/Mk_proto +375 -0
- data/GenWrapper/etc/dcl_gen +13 -0
- data/GenWrapper/etc/p_header +63 -0
- data/GenWrapper/etc/p_init +410 -0
- data/GenWrapper/pparse.rb +137 -0
- data/GenWrapper/proto/Makefile +35 -0
- data/GenWrapper/proto/grph1_00 +17 -0
- data/GenWrapper/proto/grph1_csgi.fp +27 -0
- data/GenWrapper/proto/grph1_scpack.fp +442 -0
- data/GenWrapper/proto/grph1_sgpack.fp +1406 -0
- data/GenWrapper/proto/grph1_slpack.fp +316 -0
- data/GenWrapper/proto/grph1_stpack.fp +411 -0
- data/GenWrapper/proto/grph1_swpack.fp +746 -0
- data/GenWrapper/proto/grph2_00 +16 -0
- data/GenWrapper/proto/grph2_grpack.fp +139 -0
- data/GenWrapper/proto/grph2_ucpack.fp +522 -0
- data/GenWrapper/proto/grph2_udpack.fp +692 -0
- data/GenWrapper/proto/grph2_uepack.fp +601 -0
- data/GenWrapper/proto/grph2_ugpack.fp +436 -0
- data/GenWrapper/proto/grph2_uhpack.fp +246 -0
- data/GenWrapper/proto/grph2_ulpack.fp +516 -0
- data/GenWrapper/proto/grph2_umpack.fp +676 -0
- data/GenWrapper/proto/grph2_uspack.fp +989 -0
- data/GenWrapper/proto/grph2_uupack.fp +663 -0
- data/GenWrapper/proto/grph2_uvpack.fp +246 -0
- data/GenWrapper/proto/grph2_uwpack.fp +203 -0
- data/GenWrapper/proto/grph2_uxpack.fp +295 -0
- data/GenWrapper/proto/grph2_uypack.fp +295 -0
- data/GenWrapper/proto/grph2_uzpack.fp +574 -0
- data/GenWrapper/proto/math1_00 +12 -0
- data/GenWrapper/proto/math1_blklib.fp +58 -0
- data/GenWrapper/proto/math1_chrlib.fp +83 -0
- data/GenWrapper/proto/math1_fnclib.fp +79 -0
- data/GenWrapper/proto/math1_gnmlib.fp +118 -0
- data/GenWrapper/proto/math1_gt2dlib.fp +144 -0
- data/GenWrapper/proto/math1_ifalib.fp +123 -0
- data/GenWrapper/proto/math1_indxlib.fp +222 -0
- data/GenWrapper/proto/math1_intlib.fp +46 -0
- data/GenWrapper/proto/math1_lrllib.fp +276 -0
- data/GenWrapper/proto/math1_maplib.fp +24 -0
- data/GenWrapper/proto/math1_oslib.fp +28 -0
- data/GenWrapper/proto/math1_rfalib.fp +420 -0
- data/GenWrapper/proto/math1_rfblib.fp +51 -0
- data/GenWrapper/proto/math1_sublib.fp +60 -0
- data/GenWrapper/proto/math1_syslib.fp +767 -0
- data/GenWrapper/proto/math1_vialib.fp +339 -0
- data/GenWrapper/proto/math1_viblib.fp +264 -0
- data/GenWrapper/proto/math1_vralib.fp +339 -0
- data/GenWrapper/proto/math1_vrblib.fp +264 -0
- data/GenWrapper/proto/math1_xfclib.fp +68 -0
- data/GenWrapper/proto/math2_00 +12 -0
- data/GenWrapper/proto/math2_fftlib.fp +803 -0
- data/GenWrapper/proto/math2_intrlib.fp +32 -0
- data/GenWrapper/proto/math2_odelib.fp_notused +568 -0
- data/GenWrapper/proto/math2_rnmlib.fp +54 -0
- data/GenWrapper/proto/math2_shtlib.fp +1292 -0
- data/GenWrapper/proto/math2_shtlib.fp_old +1294 -0
- data/GenWrapper/proto/math2_vstlib.fp +84 -0
- data/GenWrapper/proto/misc1_00 +17 -0
- data/GenWrapper/proto/misc1_chnlib.fp +47 -0
- data/GenWrapper/proto/misc1_datelib.fp +352 -0
- data/GenWrapper/proto/misc1_fmtlib.fp +19 -0
- data/GenWrapper/proto/misc1_misclib.fp +26 -0
- data/GenWrapper/proto/misc1_randlib.fp +36 -0
- data/GenWrapper/proto/misc1_timelib.fp +151 -0
- data/GenWrapper/proto2c.rb +13 -0
- data/GenWrapper/prototype.rb +209 -0
- data/GenWrapper/util.rb +9 -0
- data/GenWrapper/variable.rb +671 -0
- data/README +29 -0
- data/Rakefile +44 -0
- data/ToDo +2 -0
- data/dcl_cary2obj.c +354 -0
- data/dcl_narrayed_funcs.c +518 -0
- data/dcl_obj2cary.c +512 -0
- data/dcl_rubydcloriginal.c +129 -0
- data/demo/gokuraku/hop/hop.rb +26 -0
- data/demo/gokuraku/jump/jump1.rb +64 -0
- data/demo/gokuraku/jump/jump2.rb +50 -0
- data/demo/gokuraku/layout/lay1.rb +46 -0
- data/demo/gokuraku/layout/lay2.rb +44 -0
- data/demo/gokuraku/step/step0.rb +34 -0
- data/demo/gokuraku/step/step1.rb +84 -0
- data/demo/gokuraku/step/step2.rb +62 -0
- data/demo/gokuraku/u1d/u1d1.rb +37 -0
- data/demo/gokuraku/u1d/u1d2.rb +50 -0
- data/demo/gokuraku/u2d/u2d1.rb +46 -0
- data/demo/gokuraku/u2d/u2d2.rb +49 -0
- data/demo/gokuraku/u2d/u2d3.rb +45 -0
- data/demo/gokuraku/u2d/u2d4.rb +61 -0
- data/demo/grph1/scpack/scpkt2.rb +40 -0
- data/demo/grph1/scpack/scpkt3.rb +102 -0
- data/demo/grph1/scpack/scpkt6.rb +84 -0
- data/demo/grph1/scpack/scpkt7.rb +59 -0
- data/demo/grph1/scpack/scpkt8.rb +60 -0
- data/demo/grph1/scpack/t810630.dat +296 -0
- data/demo/grph1/scpack/t811231.dat +296 -0
- data/demo/grph1/sgpack/sgfont.rb +52 -0
- data/demo/grph1/sgpack/sgfonz.rb +53 -0
- data/demo/grph1/sgpack/sgksx1.rb +44 -0
- data/demo/grph1/sgpack/sgksx2.rb +90 -0
- data/demo/grph1/sgpack/sgksx3.rb +75 -0
- data/demo/grph1/sgpack/sglidx.rb +40 -0
- data/demo/grph1/sgpack/sgltyp.rb +48 -0
- data/demo/grph1/sgpack/sgpk01.rb +39 -0
- data/demo/grph1/sgpack/sgpk02.rb +79 -0
- data/demo/grph1/sgpack/sgpk03.rb +107 -0
- data/demo/grph1/sgpack/sgpk04.rb +86 -0
- data/demo/grph1/sgpack/sgpk05.rb +66 -0
- data/demo/grph1/sgpack/sgpk06.rb +91 -0
- data/demo/grph1/sgpack/sgpk07.rb +66 -0
- data/demo/grph1/sgpack/sgpk08.rb +67 -0
- data/demo/grph1/sgpack/sgpk09.rb +61 -0
- data/demo/grph1/sgpack/sgpk10.rb +58 -0
- data/demo/grph1/sgpack/sgtclr.rb +59 -0
- data/demo/grph1/sgpack/sgtone.rb +70 -0
- data/demo/grph1/sgpack/sgtonz.rb +66 -0
- data/demo/grph1/slpack/slpk01.rb +37 -0
- data/demo/grph1/slpack/slpk02.rb +29 -0
- data/demo/grph1/slpack/slpk03.rb +36 -0
- data/demo/grph1/slpack/slpk04.rb +36 -0
- data/demo/grph2/g2pack/g2pk01.rb +78 -0
- data/demo/grph2/g2pack/g2pk02.rb +75 -0
- data/demo/grph2/grpack/grpk01.rb +65 -0
- data/demo/grph2/ucpack/ucpk01.rb +95 -0
- data/demo/grph2/ucpack/ucpk02.rb +95 -0
- data/demo/grph2/udegpk/u2df01.rb +50 -0
- data/demo/grph2/udegpk/u2df02.rb +76 -0
- data/demo/grph2/udegpk/u2df03.rb +80 -0
- data/demo/grph2/udegpk/u2df04.rb +52 -0
- data/demo/grph2/udegpk/u2df05.rb +70 -0
- data/demo/grph2/udegpk/u2df06.rb +59 -0
- data/demo/grph2/udegpk/u2df07.rb +68 -0
- data/demo/grph2/udegpk/u2df08.rb +91 -0
- data/demo/grph2/udegpk/u2df09b.rb +88 -0
- data/demo/grph2/udegpk/u2df09c.rb +89 -0
- data/demo/grph2/udegpk/u2df09e.rb +88 -0
- data/demo/grph2/udegpk/u2df09f.rb +89 -0
- data/demo/grph2/ulpack/ulpk01.rb +111 -0
- data/demo/grph2/ulpack/ulpk01n.rb +111 -0
- data/demo/grph2/ulpack/ulpk02.rb +111 -0
- data/demo/grph2/ulpack/ulpk02n.rb +111 -0
- data/demo/grph2/umpack/t811231.dat +296 -0
- data/demo/grph2/umpack/test01.rb +69 -0
- data/demo/grph2/umpack/test02.rb +64 -0
- data/demo/grph2/umpack/test03.rb +84 -0
- data/demo/grph2/umpack/test04.rb +54 -0
- data/demo/grph2/umpack/test05.rb +85 -0
- data/demo/grph2/umpack/test06.rb +44 -0
- data/demo/grph2/umpack/test07.rb +43 -0
- data/demo/grph2/umpack/test08.rb +37 -0
- data/demo/grph2/umpack/test09.rb +86 -0
- data/demo/grph2/umpack/test10.rb +52 -0
- data/demo/grph2/umpack/umpk01.rb +65 -0
- data/demo/grph2/umpack/umpk02.rb +54 -0
- data/demo/grph2/umpack/umpk03.rb +46 -0
- data/demo/grph2/umpack/umpk04.rb +65 -0
- data/demo/grph2/umpack/umpk05.rb +84 -0
- data/demo/grph2/uspack/uspk01.rb +39 -0
- data/demo/grph2/uspack/uspk02.rb +47 -0
- data/demo/grph2/uspack/uspk03.rb +38 -0
- data/demo/grph2/uspack/uspk04.rb +64 -0
- data/demo/grph2/uspack/uspk05.rb +68 -0
- data/demo/grph2/uspack/uspk06.rb +43 -0
- data/demo/grph2/uspack/uspk07.rb +62 -0
- data/demo/grph2/uspack/uspk08.rb +46 -0
- data/demo/grph2/uspack/uspk09.rb +89 -0
- data/demo/grph2/uspack/uspk10.rb +48 -0
- data/demo/grph2/uspack/uspk11.rb +71 -0
- data/demo/grph2/uspack/uspk12.rb +51 -0
- data/demo/grph2/uupack/uupk01.rb +50 -0
- data/demo/grph2/uupack/uupk02.rb +74 -0
- data/demo/grph2/uupack/uupk03.rb +56 -0
- data/demo/grph2/uupack/uupk04.rb +84 -0
- data/demo/grph2/uupack/uupk05.rb +74 -0
- data/demo/grph2/uupack/uupk06.rb +77 -0
- data/demo/grph2/uupack/uupk07.rb +88 -0
- data/demo/grph2/uxyzpk/uxyz01.rb +38 -0
- data/demo/grph2/uxyzpk/uxyz02.rb +36 -0
- data/demo/grph2/uxyzpk/uxyz03.rb +37 -0
- data/demo/grph2/uxyzpk/uxyz04.rb +54 -0
- data/demo/grph2/uxyzpk/uxyz05.rb +41 -0
- data/demo/grph2/uxyzpk/uxyz06.rb +42 -0
- data/demo/grph2/uxyzpk/uxyz07.rb +38 -0
- data/demo/grph2/uxyzpk/uxyz08.rb +60 -0
- data/demo/grph2/uxyzpk/uxyz09.rb +52 -0
- data/demo/grph2/uxyzpk/uxyz10.rb +57 -0
- data/demo/grph2/ximage/MEMO +23 -0
- data/demo/grph2/ximage/tomsclm.dat +1344 -0
- data/demo/grph2/ximage/ximg01.rb +145 -0
- data/demo/math1/gt2dlib/gt2d01.rb +33 -0
- data/demo/math2/fftlib/fftl01.rb +28 -0
- data/demo/math2/fftlib/fftl02.rb +224 -0
- data/demo/math2/intrlib/intr01.rb +22 -0
- data/demo/math2/rnmlib/rnml01.rb +21 -0
- data/demo/math2/vstlib/vstl01.rb +29 -0
- data/demo/math2/vstlib/vstl02.rb +38 -0
- data/demo/rakuraku/color/color1.rb +61 -0
- data/demo/rakuraku/color/color2.rb +57 -0
- data/demo/rakuraku/color/color3.rb +81 -0
- data/demo/rakuraku/kihon/kihon1.rb +39 -0
- data/demo/rakuraku/kihon/kihon2.rb +56 -0
- data/demo/rakuraku/kihon/kihon3.rb +57 -0
- data/demo/rakuraku/kihon/kihon4.rb +70 -0
- data/demo/rakuraku/kihon/kihon5.rb +56 -0
- data/demo/rakuraku/kihon/kihon6.rb +40 -0
- data/demo/rakuraku/kihon/kihon7.rb +98 -0
- data/demo/rakuraku/kihon/kihon8.rb +93 -0
- data/demo/rakuraku/kihon/kihon9.rb +77 -0
- data/demo/rakuraku/kihon/kihona.rb +123 -0
- data/demo/rakuraku/kihon/kihonb.rb +73 -0
- data/demo/rakuraku/kihon/kihonc.rb +110 -0
- data/demo/rakuraku/layout/lay1.rb +29 -0
- data/demo/rakuraku/layout/lay2.rb +28 -0
- data/demo/rakuraku/layout/lay3.rb +29 -0
- data/demo/rakuraku/map3d/map3d1.rb +68 -0
- data/demo/rakuraku/map3d/map3d2.rb +67 -0
- data/demo/rakuraku/map3d/map3d3.rb +66 -0
- data/demo/rakuraku/map3d/map3d4.rb +107 -0
- data/demo/rakuraku/map3d/map3d5.rb +118 -0
- data/demo/rakuraku/map3d/map3d6.rb +96 -0
- data/demo/rakuraku/map3d/map3d7.rb +98 -0
- data/demo/rakuraku/miss/miss1.rb +76 -0
- data/demo/rakuraku/miss/miss2.rb +60 -0
- data/demo/rakuraku/quick/quick1.rb +35 -0
- data/demo/rakuraku/quick/quick2.rb +33 -0
- data/demo/rakuraku/quick/quick3.rb +46 -0
- data/demo/rakuraku/quick/quick4.rb +47 -0
- data/demo/rakuraku/quick/quick5.rb +46 -0
- data/demo/rakuraku/u2d/u2d1.rb +50 -0
- data/demo/rakuraku/u2d/u2d2.rb +51 -0
- data/demo/rakuraku/u2d/u2d3.rb +70 -0
- data/demo/rakuraku/u2d/u2d4.rb +59 -0
- data/demo/rakuraku/u2d/u2d5.rb +61 -0
- data/demo/rakuraku/u2d/u2d6.rb +57 -0
- data/demo/rakuraku/u2d/u2d7.rb +103 -0
- data/demo/rakuraku/uspack/uspac1.rb +35 -0
- data/demo/rakuraku/uspack/uspac2.rb +66 -0
- data/demo/rakuraku/uspack/uspac3.rb +37 -0
- data/demo/rakuraku/uspack/uspac4.rb +49 -0
- data/demo/rakuraku/uxyz/uxyz1.rb +37 -0
- data/demo/rakuraku/uxyz/uxyz2.rb +35 -0
- data/demo/rakuraku/uxyz/uxyz3.rb +38 -0
- data/demo/rakuraku/uxyz/uxyz4.rb +36 -0
- data/demo/rakuraku/uxyz/uxyz5.rb +57 -0
- data/demo/rakuraku/uxyz/uxyz6.rb +43 -0
- data/demo/rakuraku/uxyz/uxyz7.rb +39 -0
- data/demo/rakuraku/uxyz/uxyz8.rb +56 -0
- data/demo/rubydcloriginal/uemrkz1.rb +37 -0
- data/dummy.c +9 -0
- data/extconf.rb +133 -0
- data/grph1_csgi.c +119 -0
- data/grph1_scpack.c +1388 -0
- data/grph1_sgpack.c +3876 -0
- data/grph1_slpack.c +432 -0
- data/grph1_stpack.c +1044 -0
- data/grph1_swpack.c +1922 -0
- data/grph1_zgpack.c.org +141 -0
- data/grph2_grpack.c +368 -0
- data/grph2_ucpack.c +1232 -0
- data/grph2_udpack.c +1404 -0
- data/grph2_uepack.c +1443 -0
- data/grph2_ugpack.c +1073 -0
- data/grph2_uhpack.c +943 -0
- data/grph2_ulpack.c +1304 -0
- data/grph2_umpack.c +1540 -0
- data/grph2_uspack.c +2481 -0
- data/grph2_uupack.c +1689 -0
- data/grph2_uvpack.c +943 -0
- data/grph2_uwpack.c +552 -0
- data/grph2_uxpack.c +555 -0
- data/grph2_uypack.c +555 -0
- data/grph2_uzpack.c +1455 -0
- data/init.c.default +187 -0
- data/init.c.gtk +189 -0
- data/lib/dcl.rb +5084 -0
- data/math1_blklib.c +227 -0
- data/math1_chrlib.c +239 -0
- data/math1_fnclib.c +254 -0
- data/math1_gnmlib.c +356 -0
- data/math1_gt2dlib.c +514 -0
- data/math1_ifalib.c +427 -0
- data/math1_indxlib.c +709 -0
- data/math1_intlib.c +167 -0
- data/math1_lrllib.c +817 -0
- data/math1_maplib.c +172 -0
- data/math1_oslib.c +111 -0
- data/math1_rfalib.c +1417 -0
- data/math1_rfblib.c +232 -0
- data/math1_sublib.c +221 -0
- data/math1_syslib.c +2025 -0
- data/math1_vialib.c +1156 -0
- data/math1_viblib.c +1027 -0
- data/math1_vralib.c +1156 -0
- data/math1_vrblib.c +1027 -0
- data/math1_xfclib.c +142 -0
- data/math2_fftlib.c +833 -0
- data/math2_intrlib.c +138 -0
- data/math2_rnmlib.c +226 -0
- data/math2_shtlib.c +1568 -0
- data/math2_vstlib.c +366 -0
- data/misc1_chnlib.c +179 -0
- data/misc1_datelib.c +953 -0
- data/misc1_fmtlib.c +99 -0
- data/misc1_misclib.c +118 -0
- data/misc1_randlib.c +142 -0
- data/misc1_timelib.c +380 -0
- data/obsolete/README +2 -0
- data/obsolete/dcl_ext.html +112 -0
- data/obsolete/dcl_ext.rb +313 -0
- metadata +433 -0
data/grph1_slpack.c
ADDED
@@ -0,0 +1,432 @@
|
|
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_slinit(obj, wxmax, wymax, fact)
|
66
|
+
VALUE obj, wxmax, wymax, fact;
|
67
|
+
{
|
68
|
+
real i_wxmax;
|
69
|
+
real i_wymax;
|
70
|
+
real i_fact;
|
71
|
+
|
72
|
+
if (TYPE(wxmax) != T_FLOAT) {
|
73
|
+
wxmax = rb_funcall(wxmax, rb_intern("to_f"), 0);
|
74
|
+
}
|
75
|
+
if (TYPE(wymax) != T_FLOAT) {
|
76
|
+
wymax = rb_funcall(wymax, rb_intern("to_f"), 0);
|
77
|
+
}
|
78
|
+
if (TYPE(fact) != T_FLOAT) {
|
79
|
+
fact = rb_funcall(fact, rb_intern("to_f"), 0);
|
80
|
+
}
|
81
|
+
|
82
|
+
i_wxmax = (real)NUM2DBL(wxmax);
|
83
|
+
i_wymax = (real)NUM2DBL(wymax);
|
84
|
+
i_fact = (real)NUM2DBL(fact);
|
85
|
+
|
86
|
+
|
87
|
+
slinit_(&i_wxmax, &i_wymax, &i_fact);
|
88
|
+
|
89
|
+
return Qnil;
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
static VALUE
|
94
|
+
dcl_slsize(obj, cszez)
|
95
|
+
VALUE obj, cszez;
|
96
|
+
{
|
97
|
+
char *i_cszez;
|
98
|
+
|
99
|
+
if (TYPE(cszez) != T_STRING) {
|
100
|
+
cszez = rb_funcall(cszez, rb_intern("to_str"), 0);
|
101
|
+
}
|
102
|
+
|
103
|
+
i_cszez = StringValuePtr(cszez);
|
104
|
+
|
105
|
+
|
106
|
+
slsize_(i_cszez, (ftnlen)strlen(i_cszez));
|
107
|
+
|
108
|
+
return Qnil;
|
109
|
+
|
110
|
+
}
|
111
|
+
|
112
|
+
static VALUE
|
113
|
+
dcl_slform(obj, dxa, dya)
|
114
|
+
VALUE obj, dxa, dya;
|
115
|
+
{
|
116
|
+
real i_dxa;
|
117
|
+
real i_dya;
|
118
|
+
|
119
|
+
if (TYPE(dxa) != T_FLOAT) {
|
120
|
+
dxa = rb_funcall(dxa, rb_intern("to_f"), 0);
|
121
|
+
}
|
122
|
+
if (TYPE(dya) != T_FLOAT) {
|
123
|
+
dya = rb_funcall(dya, rb_intern("to_f"), 0);
|
124
|
+
}
|
125
|
+
|
126
|
+
i_dxa = (real)NUM2DBL(dxa);
|
127
|
+
i_dya = (real)NUM2DBL(dya);
|
128
|
+
|
129
|
+
|
130
|
+
slform_(&i_dxa, &i_dya);
|
131
|
+
|
132
|
+
return Qnil;
|
133
|
+
|
134
|
+
}
|
135
|
+
|
136
|
+
static VALUE
|
137
|
+
dcl_sldiv(obj, cform, ix, iy)
|
138
|
+
VALUE obj, cform, ix, iy;
|
139
|
+
{
|
140
|
+
char *i_cform;
|
141
|
+
integer i_ix;
|
142
|
+
integer i_iy;
|
143
|
+
|
144
|
+
if (TYPE(cform) != T_STRING) {
|
145
|
+
cform = rb_funcall(cform, rb_intern("to_str"), 0);
|
146
|
+
}
|
147
|
+
if ((TYPE(ix) != T_BIGNUM) || (TYPE(ix) != T_FIXNUM)) {
|
148
|
+
ix = rb_funcall(ix, rb_intern("to_i"), 0);
|
149
|
+
}
|
150
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
151
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
152
|
+
}
|
153
|
+
|
154
|
+
i_cform = StringValuePtr(cform);
|
155
|
+
i_ix = NUM2INT(ix);
|
156
|
+
i_iy = NUM2INT(iy);
|
157
|
+
|
158
|
+
|
159
|
+
sldiv_(i_cform, &i_ix, &i_iy, (ftnlen)strlen(i_cform));
|
160
|
+
|
161
|
+
return Qnil;
|
162
|
+
|
163
|
+
}
|
164
|
+
|
165
|
+
static VALUE
|
166
|
+
dcl_slmgn(obj, xl, xr, yb, yt)
|
167
|
+
VALUE obj, xl, xr, yb, yt;
|
168
|
+
{
|
169
|
+
real i_xl;
|
170
|
+
real i_xr;
|
171
|
+
real i_yb;
|
172
|
+
real i_yt;
|
173
|
+
|
174
|
+
if (TYPE(xl) != T_FLOAT) {
|
175
|
+
xl = rb_funcall(xl, rb_intern("to_f"), 0);
|
176
|
+
}
|
177
|
+
if (TYPE(xr) != T_FLOAT) {
|
178
|
+
xr = rb_funcall(xr, rb_intern("to_f"), 0);
|
179
|
+
}
|
180
|
+
if (TYPE(yb) != T_FLOAT) {
|
181
|
+
yb = rb_funcall(yb, rb_intern("to_f"), 0);
|
182
|
+
}
|
183
|
+
if (TYPE(yt) != T_FLOAT) {
|
184
|
+
yt = rb_funcall(yt, rb_intern("to_f"), 0);
|
185
|
+
}
|
186
|
+
|
187
|
+
i_xl = (real)NUM2DBL(xl);
|
188
|
+
i_xr = (real)NUM2DBL(xr);
|
189
|
+
i_yb = (real)NUM2DBL(yb);
|
190
|
+
i_yt = (real)NUM2DBL(yt);
|
191
|
+
|
192
|
+
|
193
|
+
slmgn_(&i_xl, &i_xr, &i_yb, &i_yt);
|
194
|
+
|
195
|
+
return Qnil;
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
static VALUE
|
200
|
+
dcl_slrat(obj, rx, ry)
|
201
|
+
VALUE obj, rx, ry;
|
202
|
+
{
|
203
|
+
real i_rx;
|
204
|
+
real i_ry;
|
205
|
+
|
206
|
+
if (TYPE(rx) != T_FLOAT) {
|
207
|
+
rx = rb_funcall(rx, rb_intern("to_f"), 0);
|
208
|
+
}
|
209
|
+
if (TYPE(ry) != T_FLOAT) {
|
210
|
+
ry = rb_funcall(ry, rb_intern("to_f"), 0);
|
211
|
+
}
|
212
|
+
|
213
|
+
i_rx = (real)NUM2DBL(rx);
|
214
|
+
i_ry = (real)NUM2DBL(ry);
|
215
|
+
|
216
|
+
|
217
|
+
slrat_(&i_rx, &i_ry);
|
218
|
+
|
219
|
+
return Qnil;
|
220
|
+
|
221
|
+
}
|
222
|
+
|
223
|
+
static VALUE
|
224
|
+
dcl_slsttl(obj, cttl, cside, px, py, ht, nt)
|
225
|
+
VALUE obj, cttl, cside, px, py, ht, nt;
|
226
|
+
{
|
227
|
+
char *i_cttl;
|
228
|
+
char *i_cside;
|
229
|
+
real i_px;
|
230
|
+
real i_py;
|
231
|
+
real i_ht;
|
232
|
+
integer i_nt;
|
233
|
+
|
234
|
+
if (TYPE(cttl) != T_STRING) {
|
235
|
+
cttl = rb_funcall(cttl, rb_intern("to_str"), 0);
|
236
|
+
}
|
237
|
+
if (TYPE(cside) != T_STRING) {
|
238
|
+
cside = rb_funcall(cside, rb_intern("to_str"), 0);
|
239
|
+
}
|
240
|
+
if (TYPE(px) != T_FLOAT) {
|
241
|
+
px = rb_funcall(px, rb_intern("to_f"), 0);
|
242
|
+
}
|
243
|
+
if (TYPE(py) != T_FLOAT) {
|
244
|
+
py = rb_funcall(py, rb_intern("to_f"), 0);
|
245
|
+
}
|
246
|
+
if (TYPE(ht) != T_FLOAT) {
|
247
|
+
ht = rb_funcall(ht, rb_intern("to_f"), 0);
|
248
|
+
}
|
249
|
+
if ((TYPE(nt) != T_BIGNUM) || (TYPE(nt) != T_FIXNUM)) {
|
250
|
+
nt = rb_funcall(nt, rb_intern("to_i"), 0);
|
251
|
+
}
|
252
|
+
|
253
|
+
i_cttl = StringValuePtr(cttl);
|
254
|
+
i_cside = StringValuePtr(cside);
|
255
|
+
i_px = (real)NUM2DBL(px);
|
256
|
+
i_py = (real)NUM2DBL(py);
|
257
|
+
i_ht = (real)NUM2DBL(ht);
|
258
|
+
i_nt = NUM2INT(nt);
|
259
|
+
|
260
|
+
|
261
|
+
slsttl_(i_cttl, i_cside, &i_px, &i_py, &i_ht, &i_nt, (ftnlen)strlen(i_cttl), (ftnlen)strlen(i_cside));
|
262
|
+
|
263
|
+
return Qnil;
|
264
|
+
|
265
|
+
}
|
266
|
+
|
267
|
+
static VALUE
|
268
|
+
dcl_sldttl(obj, nt)
|
269
|
+
VALUE obj, nt;
|
270
|
+
{
|
271
|
+
integer i_nt;
|
272
|
+
|
273
|
+
if ((TYPE(nt) != T_BIGNUM) || (TYPE(nt) != T_FIXNUM)) {
|
274
|
+
nt = rb_funcall(nt, rb_intern("to_i"), 0);
|
275
|
+
}
|
276
|
+
|
277
|
+
i_nt = NUM2INT(nt);
|
278
|
+
|
279
|
+
|
280
|
+
sldttl_(&i_nt);
|
281
|
+
|
282
|
+
return Qnil;
|
283
|
+
|
284
|
+
}
|
285
|
+
|
286
|
+
static VALUE
|
287
|
+
dcl_slpvpr(obj, index)
|
288
|
+
VALUE obj, index;
|
289
|
+
{
|
290
|
+
integer i_index;
|
291
|
+
|
292
|
+
if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
|
293
|
+
index = rb_funcall(index, rb_intern("to_i"), 0);
|
294
|
+
}
|
295
|
+
|
296
|
+
i_index = NUM2INT(index);
|
297
|
+
|
298
|
+
|
299
|
+
slpvpr_(&i_index);
|
300
|
+
|
301
|
+
return Qnil;
|
302
|
+
|
303
|
+
}
|
304
|
+
|
305
|
+
static VALUE
|
306
|
+
dcl_slpwwr(obj, index)
|
307
|
+
VALUE obj, index;
|
308
|
+
{
|
309
|
+
integer i_index;
|
310
|
+
|
311
|
+
if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
|
312
|
+
index = rb_funcall(index, rb_intern("to_i"), 0);
|
313
|
+
}
|
314
|
+
|
315
|
+
i_index = NUM2INT(index);
|
316
|
+
|
317
|
+
|
318
|
+
slpwwr_(&i_index);
|
319
|
+
|
320
|
+
return Qnil;
|
321
|
+
|
322
|
+
}
|
323
|
+
|
324
|
+
static VALUE
|
325
|
+
dcl_slpwvr(obj, index)
|
326
|
+
VALUE obj, index;
|
327
|
+
{
|
328
|
+
integer i_index;
|
329
|
+
|
330
|
+
if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
|
331
|
+
index = rb_funcall(index, rb_intern("to_i"), 0);
|
332
|
+
}
|
333
|
+
|
334
|
+
i_index = NUM2INT(index);
|
335
|
+
|
336
|
+
|
337
|
+
slpwvr_(&i_index);
|
338
|
+
|
339
|
+
return Qnil;
|
340
|
+
|
341
|
+
}
|
342
|
+
|
343
|
+
static VALUE
|
344
|
+
dcl_slpvpc(obj, index, rc)
|
345
|
+
VALUE obj, index, rc;
|
346
|
+
{
|
347
|
+
integer i_index;
|
348
|
+
real i_rc;
|
349
|
+
|
350
|
+
if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
|
351
|
+
index = rb_funcall(index, rb_intern("to_i"), 0);
|
352
|
+
}
|
353
|
+
if (TYPE(rc) != T_FLOAT) {
|
354
|
+
rc = rb_funcall(rc, rb_intern("to_f"), 0);
|
355
|
+
}
|
356
|
+
|
357
|
+
i_index = NUM2INT(index);
|
358
|
+
i_rc = (real)NUM2DBL(rc);
|
359
|
+
|
360
|
+
|
361
|
+
slpvpc_(&i_index, &i_rc);
|
362
|
+
|
363
|
+
return Qnil;
|
364
|
+
|
365
|
+
}
|
366
|
+
|
367
|
+
static VALUE
|
368
|
+
dcl_slpwwc(obj, index, rc)
|
369
|
+
VALUE obj, index, rc;
|
370
|
+
{
|
371
|
+
integer i_index;
|
372
|
+
real i_rc;
|
373
|
+
|
374
|
+
if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
|
375
|
+
index = rb_funcall(index, rb_intern("to_i"), 0);
|
376
|
+
}
|
377
|
+
if (TYPE(rc) != T_FLOAT) {
|
378
|
+
rc = rb_funcall(rc, rb_intern("to_f"), 0);
|
379
|
+
}
|
380
|
+
|
381
|
+
i_index = NUM2INT(index);
|
382
|
+
i_rc = (real)NUM2DBL(rc);
|
383
|
+
|
384
|
+
|
385
|
+
slpwwc_(&i_index, &i_rc);
|
386
|
+
|
387
|
+
return Qnil;
|
388
|
+
|
389
|
+
}
|
390
|
+
|
391
|
+
static VALUE
|
392
|
+
dcl_slpwvc(obj, index, rc)
|
393
|
+
VALUE obj, index, rc;
|
394
|
+
{
|
395
|
+
integer i_index;
|
396
|
+
real i_rc;
|
397
|
+
|
398
|
+
if ((TYPE(index) != T_BIGNUM) || (TYPE(index) != T_FIXNUM)) {
|
399
|
+
index = rb_funcall(index, rb_intern("to_i"), 0);
|
400
|
+
}
|
401
|
+
if (TYPE(rc) != T_FLOAT) {
|
402
|
+
rc = rb_funcall(rc, rb_intern("to_f"), 0);
|
403
|
+
}
|
404
|
+
|
405
|
+
i_index = NUM2INT(index);
|
406
|
+
i_rc = (real)NUM2DBL(rc);
|
407
|
+
|
408
|
+
|
409
|
+
slpwvc_(&i_index, &i_rc);
|
410
|
+
|
411
|
+
return Qnil;
|
412
|
+
|
413
|
+
}
|
414
|
+
void
|
415
|
+
init_grph1_slpack(mDCL)
|
416
|
+
VALUE mDCL;
|
417
|
+
{
|
418
|
+
rb_define_module_function(mDCL, "slinit", dcl_slinit, 3);
|
419
|
+
rb_define_module_function(mDCL, "slsize", dcl_slsize, 1);
|
420
|
+
rb_define_module_function(mDCL, "slform", dcl_slform, 2);
|
421
|
+
rb_define_module_function(mDCL, "sldiv", dcl_sldiv, 3);
|
422
|
+
rb_define_module_function(mDCL, "slmgn", dcl_slmgn, 4);
|
423
|
+
rb_define_module_function(mDCL, "slrat", dcl_slrat, 2);
|
424
|
+
rb_define_module_function(mDCL, "slsttl", dcl_slsttl, 6);
|
425
|
+
rb_define_module_function(mDCL, "sldttl", dcl_sldttl, 1);
|
426
|
+
rb_define_module_function(mDCL, "slpvpr", dcl_slpvpr, 1);
|
427
|
+
rb_define_module_function(mDCL, "slpwwr", dcl_slpwwr, 1);
|
428
|
+
rb_define_module_function(mDCL, "slpwvr", dcl_slpwvr, 1);
|
429
|
+
rb_define_module_function(mDCL, "slpvpc", dcl_slpvpc, 2);
|
430
|
+
rb_define_module_function(mDCL, "slpwwc", dcl_slpwwc, 2);
|
431
|
+
rb_define_module_function(mDCL, "slpwvc", dcl_slpwvc, 2);
|
432
|
+
}
|
data/grph1_stpack.c
ADDED
@@ -0,0 +1,1044 @@
|
|
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_stqtrf(obj)
|
66
|
+
VALUE obj;
|
67
|
+
{
|
68
|
+
logical o_lmapa;
|
69
|
+
VALUE lmapa;
|
70
|
+
|
71
|
+
stqtrf_(&o_lmapa);
|
72
|
+
|
73
|
+
lmapa = (o_lmapa == FALSE_) ? Qfalse : Qtrue;
|
74
|
+
|
75
|
+
|
76
|
+
return lmapa;
|
77
|
+
|
78
|
+
}
|
79
|
+
|
80
|
+
static VALUE
|
81
|
+
dcl_ststrf(obj, lmapa)
|
82
|
+
VALUE obj, lmapa;
|
83
|
+
{
|
84
|
+
logical i_lmapa;
|
85
|
+
|
86
|
+
i_lmapa = ((lmapa == Qnil)||(lmapa == Qfalse)) ? FALSE_ : TRUE_;
|
87
|
+
|
88
|
+
|
89
|
+
ststrf_(&i_lmapa);
|
90
|
+
|
91
|
+
return Qnil;
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
static VALUE
|
96
|
+
dcl_stftrn(obj, ux, uy)
|
97
|
+
VALUE obj, ux, uy;
|
98
|
+
{
|
99
|
+
real i_ux;
|
100
|
+
real i_uy;
|
101
|
+
real o_vx;
|
102
|
+
real o_vy;
|
103
|
+
VALUE vx;
|
104
|
+
VALUE vy;
|
105
|
+
|
106
|
+
if (TYPE(ux) != T_FLOAT) {
|
107
|
+
ux = rb_funcall(ux, rb_intern("to_f"), 0);
|
108
|
+
}
|
109
|
+
if (TYPE(uy) != T_FLOAT) {
|
110
|
+
uy = rb_funcall(uy, rb_intern("to_f"), 0);
|
111
|
+
}
|
112
|
+
|
113
|
+
i_ux = (real)NUM2DBL(ux);
|
114
|
+
i_uy = (real)NUM2DBL(uy);
|
115
|
+
|
116
|
+
|
117
|
+
stftrn_(&i_ux, &i_uy, &o_vx, &o_vy);
|
118
|
+
|
119
|
+
vx = rb_float_new((double)o_vx);
|
120
|
+
vy = rb_float_new((double)o_vy);
|
121
|
+
|
122
|
+
|
123
|
+
return rb_ary_new3(2, vx, vy);
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
static VALUE
|
128
|
+
dcl_stitrn(obj, vx, vy)
|
129
|
+
VALUE obj, vx, vy;
|
130
|
+
{
|
131
|
+
real i_vx;
|
132
|
+
real i_vy;
|
133
|
+
real o_ux;
|
134
|
+
real o_uy;
|
135
|
+
VALUE ux;
|
136
|
+
VALUE uy;
|
137
|
+
|
138
|
+
if (TYPE(vx) != T_FLOAT) {
|
139
|
+
vx = rb_funcall(vx, rb_intern("to_f"), 0);
|
140
|
+
}
|
141
|
+
if (TYPE(vy) != T_FLOAT) {
|
142
|
+
vy = rb_funcall(vy, rb_intern("to_f"), 0);
|
143
|
+
}
|
144
|
+
|
145
|
+
i_vx = (real)NUM2DBL(vx);
|
146
|
+
i_vy = (real)NUM2DBL(vy);
|
147
|
+
|
148
|
+
|
149
|
+
stitrn_(&i_vx, &i_vy, &o_ux, &o_uy);
|
150
|
+
|
151
|
+
ux = rb_float_new((double)o_ux);
|
152
|
+
uy = rb_float_new((double)o_uy);
|
153
|
+
|
154
|
+
|
155
|
+
return rb_ary_new3(2, ux, uy);
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
#if DCLVER >= 530
|
160
|
+
|
161
|
+
static VALUE
|
162
|
+
dcl_ststri(obj, itr)
|
163
|
+
VALUE obj, itr;
|
164
|
+
{
|
165
|
+
integer i_itr;
|
166
|
+
|
167
|
+
if ((TYPE(itr) != T_BIGNUM) || (TYPE(itr) != T_FIXNUM)) {
|
168
|
+
itr = rb_funcall(itr, rb_intern("to_i"), 0);
|
169
|
+
}
|
170
|
+
|
171
|
+
i_itr = NUM2INT(itr);
|
172
|
+
|
173
|
+
|
174
|
+
ststri_(&i_itr);
|
175
|
+
|
176
|
+
return Qnil;
|
177
|
+
|
178
|
+
}
|
179
|
+
|
180
|
+
#endif
|
181
|
+
|
182
|
+
#if DCLVER >= 530
|
183
|
+
|
184
|
+
static VALUE
|
185
|
+
dcl_ststrp(obj, cxa, cya, vxoff, vyoff)
|
186
|
+
VALUE obj, cxa, cya, vxoff, vyoff;
|
187
|
+
{
|
188
|
+
real i_cxa;
|
189
|
+
real i_cya;
|
190
|
+
real i_vxoff;
|
191
|
+
real i_vyoff;
|
192
|
+
|
193
|
+
if (TYPE(cxa) != T_FLOAT) {
|
194
|
+
cxa = rb_funcall(cxa, rb_intern("to_f"), 0);
|
195
|
+
}
|
196
|
+
if (TYPE(cya) != T_FLOAT) {
|
197
|
+
cya = rb_funcall(cya, rb_intern("to_f"), 0);
|
198
|
+
}
|
199
|
+
if (TYPE(vxoff) != T_FLOAT) {
|
200
|
+
vxoff = rb_funcall(vxoff, rb_intern("to_f"), 0);
|
201
|
+
}
|
202
|
+
if (TYPE(vyoff) != T_FLOAT) {
|
203
|
+
vyoff = rb_funcall(vyoff, rb_intern("to_f"), 0);
|
204
|
+
}
|
205
|
+
|
206
|
+
i_cxa = (real)NUM2DBL(cxa);
|
207
|
+
i_cya = (real)NUM2DBL(cya);
|
208
|
+
i_vxoff = (real)NUM2DBL(vxoff);
|
209
|
+
i_vyoff = (real)NUM2DBL(vyoff);
|
210
|
+
|
211
|
+
|
212
|
+
ststrp_(&i_cxa, &i_cya, &i_vxoff, &i_vyoff);
|
213
|
+
|
214
|
+
return Qnil;
|
215
|
+
|
216
|
+
}
|
217
|
+
|
218
|
+
#endif
|
219
|
+
|
220
|
+
static VALUE
|
221
|
+
dcl_ststrn(obj, itr, cxa, cya, vxoff, vyoff)
|
222
|
+
VALUE obj, itr, cxa, cya, vxoff, vyoff;
|
223
|
+
{
|
224
|
+
integer i_itr;
|
225
|
+
real i_cxa;
|
226
|
+
real i_cya;
|
227
|
+
real i_vxoff;
|
228
|
+
real i_vyoff;
|
229
|
+
|
230
|
+
if ((TYPE(itr) != T_BIGNUM) || (TYPE(itr) != T_FIXNUM)) {
|
231
|
+
itr = rb_funcall(itr, rb_intern("to_i"), 0);
|
232
|
+
}
|
233
|
+
if (TYPE(cxa) != T_FLOAT) {
|
234
|
+
cxa = rb_funcall(cxa, rb_intern("to_f"), 0);
|
235
|
+
}
|
236
|
+
if (TYPE(cya) != T_FLOAT) {
|
237
|
+
cya = rb_funcall(cya, rb_intern("to_f"), 0);
|
238
|
+
}
|
239
|
+
if (TYPE(vxoff) != T_FLOAT) {
|
240
|
+
vxoff = rb_funcall(vxoff, rb_intern("to_f"), 0);
|
241
|
+
}
|
242
|
+
if (TYPE(vyoff) != T_FLOAT) {
|
243
|
+
vyoff = rb_funcall(vyoff, rb_intern("to_f"), 0);
|
244
|
+
}
|
245
|
+
|
246
|
+
i_itr = NUM2INT(itr);
|
247
|
+
i_cxa = (real)NUM2DBL(cxa);
|
248
|
+
i_cya = (real)NUM2DBL(cya);
|
249
|
+
i_vxoff = (real)NUM2DBL(vxoff);
|
250
|
+
i_vyoff = (real)NUM2DBL(vyoff);
|
251
|
+
|
252
|
+
|
253
|
+
ststrn_(&i_itr, &i_cxa, &i_cya, &i_vxoff, &i_vyoff);
|
254
|
+
|
255
|
+
return Qnil;
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
static VALUE
|
260
|
+
dcl_stfrot(obj, ux, uy)
|
261
|
+
VALUE obj, ux, uy;
|
262
|
+
{
|
263
|
+
real i_ux;
|
264
|
+
real i_uy;
|
265
|
+
real o_tx;
|
266
|
+
real o_ty;
|
267
|
+
VALUE tx;
|
268
|
+
VALUE ty;
|
269
|
+
|
270
|
+
if (TYPE(ux) != T_FLOAT) {
|
271
|
+
ux = rb_funcall(ux, rb_intern("to_f"), 0);
|
272
|
+
}
|
273
|
+
if (TYPE(uy) != T_FLOAT) {
|
274
|
+
uy = rb_funcall(uy, rb_intern("to_f"), 0);
|
275
|
+
}
|
276
|
+
|
277
|
+
i_ux = (real)NUM2DBL(ux);
|
278
|
+
i_uy = (real)NUM2DBL(uy);
|
279
|
+
|
280
|
+
|
281
|
+
stfrot_(&i_ux, &i_uy, &o_tx, &o_ty);
|
282
|
+
|
283
|
+
tx = rb_float_new((double)o_tx);
|
284
|
+
ty = rb_float_new((double)o_ty);
|
285
|
+
|
286
|
+
|
287
|
+
return rb_ary_new3(2, tx, ty);
|
288
|
+
|
289
|
+
}
|
290
|
+
|
291
|
+
static VALUE
|
292
|
+
dcl_stirot(obj, tx, ty)
|
293
|
+
VALUE obj, tx, ty;
|
294
|
+
{
|
295
|
+
real i_tx;
|
296
|
+
real i_ty;
|
297
|
+
real o_ux;
|
298
|
+
real o_uy;
|
299
|
+
VALUE ux;
|
300
|
+
VALUE uy;
|
301
|
+
|
302
|
+
if (TYPE(tx) != T_FLOAT) {
|
303
|
+
tx = rb_funcall(tx, rb_intern("to_f"), 0);
|
304
|
+
}
|
305
|
+
if (TYPE(ty) != T_FLOAT) {
|
306
|
+
ty = rb_funcall(ty, rb_intern("to_f"), 0);
|
307
|
+
}
|
308
|
+
|
309
|
+
i_tx = (real)NUM2DBL(tx);
|
310
|
+
i_ty = (real)NUM2DBL(ty);
|
311
|
+
|
312
|
+
|
313
|
+
stirot_(&i_tx, &i_ty, &o_ux, &o_uy);
|
314
|
+
|
315
|
+
ux = rb_float_new((double)o_ux);
|
316
|
+
uy = rb_float_new((double)o_uy);
|
317
|
+
|
318
|
+
|
319
|
+
return rb_ary_new3(2, ux, uy);
|
320
|
+
|
321
|
+
}
|
322
|
+
|
323
|
+
static VALUE
|
324
|
+
dcl_stsrot(obj, theta, phi, psi)
|
325
|
+
VALUE obj, theta, phi, psi;
|
326
|
+
{
|
327
|
+
real i_theta;
|
328
|
+
real i_phi;
|
329
|
+
real i_psi;
|
330
|
+
|
331
|
+
if (TYPE(theta) != T_FLOAT) {
|
332
|
+
theta = rb_funcall(theta, rb_intern("to_f"), 0);
|
333
|
+
}
|
334
|
+
if (TYPE(phi) != T_FLOAT) {
|
335
|
+
phi = rb_funcall(phi, rb_intern("to_f"), 0);
|
336
|
+
}
|
337
|
+
if (TYPE(psi) != T_FLOAT) {
|
338
|
+
psi = rb_funcall(psi, rb_intern("to_f"), 0);
|
339
|
+
}
|
340
|
+
|
341
|
+
i_theta = (real)NUM2DBL(theta);
|
342
|
+
i_phi = (real)NUM2DBL(phi);
|
343
|
+
i_psi = (real)NUM2DBL(psi);
|
344
|
+
|
345
|
+
|
346
|
+
stsrot_(&i_theta, &i_phi, &i_psi);
|
347
|
+
|
348
|
+
return Qnil;
|
349
|
+
|
350
|
+
}
|
351
|
+
|
352
|
+
static VALUE
|
353
|
+
dcl_stfrad(obj, x, y)
|
354
|
+
VALUE obj, x, y;
|
355
|
+
{
|
356
|
+
real i_x;
|
357
|
+
real i_y;
|
358
|
+
real o_rx;
|
359
|
+
real o_ry;
|
360
|
+
VALUE rx;
|
361
|
+
VALUE ry;
|
362
|
+
|
363
|
+
if (TYPE(x) != T_FLOAT) {
|
364
|
+
x = rb_funcall(x, rb_intern("to_f"), 0);
|
365
|
+
}
|
366
|
+
if (TYPE(y) != T_FLOAT) {
|
367
|
+
y = rb_funcall(y, rb_intern("to_f"), 0);
|
368
|
+
}
|
369
|
+
|
370
|
+
i_x = (real)NUM2DBL(x);
|
371
|
+
i_y = (real)NUM2DBL(y);
|
372
|
+
|
373
|
+
|
374
|
+
stfrad_(&i_x, &i_y, &o_rx, &o_ry);
|
375
|
+
|
376
|
+
rx = rb_float_new((double)o_rx);
|
377
|
+
ry = rb_float_new((double)o_ry);
|
378
|
+
|
379
|
+
|
380
|
+
return rb_ary_new3(2, rx, ry);
|
381
|
+
|
382
|
+
}
|
383
|
+
|
384
|
+
static VALUE
|
385
|
+
dcl_stirad(obj, rx, ry)
|
386
|
+
VALUE obj, rx, ry;
|
387
|
+
{
|
388
|
+
real i_rx;
|
389
|
+
real i_ry;
|
390
|
+
real o_x;
|
391
|
+
real o_y;
|
392
|
+
VALUE x;
|
393
|
+
VALUE y;
|
394
|
+
|
395
|
+
if (TYPE(rx) != T_FLOAT) {
|
396
|
+
rx = rb_funcall(rx, rb_intern("to_f"), 0);
|
397
|
+
}
|
398
|
+
if (TYPE(ry) != T_FLOAT) {
|
399
|
+
ry = rb_funcall(ry, rb_intern("to_f"), 0);
|
400
|
+
}
|
401
|
+
|
402
|
+
i_rx = (real)NUM2DBL(rx);
|
403
|
+
i_ry = (real)NUM2DBL(ry);
|
404
|
+
|
405
|
+
|
406
|
+
stirad_(&i_rx, &i_ry, &o_x, &o_y);
|
407
|
+
|
408
|
+
x = rb_float_new((double)o_x);
|
409
|
+
y = rb_float_new((double)o_y);
|
410
|
+
|
411
|
+
|
412
|
+
return rb_ary_new3(2, x, y);
|
413
|
+
|
414
|
+
}
|
415
|
+
|
416
|
+
static VALUE
|
417
|
+
dcl_stsrad(obj, lxdeg, lydeg)
|
418
|
+
VALUE obj, lxdeg, lydeg;
|
419
|
+
{
|
420
|
+
logical i_lxdeg;
|
421
|
+
logical i_lydeg;
|
422
|
+
|
423
|
+
i_lxdeg = ((lxdeg == Qnil)||(lxdeg == Qfalse)) ? FALSE_ : TRUE_;
|
424
|
+
i_lydeg = ((lydeg == Qnil)||(lydeg == Qfalse)) ? FALSE_ : TRUE_;
|
425
|
+
|
426
|
+
|
427
|
+
stsrad_(&i_lxdeg, &i_lydeg);
|
428
|
+
|
429
|
+
return Qnil;
|
430
|
+
|
431
|
+
}
|
432
|
+
|
433
|
+
static VALUE
|
434
|
+
dcl_stfusr(obj, ux, uy)
|
435
|
+
VALUE obj, ux, uy;
|
436
|
+
{
|
437
|
+
real i_ux;
|
438
|
+
real i_uy;
|
439
|
+
real o_xx;
|
440
|
+
real o_yy;
|
441
|
+
VALUE xx;
|
442
|
+
VALUE yy;
|
443
|
+
|
444
|
+
if (TYPE(ux) != T_FLOAT) {
|
445
|
+
ux = rb_funcall(ux, rb_intern("to_f"), 0);
|
446
|
+
}
|
447
|
+
if (TYPE(uy) != T_FLOAT) {
|
448
|
+
uy = rb_funcall(uy, rb_intern("to_f"), 0);
|
449
|
+
}
|
450
|
+
|
451
|
+
i_ux = (real)NUM2DBL(ux);
|
452
|
+
i_uy = (real)NUM2DBL(uy);
|
453
|
+
|
454
|
+
|
455
|
+
stfusr_(&i_ux, &i_uy, &o_xx, &o_yy);
|
456
|
+
|
457
|
+
xx = rb_float_new((double)o_xx);
|
458
|
+
yy = rb_float_new((double)o_yy);
|
459
|
+
|
460
|
+
|
461
|
+
return rb_ary_new3(2, xx, yy);
|
462
|
+
|
463
|
+
}
|
464
|
+
|
465
|
+
static VALUE
|
466
|
+
dcl_stiusr(obj, xx, yy)
|
467
|
+
VALUE obj, xx, yy;
|
468
|
+
{
|
469
|
+
real i_xx;
|
470
|
+
real i_yy;
|
471
|
+
real o_ux;
|
472
|
+
real o_uy;
|
473
|
+
VALUE ux;
|
474
|
+
VALUE uy;
|
475
|
+
|
476
|
+
if (TYPE(xx) != T_FLOAT) {
|
477
|
+
xx = rb_funcall(xx, rb_intern("to_f"), 0);
|
478
|
+
}
|
479
|
+
if (TYPE(yy) != T_FLOAT) {
|
480
|
+
yy = rb_funcall(yy, rb_intern("to_f"), 0);
|
481
|
+
}
|
482
|
+
|
483
|
+
i_xx = (real)NUM2DBL(xx);
|
484
|
+
i_yy = (real)NUM2DBL(yy);
|
485
|
+
|
486
|
+
|
487
|
+
stiusr_(&i_xx, &i_yy, &o_ux, &o_uy);
|
488
|
+
|
489
|
+
ux = rb_float_new((double)o_ux);
|
490
|
+
uy = rb_float_new((double)o_uy);
|
491
|
+
|
492
|
+
|
493
|
+
return rb_ary_new3(2, ux, uy);
|
494
|
+
|
495
|
+
}
|
496
|
+
|
497
|
+
static VALUE
|
498
|
+
dcl_stsusr(obj)
|
499
|
+
VALUE obj;
|
500
|
+
{
|
501
|
+
stsusr_();
|
502
|
+
|
503
|
+
return Qnil;
|
504
|
+
|
505
|
+
}
|
506
|
+
|
507
|
+
static VALUE
|
508
|
+
dcl_stfwtr(obj, rx, ry)
|
509
|
+
VALUE obj, rx, ry;
|
510
|
+
{
|
511
|
+
real i_rx;
|
512
|
+
real i_ry;
|
513
|
+
real o_wx;
|
514
|
+
real o_wy;
|
515
|
+
VALUE wx;
|
516
|
+
VALUE wy;
|
517
|
+
|
518
|
+
if (TYPE(rx) != T_FLOAT) {
|
519
|
+
rx = rb_funcall(rx, rb_intern("to_f"), 0);
|
520
|
+
}
|
521
|
+
if (TYPE(ry) != T_FLOAT) {
|
522
|
+
ry = rb_funcall(ry, rb_intern("to_f"), 0);
|
523
|
+
}
|
524
|
+
|
525
|
+
i_rx = (real)NUM2DBL(rx);
|
526
|
+
i_ry = (real)NUM2DBL(ry);
|
527
|
+
|
528
|
+
|
529
|
+
stfwtr_(&i_rx, &i_ry, &o_wx, &o_wy);
|
530
|
+
|
531
|
+
wx = rb_float_new((double)o_wx);
|
532
|
+
wy = rb_float_new((double)o_wy);
|
533
|
+
|
534
|
+
|
535
|
+
return rb_ary_new3(2, wx, wy);
|
536
|
+
|
537
|
+
}
|
538
|
+
|
539
|
+
static VALUE
|
540
|
+
dcl_stiwtr(obj, wx, wy)
|
541
|
+
VALUE obj, wx, wy;
|
542
|
+
{
|
543
|
+
real i_wx;
|
544
|
+
real i_wy;
|
545
|
+
real o_rx;
|
546
|
+
real o_ry;
|
547
|
+
VALUE rx;
|
548
|
+
VALUE ry;
|
549
|
+
|
550
|
+
if (TYPE(wx) != T_FLOAT) {
|
551
|
+
wx = rb_funcall(wx, rb_intern("to_f"), 0);
|
552
|
+
}
|
553
|
+
if (TYPE(wy) != T_FLOAT) {
|
554
|
+
wy = rb_funcall(wy, rb_intern("to_f"), 0);
|
555
|
+
}
|
556
|
+
|
557
|
+
i_wx = (real)NUM2DBL(wx);
|
558
|
+
i_wy = (real)NUM2DBL(wy);
|
559
|
+
|
560
|
+
|
561
|
+
stiwtr_(&i_wx, &i_wy, &o_rx, &o_ry);
|
562
|
+
|
563
|
+
rx = rb_float_new((double)o_rx);
|
564
|
+
ry = rb_float_new((double)o_ry);
|
565
|
+
|
566
|
+
|
567
|
+
return rb_ary_new3(2, rx, ry);
|
568
|
+
|
569
|
+
}
|
570
|
+
|
571
|
+
static VALUE
|
572
|
+
dcl_stswtr(obj, rxmin, rxmax, rymin, rymax, wxmin, wxmax, wymin, wymax, iwtrf)
|
573
|
+
VALUE obj, rxmin, rxmax, rymin, rymax, wxmin, wxmax, wymin, wymax, iwtrf;
|
574
|
+
{
|
575
|
+
real i_rxmin;
|
576
|
+
real i_rxmax;
|
577
|
+
real i_rymin;
|
578
|
+
real i_rymax;
|
579
|
+
real i_wxmin;
|
580
|
+
real i_wxmax;
|
581
|
+
real i_wymin;
|
582
|
+
real i_wymax;
|
583
|
+
integer i_iwtrf;
|
584
|
+
|
585
|
+
if (TYPE(rxmin) != T_FLOAT) {
|
586
|
+
rxmin = rb_funcall(rxmin, rb_intern("to_f"), 0);
|
587
|
+
}
|
588
|
+
if (TYPE(rxmax) != T_FLOAT) {
|
589
|
+
rxmax = rb_funcall(rxmax, rb_intern("to_f"), 0);
|
590
|
+
}
|
591
|
+
if (TYPE(rymin) != T_FLOAT) {
|
592
|
+
rymin = rb_funcall(rymin, rb_intern("to_f"), 0);
|
593
|
+
}
|
594
|
+
if (TYPE(rymax) != T_FLOAT) {
|
595
|
+
rymax = rb_funcall(rymax, rb_intern("to_f"), 0);
|
596
|
+
}
|
597
|
+
if (TYPE(wxmin) != T_FLOAT) {
|
598
|
+
wxmin = rb_funcall(wxmin, rb_intern("to_f"), 0);
|
599
|
+
}
|
600
|
+
if (TYPE(wxmax) != T_FLOAT) {
|
601
|
+
wxmax = rb_funcall(wxmax, rb_intern("to_f"), 0);
|
602
|
+
}
|
603
|
+
if (TYPE(wymin) != T_FLOAT) {
|
604
|
+
wymin = rb_funcall(wymin, rb_intern("to_f"), 0);
|
605
|
+
}
|
606
|
+
if (TYPE(wymax) != T_FLOAT) {
|
607
|
+
wymax = rb_funcall(wymax, rb_intern("to_f"), 0);
|
608
|
+
}
|
609
|
+
if ((TYPE(iwtrf) != T_BIGNUM) || (TYPE(iwtrf) != T_FIXNUM)) {
|
610
|
+
iwtrf = rb_funcall(iwtrf, rb_intern("to_i"), 0);
|
611
|
+
}
|
612
|
+
|
613
|
+
i_rxmin = (real)NUM2DBL(rxmin);
|
614
|
+
i_rxmax = (real)NUM2DBL(rxmax);
|
615
|
+
i_rymin = (real)NUM2DBL(rymin);
|
616
|
+
i_rymax = (real)NUM2DBL(rymax);
|
617
|
+
i_wxmin = (real)NUM2DBL(wxmin);
|
618
|
+
i_wxmax = (real)NUM2DBL(wxmax);
|
619
|
+
i_wymin = (real)NUM2DBL(wymin);
|
620
|
+
i_wymax = (real)NUM2DBL(wymax);
|
621
|
+
i_iwtrf = NUM2INT(iwtrf);
|
622
|
+
|
623
|
+
|
624
|
+
stswtr_(&i_rxmin, &i_rxmax, &i_rymin, &i_rymax, &i_wxmin, &i_wxmax, &i_wymin, &i_wymax, &i_iwtrf);
|
625
|
+
|
626
|
+
return Qnil;
|
627
|
+
|
628
|
+
}
|
629
|
+
|
630
|
+
static VALUE
|
631
|
+
dcl_stqwtr(obj)
|
632
|
+
VALUE obj;
|
633
|
+
{
|
634
|
+
real o_rxmin;
|
635
|
+
real o_rxmax;
|
636
|
+
real o_rymin;
|
637
|
+
real o_rymax;
|
638
|
+
real o_wxmin;
|
639
|
+
real o_wxmax;
|
640
|
+
real o_wymin;
|
641
|
+
real o_wymax;
|
642
|
+
integer o_iwtrf;
|
643
|
+
VALUE rxmin;
|
644
|
+
VALUE rxmax;
|
645
|
+
VALUE rymin;
|
646
|
+
VALUE rymax;
|
647
|
+
VALUE wxmin;
|
648
|
+
VALUE wxmax;
|
649
|
+
VALUE wymin;
|
650
|
+
VALUE wymax;
|
651
|
+
VALUE iwtrf;
|
652
|
+
|
653
|
+
stqwtr_(&o_rxmin, &o_rxmax, &o_rymin, &o_rymax, &o_wxmin, &o_wxmax, &o_wymin, &o_wymax, &o_iwtrf);
|
654
|
+
|
655
|
+
rxmin = rb_float_new((double)o_rxmin);
|
656
|
+
rxmax = rb_float_new((double)o_rxmax);
|
657
|
+
rymin = rb_float_new((double)o_rymin);
|
658
|
+
rymax = rb_float_new((double)o_rymax);
|
659
|
+
wxmin = rb_float_new((double)o_wxmin);
|
660
|
+
wxmax = rb_float_new((double)o_wxmax);
|
661
|
+
wymin = rb_float_new((double)o_wymin);
|
662
|
+
wymax = rb_float_new((double)o_wymax);
|
663
|
+
iwtrf = INT2NUM(o_iwtrf);
|
664
|
+
|
665
|
+
|
666
|
+
return rb_ary_new3(9, rxmin, rxmax, rymin, rymax, wxmin, wxmax, wymin, wymax, iwtrf);
|
667
|
+
|
668
|
+
}
|
669
|
+
|
670
|
+
static VALUE
|
671
|
+
dcl_stswrc(obj, wsxmn, wsxmx, wsymn, wsymx)
|
672
|
+
VALUE obj, wsxmn, wsxmx, wsymn, wsymx;
|
673
|
+
{
|
674
|
+
real i_wsxmn;
|
675
|
+
real i_wsxmx;
|
676
|
+
real i_wsymn;
|
677
|
+
real i_wsymx;
|
678
|
+
|
679
|
+
if (TYPE(wsxmn) != T_FLOAT) {
|
680
|
+
wsxmn = rb_funcall(wsxmn, rb_intern("to_f"), 0);
|
681
|
+
}
|
682
|
+
if (TYPE(wsxmx) != T_FLOAT) {
|
683
|
+
wsxmx = rb_funcall(wsxmx, rb_intern("to_f"), 0);
|
684
|
+
}
|
685
|
+
if (TYPE(wsymn) != T_FLOAT) {
|
686
|
+
wsymn = rb_funcall(wsymn, rb_intern("to_f"), 0);
|
687
|
+
}
|
688
|
+
if (TYPE(wsymx) != T_FLOAT) {
|
689
|
+
wsymx = rb_funcall(wsymx, rb_intern("to_f"), 0);
|
690
|
+
}
|
691
|
+
|
692
|
+
i_wsxmn = (real)NUM2DBL(wsxmn);
|
693
|
+
i_wsxmx = (real)NUM2DBL(wsxmx);
|
694
|
+
i_wsymn = (real)NUM2DBL(wsymn);
|
695
|
+
i_wsymx = (real)NUM2DBL(wsymx);
|
696
|
+
|
697
|
+
|
698
|
+
stswrc_(&i_wsxmn, &i_wsxmx, &i_wsymn, &i_wsymx);
|
699
|
+
|
700
|
+
return Qnil;
|
701
|
+
|
702
|
+
}
|
703
|
+
|
704
|
+
static VALUE
|
705
|
+
dcl_stqwrc(obj)
|
706
|
+
VALUE obj;
|
707
|
+
{
|
708
|
+
real o_wsxmn;
|
709
|
+
real o_wsxmx;
|
710
|
+
real o_wsymn;
|
711
|
+
real o_wsymx;
|
712
|
+
VALUE wsxmn;
|
713
|
+
VALUE wsxmx;
|
714
|
+
VALUE wsymn;
|
715
|
+
VALUE wsymx;
|
716
|
+
|
717
|
+
stqwrc_(&o_wsxmn, &o_wsxmx, &o_wsymn, &o_wsymx);
|
718
|
+
|
719
|
+
wsxmn = rb_float_new((double)o_wsxmn);
|
720
|
+
wsxmx = rb_float_new((double)o_wsxmx);
|
721
|
+
wsymn = rb_float_new((double)o_wsymn);
|
722
|
+
wsymx = rb_float_new((double)o_wsymx);
|
723
|
+
|
724
|
+
|
725
|
+
return rb_ary_new3(4, wsxmn, wsxmx, wsymn, wsymx);
|
726
|
+
|
727
|
+
}
|
728
|
+
|
729
|
+
static VALUE
|
730
|
+
dcl_stfpr3(obj, x, y, z)
|
731
|
+
VALUE obj, x, y, z;
|
732
|
+
{
|
733
|
+
real i_x;
|
734
|
+
real i_y;
|
735
|
+
real i_z;
|
736
|
+
real o_rx;
|
737
|
+
real o_ry;
|
738
|
+
VALUE rx;
|
739
|
+
VALUE ry;
|
740
|
+
|
741
|
+
if (TYPE(x) != T_FLOAT) {
|
742
|
+
x = rb_funcall(x, rb_intern("to_f"), 0);
|
743
|
+
}
|
744
|
+
if (TYPE(y) != T_FLOAT) {
|
745
|
+
y = rb_funcall(y, rb_intern("to_f"), 0);
|
746
|
+
}
|
747
|
+
if (TYPE(z) != T_FLOAT) {
|
748
|
+
z = rb_funcall(z, rb_intern("to_f"), 0);
|
749
|
+
}
|
750
|
+
|
751
|
+
i_x = (real)NUM2DBL(x);
|
752
|
+
i_y = (real)NUM2DBL(y);
|
753
|
+
i_z = (real)NUM2DBL(z);
|
754
|
+
|
755
|
+
|
756
|
+
stfpr3_(&i_x, &i_y, &i_z, &o_rx, &o_ry);
|
757
|
+
|
758
|
+
rx = rb_float_new((double)o_rx);
|
759
|
+
ry = rb_float_new((double)o_ry);
|
760
|
+
|
761
|
+
|
762
|
+
return rb_ary_new3(2, rx, ry);
|
763
|
+
|
764
|
+
}
|
765
|
+
|
766
|
+
static VALUE
|
767
|
+
dcl_stspr3(obj, xfc, yfc, zfc, theta, phi, psi, fac, zview, rxoff, ryoff)
|
768
|
+
VALUE obj, xfc, yfc, zfc, theta, phi, psi, fac, zview, rxoff, ryoff;
|
769
|
+
{
|
770
|
+
real i_xfc;
|
771
|
+
real i_yfc;
|
772
|
+
real i_zfc;
|
773
|
+
real i_theta;
|
774
|
+
real i_phi;
|
775
|
+
real i_psi;
|
776
|
+
real i_fac;
|
777
|
+
real i_zview;
|
778
|
+
real i_rxoff;
|
779
|
+
real i_ryoff;
|
780
|
+
|
781
|
+
if (TYPE(xfc) != T_FLOAT) {
|
782
|
+
xfc = rb_funcall(xfc, rb_intern("to_f"), 0);
|
783
|
+
}
|
784
|
+
if (TYPE(yfc) != T_FLOAT) {
|
785
|
+
yfc = rb_funcall(yfc, rb_intern("to_f"), 0);
|
786
|
+
}
|
787
|
+
if (TYPE(zfc) != T_FLOAT) {
|
788
|
+
zfc = rb_funcall(zfc, rb_intern("to_f"), 0);
|
789
|
+
}
|
790
|
+
if (TYPE(theta) != T_FLOAT) {
|
791
|
+
theta = rb_funcall(theta, rb_intern("to_f"), 0);
|
792
|
+
}
|
793
|
+
if (TYPE(phi) != T_FLOAT) {
|
794
|
+
phi = rb_funcall(phi, rb_intern("to_f"), 0);
|
795
|
+
}
|
796
|
+
if (TYPE(psi) != T_FLOAT) {
|
797
|
+
psi = rb_funcall(psi, rb_intern("to_f"), 0);
|
798
|
+
}
|
799
|
+
if (TYPE(fac) != T_FLOAT) {
|
800
|
+
fac = rb_funcall(fac, rb_intern("to_f"), 0);
|
801
|
+
}
|
802
|
+
if (TYPE(zview) != T_FLOAT) {
|
803
|
+
zview = rb_funcall(zview, rb_intern("to_f"), 0);
|
804
|
+
}
|
805
|
+
if (TYPE(rxoff) != T_FLOAT) {
|
806
|
+
rxoff = rb_funcall(rxoff, rb_intern("to_f"), 0);
|
807
|
+
}
|
808
|
+
if (TYPE(ryoff) != T_FLOAT) {
|
809
|
+
ryoff = rb_funcall(ryoff, rb_intern("to_f"), 0);
|
810
|
+
}
|
811
|
+
|
812
|
+
i_xfc = (real)NUM2DBL(xfc);
|
813
|
+
i_yfc = (real)NUM2DBL(yfc);
|
814
|
+
i_zfc = (real)NUM2DBL(zfc);
|
815
|
+
i_theta = (real)NUM2DBL(theta);
|
816
|
+
i_phi = (real)NUM2DBL(phi);
|
817
|
+
i_psi = (real)NUM2DBL(psi);
|
818
|
+
i_fac = (real)NUM2DBL(fac);
|
819
|
+
i_zview = (real)NUM2DBL(zview);
|
820
|
+
i_rxoff = (real)NUM2DBL(rxoff);
|
821
|
+
i_ryoff = (real)NUM2DBL(ryoff);
|
822
|
+
|
823
|
+
|
824
|
+
stspr3_(&i_xfc, &i_yfc, &i_zfc, &i_theta, &i_phi, &i_psi, &i_fac, &i_zview, &i_rxoff, &i_ryoff);
|
825
|
+
|
826
|
+
return Qnil;
|
827
|
+
|
828
|
+
}
|
829
|
+
|
830
|
+
static VALUE
|
831
|
+
dcl_stspr2(obj, ix, iy, sect)
|
832
|
+
VALUE obj, ix, iy, sect;
|
833
|
+
{
|
834
|
+
integer i_ix;
|
835
|
+
integer i_iy;
|
836
|
+
real i_sect;
|
837
|
+
|
838
|
+
if ((TYPE(ix) != T_BIGNUM) || (TYPE(ix) != T_FIXNUM)) {
|
839
|
+
ix = rb_funcall(ix, rb_intern("to_i"), 0);
|
840
|
+
}
|
841
|
+
if ((TYPE(iy) != T_BIGNUM) || (TYPE(iy) != T_FIXNUM)) {
|
842
|
+
iy = rb_funcall(iy, rb_intern("to_i"), 0);
|
843
|
+
}
|
844
|
+
if (TYPE(sect) != T_FLOAT) {
|
845
|
+
sect = rb_funcall(sect, rb_intern("to_f"), 0);
|
846
|
+
}
|
847
|
+
|
848
|
+
i_ix = NUM2INT(ix);
|
849
|
+
i_iy = NUM2INT(iy);
|
850
|
+
i_sect = (real)NUM2DBL(sect);
|
851
|
+
|
852
|
+
|
853
|
+
stspr2_(&i_ix, &i_iy, &i_sect);
|
854
|
+
|
855
|
+
return Qnil;
|
856
|
+
|
857
|
+
}
|
858
|
+
|
859
|
+
static VALUE
|
860
|
+
dcl_stepr2(obj)
|
861
|
+
VALUE obj;
|
862
|
+
{
|
863
|
+
stepr2_();
|
864
|
+
|
865
|
+
return Qnil;
|
866
|
+
|
867
|
+
}
|
868
|
+
|
869
|
+
static VALUE
|
870
|
+
dcl_strpr2(obj)
|
871
|
+
VALUE obj;
|
872
|
+
{
|
873
|
+
strpr2_();
|
874
|
+
|
875
|
+
return Qnil;
|
876
|
+
|
877
|
+
}
|
878
|
+
|
879
|
+
static VALUE
|
880
|
+
dcl_stftr3(obj, ux, uy, uz)
|
881
|
+
VALUE obj, ux, uy, uz;
|
882
|
+
{
|
883
|
+
real i_ux;
|
884
|
+
real i_uy;
|
885
|
+
real i_uz;
|
886
|
+
real o_vx;
|
887
|
+
real o_vy;
|
888
|
+
real o_vz;
|
889
|
+
VALUE vx;
|
890
|
+
VALUE vy;
|
891
|
+
VALUE vz;
|
892
|
+
|
893
|
+
if (TYPE(ux) != T_FLOAT) {
|
894
|
+
ux = rb_funcall(ux, rb_intern("to_f"), 0);
|
895
|
+
}
|
896
|
+
if (TYPE(uy) != T_FLOAT) {
|
897
|
+
uy = rb_funcall(uy, rb_intern("to_f"), 0);
|
898
|
+
}
|
899
|
+
if (TYPE(uz) != T_FLOAT) {
|
900
|
+
uz = rb_funcall(uz, rb_intern("to_f"), 0);
|
901
|
+
}
|
902
|
+
|
903
|
+
i_ux = (real)NUM2DBL(ux);
|
904
|
+
i_uy = (real)NUM2DBL(uy);
|
905
|
+
i_uz = (real)NUM2DBL(uz);
|
906
|
+
|
907
|
+
|
908
|
+
stftr3_(&i_ux, &i_uy, &i_uz, &o_vx, &o_vy, &o_vz);
|
909
|
+
|
910
|
+
vx = rb_float_new((double)o_vx);
|
911
|
+
vy = rb_float_new((double)o_vy);
|
912
|
+
vz = rb_float_new((double)o_vz);
|
913
|
+
|
914
|
+
|
915
|
+
return rb_ary_new3(3, vx, vy, vz);
|
916
|
+
|
917
|
+
}
|
918
|
+
|
919
|
+
static VALUE
|
920
|
+
dcl_ststr3(obj, itr, cxa, cya, cza, vxoff, vyoff, vzoff)
|
921
|
+
VALUE obj, itr, cxa, cya, cza, vxoff, vyoff, vzoff;
|
922
|
+
{
|
923
|
+
integer i_itr;
|
924
|
+
real i_cxa;
|
925
|
+
real i_cya;
|
926
|
+
real i_cza;
|
927
|
+
real i_vxoff;
|
928
|
+
real i_vyoff;
|
929
|
+
real i_vzoff;
|
930
|
+
|
931
|
+
if ((TYPE(itr) != T_BIGNUM) || (TYPE(itr) != T_FIXNUM)) {
|
932
|
+
itr = rb_funcall(itr, rb_intern("to_i"), 0);
|
933
|
+
}
|
934
|
+
if (TYPE(cxa) != T_FLOAT) {
|
935
|
+
cxa = rb_funcall(cxa, rb_intern("to_f"), 0);
|
936
|
+
}
|
937
|
+
if (TYPE(cya) != T_FLOAT) {
|
938
|
+
cya = rb_funcall(cya, rb_intern("to_f"), 0);
|
939
|
+
}
|
940
|
+
if (TYPE(cza) != T_FLOAT) {
|
941
|
+
cza = rb_funcall(cza, rb_intern("to_f"), 0);
|
942
|
+
}
|
943
|
+
if (TYPE(vxoff) != T_FLOAT) {
|
944
|
+
vxoff = rb_funcall(vxoff, rb_intern("to_f"), 0);
|
945
|
+
}
|
946
|
+
if (TYPE(vyoff) != T_FLOAT) {
|
947
|
+
vyoff = rb_funcall(vyoff, rb_intern("to_f"), 0);
|
948
|
+
}
|
949
|
+
if (TYPE(vzoff) != T_FLOAT) {
|
950
|
+
vzoff = rb_funcall(vzoff, rb_intern("to_f"), 0);
|
951
|
+
}
|
952
|
+
|
953
|
+
i_itr = NUM2INT(itr);
|
954
|
+
i_cxa = (real)NUM2DBL(cxa);
|
955
|
+
i_cya = (real)NUM2DBL(cya);
|
956
|
+
i_cza = (real)NUM2DBL(cza);
|
957
|
+
i_vxoff = (real)NUM2DBL(vxoff);
|
958
|
+
i_vyoff = (real)NUM2DBL(vyoff);
|
959
|
+
i_vzoff = (real)NUM2DBL(vzoff);
|
960
|
+
|
961
|
+
|
962
|
+
ststr3_(&i_itr, &i_cxa, &i_cya, &i_cza, &i_vxoff, &i_vyoff, &i_vzoff);
|
963
|
+
|
964
|
+
return Qnil;
|
965
|
+
|
966
|
+
}
|
967
|
+
|
968
|
+
static VALUE
|
969
|
+
dcl_stsrd3(obj, lxrd, lyrd, lzrd)
|
970
|
+
VALUE obj, lxrd, lyrd, lzrd;
|
971
|
+
{
|
972
|
+
logical i_lxrd;
|
973
|
+
logical i_lyrd;
|
974
|
+
logical i_lzrd;
|
975
|
+
|
976
|
+
i_lxrd = ((lxrd == Qnil)||(lxrd == Qfalse)) ? FALSE_ : TRUE_;
|
977
|
+
i_lyrd = ((lyrd == Qnil)||(lyrd == Qfalse)) ? FALSE_ : TRUE_;
|
978
|
+
i_lzrd = ((lzrd == Qnil)||(lzrd == Qfalse)) ? FALSE_ : TRUE_;
|
979
|
+
|
980
|
+
|
981
|
+
stsrd3_(&i_lxrd, &i_lyrd, &i_lzrd);
|
982
|
+
|
983
|
+
return Qnil;
|
984
|
+
|
985
|
+
}
|
986
|
+
|
987
|
+
static VALUE
|
988
|
+
dcl_stslg3(obj, lxlg, lylg, lzlg)
|
989
|
+
VALUE obj, lxlg, lylg, lzlg;
|
990
|
+
{
|
991
|
+
logical i_lxlg;
|
992
|
+
logical i_lylg;
|
993
|
+
logical i_lzlg;
|
994
|
+
|
995
|
+
i_lxlg = ((lxlg == Qnil)||(lxlg == Qfalse)) ? FALSE_ : TRUE_;
|
996
|
+
i_lylg = ((lylg == Qnil)||(lylg == Qfalse)) ? FALSE_ : TRUE_;
|
997
|
+
i_lzlg = ((lzlg == Qnil)||(lzlg == Qfalse)) ? FALSE_ : TRUE_;
|
998
|
+
|
999
|
+
|
1000
|
+
stslg3_(&i_lxlg, &i_lylg, &i_lzlg);
|
1001
|
+
|
1002
|
+
return Qnil;
|
1003
|
+
|
1004
|
+
}
|
1005
|
+
void
|
1006
|
+
init_grph1_stpack(mDCL)
|
1007
|
+
VALUE mDCL;
|
1008
|
+
{
|
1009
|
+
rb_define_module_function(mDCL, "stqtrf", dcl_stqtrf, 0);
|
1010
|
+
rb_define_module_function(mDCL, "ststrf", dcl_ststrf, 1);
|
1011
|
+
rb_define_module_function(mDCL, "stftrn", dcl_stftrn, 2);
|
1012
|
+
rb_define_module_function(mDCL, "stitrn", dcl_stitrn, 2);
|
1013
|
+
#if DCLVER >= 530
|
1014
|
+
rb_define_module_function(mDCL, "ststri", dcl_ststri, 1);
|
1015
|
+
#endif
|
1016
|
+
#if DCLVER >= 530
|
1017
|
+
rb_define_module_function(mDCL, "ststrp", dcl_ststrp, 4);
|
1018
|
+
#endif
|
1019
|
+
rb_define_module_function(mDCL, "ststrn", dcl_ststrn, 5);
|
1020
|
+
rb_define_module_function(mDCL, "stfrot", dcl_stfrot, 2);
|
1021
|
+
rb_define_module_function(mDCL, "stirot", dcl_stirot, 2);
|
1022
|
+
rb_define_module_function(mDCL, "stsrot", dcl_stsrot, 3);
|
1023
|
+
rb_define_module_function(mDCL, "stfrad", dcl_stfrad, 2);
|
1024
|
+
rb_define_module_function(mDCL, "stirad", dcl_stirad, 2);
|
1025
|
+
rb_define_module_function(mDCL, "stsrad", dcl_stsrad, 2);
|
1026
|
+
rb_define_module_function(mDCL, "stfusr", dcl_stfusr, 2);
|
1027
|
+
rb_define_module_function(mDCL, "stiusr", dcl_stiusr, 2);
|
1028
|
+
rb_define_module_function(mDCL, "stsusr", dcl_stsusr, 0);
|
1029
|
+
rb_define_module_function(mDCL, "stfwtr", dcl_stfwtr, 2);
|
1030
|
+
rb_define_module_function(mDCL, "stiwtr", dcl_stiwtr, 2);
|
1031
|
+
rb_define_module_function(mDCL, "stswtr", dcl_stswtr, 9);
|
1032
|
+
rb_define_module_function(mDCL, "stqwtr", dcl_stqwtr, 0);
|
1033
|
+
rb_define_module_function(mDCL, "stswrc", dcl_stswrc, 4);
|
1034
|
+
rb_define_module_function(mDCL, "stqwrc", dcl_stqwrc, 0);
|
1035
|
+
rb_define_module_function(mDCL, "stfpr3", dcl_stfpr3, 3);
|
1036
|
+
rb_define_module_function(mDCL, "stspr3", dcl_stspr3, 10);
|
1037
|
+
rb_define_module_function(mDCL, "stspr2", dcl_stspr2, 3);
|
1038
|
+
rb_define_module_function(mDCL, "stepr2", dcl_stepr2, 0);
|
1039
|
+
rb_define_module_function(mDCL, "strpr2", dcl_strpr2, 0);
|
1040
|
+
rb_define_module_function(mDCL, "stftr3", dcl_stftr3, 3);
|
1041
|
+
rb_define_module_function(mDCL, "ststr3", dcl_ststr3, 7);
|
1042
|
+
rb_define_module_function(mDCL, "stsrd3", dcl_stsrd3, 3);
|
1043
|
+
rb_define_module_function(mDCL, "stslg3", dcl_stslg3, 3);
|
1044
|
+
}
|