-
Notifications
You must be signed in to change notification settings - Fork 68
/
seuif97.py
257 lines (172 loc) · 4.33 KB
/
seuif97.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# -*- coding: utf-8 -*-
from ctypes import *
from platform import *
cdll_names = {'Linux': 'libseuif97.so',
'Windows': 'libseuif97.dll'}
osplat = system()
if (osplat == 'Linux'):
flib = cdll.LoadLibrary(cdll_names[osplat])
prototype = CFUNCTYPE(c_double, c_double, c_double, c_int)
elif (osplat == 'Windows'):
flib = windll.LoadLibrary(cdll_names[osplat])
prototype = WINFUNCTYPE(c_double, c_double, c_double, c_int)
# ---(p,t) ----------------
def pt(p, t, pid):
f = prototype(("seupt", flib),)
result = f(p, t, pid)
return result
def pt2h(p, t):
f = prototype(("seupt", flib),)
result = f(p, t, 4)
return result
def pt2s(p, t):
f = prototype(("seupt", flib),)
result = f(p, t, 5)
return result
def pt2v(p, t):
f = prototype(("seupt", flib),)
result = f(p, t, 3)
return result
def pt2x(p, t):
f = prototype(("seupt", flib),)
result = f(p, t, 15)
return result
# --- (p,h) -------------------
def ph(p, h, pid):
f = prototype(("seuph", flib),)
result = f(p, h, pid)
return result
def ph2s(p, h):
f = prototype(("seuph", flib),)
result = f(p, h, 5)
return result
def ph2v(p, h):
f = prototype(("seuph", flib),)
result = f(p, h, 3)
return result
def ph2t(p, h):
f = prototype(("seuph", flib),)
result = f(p, h, 1)
return result
def ph2x(p, h):
f = prototype(("seuph", flib),)
result = f(p, h, 15)
return result
# ---- (p,s) --------------------
def ps(p, s, pid):
f = prototype(("seups", flib),)
result = f(p, s, pid)
return result
def ps2t(p, s):
f = prototype(("seups", flib),)
result = f(p, s, 1)
return result
def ps2h(p, s):
f = prototype(("seups", flib),)
result = f(p, s, 4)
return result
def ps2v(p, s):
f = prototype(("seups", flib),)
result = f(p, s, 3)
return result
def ps2x(p, s):
f = prototype(("seups", flib),)
result = f(p, s, 15)
return result
# ---- (h,s)--------------
def hs(h, s, pid):
f = prototype(("seuhs", flib),)
result = f(h, s, pid)
return result
def hs2t(h, s):
f = prototype(("seuhs", flib),)
result = f(h, s, 1)
return result
def hs2p(h, s):
f = prototype(("seuhs", flib),)
result = f(h, s, 0)
return result
def hs2v(h, s):
f = prototype(("seuhs", flib),)
result = f(h, s, 3)
return result
def hs2x(h, s):
f = prototype(("seuhs", flib),)
result = f(h, s, 15)
return result
# --- (t,s) -----
def ts(t, s, pid):
f = prototype(("seuts", flib),)
result = f(t, s, pid)
return resul
def ts2p(t, s):
f = prototype(("seuts", flib),)
result = f(t, s, 0)
return result
def ts2v(t, s):
f = prototype(("seuts", flib),)
result = f(t, s, 3)
return result
def ts2h(t, s):
f = prototype(("seuts", flib),)
result = f(t, s, 4)
return result
def ts2x(t, s):
f = prototype(("seuts", flib),)
result = f(t, s, 15)
return result
# --- (p,x) -------------------
def px(p, x, pid):
f = prototype(("seupx", flib),)
result = f(p, x, pid)
return result
def px2t(p, x):
f = prototype(("seupx", flib),)
result = f(p, x, 1)
return result
def px2h(p, x):
f = prototype(("seupx", flib),)
result = f(p, x, 4)
return result
def px2s(p, x):
f = prototype(("seupx", flib),)
result = f(p, x, 5)
return result
def px2v(p, x):
f = prototype(("seupx", flib),)
result = f(p, x, 3)
return result
# --- (t,x) ------------
def tx(t, x, pid):
f = prototype(("seutx", flib),)
result = f(t, x, pid)
return result
def tx2p(t, x):
f = prototype(("seutx", flib),)
result = f(t, x, 0)
return result
def tx2v(t, x):
f = prototype(("seutx", flib),)
result = f(t, x, 3)
return result
def tx2h(t, x):
f = prototype(("seutx", flib),)
result = f(t, x, 4)
return result
def tx2s(t, x):
f = prototype(("seutx", flib),)
result = f(t, x, 5)
return result
# ---------- processing ------------
def ishd(p1, t1, p2):
f = flib.seuishd
f.argtypes = [c_double, c_double, c_double]
f.restype = c_double
result = f(p1, t1, p2)
return result
def ief(p1, t1, p2, t2):
f = flib.seuief
f.argtypes = [c_double, c_double, c_double, c_double]
f.restype = c_double
result = f(p1, t1, p2, t2)
return result