gsl4r 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/test/complex_test.rb CHANGED
@@ -5,64 +5,26 @@ require 'gsl4r/complex'
5
5
  include GSL4r::Complex
6
6
  class ComplexTests < Test::Unit::TestCase
7
7
  EPSILON = 5.0e-15
8
- def test_gsl_complex_tanh()
9
- v64 = GSL_Complex.create
10
- v64.set(2.0,2.0)
11
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_tanh(v64)
12
- r_r2 = GSL_Complex.new
13
- r_r2.set(1.02383559457047,-0.0283929528682323)
14
- assert r_r1.equals(r_r2)
15
- end
16
- def test_gsl_complex_pow_real()
17
- v37 = GSL_Complex.create
18
- v37.set(2.0,2.0)
8
+ def test_gsl_complex_add_real()
9
+ v12 = GSL_Complex.create
10
+ v12.set(2.0,2.0)
19
11
 
20
- v38 = 2.0
21
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_pow_real(v37,v38)
22
- r_r2 = GSL_Complex.new
23
- r_r2.set(4.89858719658941e-16,8)
24
- assert r_r1.equals(r_r2)
25
- end
26
- def test_gsl_complex_sinh()
27
- v60 = GSL_Complex.create
28
- v60.set(2.0,2.0)
29
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_sinh(v60)
30
- r_r2 = GSL_Complex.new
31
- r_r2.set(-1.50930648532362,3.42095486111701)
32
- assert r_r1.equals(r_r2)
33
- end
34
- def test_gsl_complex_sqrt()
35
- v31 = GSL_Complex.create
36
- v31.set(2.0,2.0)
37
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_sqrt(v31)
38
- r_r2 = GSL_Complex.new
39
- r_r2.set(1.55377397403004,0.643594252905582)
40
- assert r_r1.equals(r_r2)
41
- end
42
- def test_gsl_complex_arccsc()
43
- v56 = GSL_Complex.create
44
- v56.set(2.0,2.0)
45
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccsc(v56)
12
+ v13 = 2.0
13
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_add_real(v12,v13)
46
14
  r_r2 = GSL_Complex.new
47
- r_r2.set(0.24452216513554,-0.254895573340551)
15
+ r_r2.set(4,2)
48
16
  assert r_r1.equals(r_r2)
49
17
  end
50
- def test_gsl_complex_div_imag()
51
- v26 = GSL_Complex.create
52
- v26.set(2.0,2.0)
53
-
54
- v27 = 2.0
55
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_div_imag(v26,v27)
18
+ def test_gsl_complex_pow()
19
+ v35 = GSL_Complex.create
20
+ v35.set(2.0,2.0)
21
+ v36 = GSL_Complex.create
22
+ v36.set(2.0,2.0)
23
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_pow(v35,v36)
56
24
  r_r2 = GSL_Complex.new
57
- r_r2.set(1,-1)
25
+ r_r2.set(-1.4525046270557,-0.8098895463353)
58
26
  assert r_r1.equals(r_r2)
59
27
  end
60
- def test_gsl_complex_abs2()
61
- v3 = GSL_Complex.create
62
- v3.set(2.0,2.0)
63
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_abs2(v3)
64
- assert_in_delta r_r1, 8, EPSILON
65
- end
66
28
  def test_gsl_complex_arccos()
67
29
  v52 = GSL_Complex.create
68
30
  v52.set(2.0,2.0)
@@ -71,12 +33,12 @@ def test_gsl_complex_arccos()
71
33
  r_r2.set(0.816547182096851,-1.73432452148797)
72
34
  assert r_r1.equals(r_r2)
73
35
  end
74
- def test_gsl_complex_arccoth()
75
- v73 = GSL_Complex.create
76
- v73.set(2.0,2.0)
77
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccoth(v73)
36
+ def test_gsl_complex_arcsinh()
37
+ v66 = GSL_Complex.create
38
+ v66.set(2.0,2.0)
39
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arcsinh(v66)
78
40
  r_r2 = GSL_Complex.new
79
- r_r2.set(0.238877861256859,-0.259573057123261)
41
+ r_r2.set(1.73432452148797,0.754249144698046)
80
42
  assert r_r1.equals(r_r2)
81
43
  end
82
44
  def test_gsl_complex_div_real()
@@ -89,12 +51,20 @@ def test_gsl_complex_div_real()
89
51
  r_r2.set(1,1)
90
52
  assert r_r1.equals(r_r2)
91
53
  end
92
- def test_gsl_complex_tan()
93
- v48 = GSL_Complex.create
94
- v48.set(2.0,2.0)
95
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_tan(v48)
54
+ def test_gsl_complex_log()
55
+ v40 = GSL_Complex.create
56
+ v40.set(2.0,2.0)
57
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_log(v40)
96
58
  r_r2 = GSL_Complex.new
97
- r_r2.set(-0.0283929528682323,1.02383559457047)
59
+ r_r2.set(1.03972077083992,0.785398163397448)
60
+ assert r_r1.equals(r_r2)
61
+ end
62
+ def test_gsl_complex_arcsec_real()
63
+
64
+ v55 = 2.0
65
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arcsec_real(v55)
66
+ r_r2 = GSL_Complex.new
67
+ r_r2.set(1.0471975511966,0)
98
68
  assert r_r1.equals(r_r2)
99
69
  end
100
70
  def test_gsl_complex_arcsech()
@@ -105,14 +75,14 @@ def test_gsl_complex_arcsech()
105
75
  r_r2.set(0.254895573340551,-1.32627416165936)
106
76
  assert r_r1.equals(r_r2)
107
77
  end
108
- def test_gsl_complex_div()
109
- v10 = GSL_Complex.create
110
- v10.set(2.0,2.0)
111
- v11 = GSL_Complex.create
112
- v11.set(2.0,2.0)
113
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_div(v10,v11)
78
+ def test_gsl_complex_mul_imag()
79
+ v24 = GSL_Complex.create
80
+ v24.set(2.0,2.0)
81
+
82
+ v25 = 2.0
83
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_mul_imag(v24,v25)
114
84
  r_r2 = GSL_Complex.new
115
- r_r2.set(1,0)
85
+ r_r2.set(-4,4)
116
86
  assert r_r1.equals(r_r2)
117
87
  end
118
88
  def test_gsl_complex_sin()
@@ -123,22 +93,44 @@ def test_gsl_complex_sin()
123
93
  r_r2.set(3.42095486111701,-1.50930648532362)
124
94
  assert r_r1.equals(r_r2)
125
95
  end
126
- def test_gsl_complex_coth()
127
- v65 = GSL_Complex.create
128
- v65.set(2.0,2.0)
129
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_coth(v65)
96
+ def test_gsl_complex_arctan()
97
+ v58 = GSL_Complex.create
98
+ v58.set(2.0,2.0)
99
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arctan(v58)
130
100
  r_r2 = GSL_Complex.new
131
- r_r2.set(0.975968735117309,0.0270655117325545)
101
+ r_r2.set(1.31122326967164,0.238877861256859)
132
102
  assert r_r1.equals(r_r2)
133
103
  end
134
- def test_gsl_complex_exp()
135
- v39 = GSL_Complex.create
136
- v39.set(2.0,2.0)
137
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_exp(v39)
104
+ def test_gsl_complex_arctanh_real()
105
+
106
+ v72 = 2.0
107
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arctanh_real(v72)
138
108
  r_r2 = GSL_Complex.new
139
- r_r2.set(-3.07493232063936,6.71884969742825)
109
+ r_r2.set(0.549306144334055,-1.5707963267949)
110
+ assert r_r1.equals(r_r2)
111
+ end
112
+ def test_gsl_complex_inverse()
113
+ v29 = GSL_Complex.create
114
+ v29.set(2.0,2.0)
115
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_inverse(v29)
116
+ r_r2 = GSL_Complex.new
117
+ r_r2.set(0.25,-0.25)
118
+ assert r_r1.equals(r_r2)
119
+ end
120
+ def test_gsl_complex_csc()
121
+ v47 = GSL_Complex.create
122
+ v47.set(2.0,2.0)
123
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_csc(v47)
124
+ r_r2 = GSL_Complex.new
125
+ r_r2.set(0.244687073586957,0.107954592221385)
140
126
  assert r_r1.equals(r_r2)
141
127
  end
128
+ def test_gsl_complex_arg()
129
+ v1 = GSL_Complex.create
130
+ v1.set(2.0,2.0)
131
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arg(v1)
132
+ assert_in_delta r_r1, 0.785398163397448, EPSILON
133
+ end
142
134
  def test_gsl_complex_cosh()
143
135
  v61 = GSL_Complex.create
144
136
  v61.set(2.0,2.0)
@@ -147,6 +139,16 @@ def test_gsl_complex_cosh()
147
139
  r_r2.set(-1.56562583531574,3.29789483631124)
148
140
  assert r_r1.equals(r_r2)
149
141
  end
142
+ def test_gsl_complex_mul()
143
+ v8 = GSL_Complex.create
144
+ v8.set(2.0,2.0)
145
+ v9 = GSL_Complex.create
146
+ v9.set(2.0,2.0)
147
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_mul(v8,v9)
148
+ r_r2 = GSL_Complex.new
149
+ r_r2.set(0,8)
150
+ assert r_r1.equals(r_r2)
151
+ end
150
152
  def test_gsl_complex_sqrt_real()
151
153
 
152
154
  v32 = 2.0
@@ -155,20 +157,40 @@ def test_gsl_complex_sqrt_real()
155
157
  r_r2.set(1.4142135623731,0)
156
158
  assert r_r1.equals(r_r2)
157
159
  end
158
- def test_gsl_complex_arccsc_real()
160
+ def test_gsl_complex_arcsin()
161
+ v50 = GSL_Complex.create
162
+ v50.set(2.0,2.0)
163
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arcsin(v50)
164
+ r_r2 = GSL_Complex.new
165
+ r_r2.set(0.754249144698046,1.73432452148797)
166
+ assert r_r1.equals(r_r2)
167
+ end
168
+ def test_gsl_complex_tanh()
169
+ v64 = GSL_Complex.create
170
+ v64.set(2.0,2.0)
171
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_tanh(v64)
172
+ r_r2 = GSL_Complex.new
173
+ r_r2.set(1.02383559457047,-0.0283929528682323)
174
+ assert r_r1.equals(r_r2)
175
+ end
176
+ def test_gsl_complex_sub_real()
177
+ v14 = GSL_Complex.create
178
+ v14.set(2.0,2.0)
159
179
 
160
- v57 = 2.0
161
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccsc_real(v57)
180
+ v15 = 2.0
181
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_sub_real(v14,v15)
162
182
  r_r2 = GSL_Complex.new
163
- r_r2.set(0.523598775598299,0)
183
+ r_r2.set(0,2)
164
184
  assert r_r1.equals(r_r2)
165
185
  end
166
- def test_gsl_complex_conjugate()
167
- v28 = GSL_Complex.create
168
- v28.set(2.0,2.0)
169
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_conjugate(v28)
186
+ def test_gsl_complex_pow_real()
187
+ v37 = GSL_Complex.create
188
+ v37.set(2.0,2.0)
189
+
190
+ v38 = 2.0
191
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_pow_real(v37,v38)
170
192
  r_r2 = GSL_Complex.new
171
- r_r2.set(2,-2)
193
+ r_r2.set(4.89858719658941e-16,8)
172
194
  assert r_r1.equals(r_r2)
173
195
  end
174
196
  def test_gsl_complex_arccos_real()
@@ -179,6 +201,14 @@ def test_gsl_complex_arccos_real()
179
201
  r_r2.set(0,1.31695789692482)
180
202
  assert r_r1.equals(r_r2)
181
203
  end
204
+ def test_gsl_complex_arccosh()
205
+ v67 = GSL_Complex.create
206
+ v67.set(2.0,2.0)
207
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccosh(v67)
208
+ r_r2 = GSL_Complex.new
209
+ r_r2.set(1.73432452148797,0.816547182096851)
210
+ assert r_r1.equals(r_r2)
211
+ end
182
212
  def test_gsl_complex_add_imag()
183
213
  v20 = GSL_Complex.create
184
214
  v20.set(2.0,2.0)
@@ -189,12 +219,20 @@ def test_gsl_complex_add_imag()
189
219
  r_r2.set(2,4)
190
220
  assert r_r1.equals(r_r2)
191
221
  end
192
- def test_gsl_complex_cot()
193
- v49 = GSL_Complex.create
194
- v49.set(2.0,2.0)
195
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_cot(v49)
222
+ def test_gsl_complex_log10()
223
+ v41 = GSL_Complex.create
224
+ v41.set(2.0,2.0)
225
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_log10(v41)
196
226
  r_r2 = GSL_Complex.new
197
- r_r2.set(-0.0270655117325545,-0.975968735117309)
227
+ r_r2.set(0.451544993495972,0.34109408846046)
228
+ assert r_r1.equals(r_r2)
229
+ end
230
+ def test_gsl_complex_arccsc()
231
+ v56 = GSL_Complex.create
232
+ v56.set(2.0,2.0)
233
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccsc(v56)
234
+ r_r2 = GSL_Complex.new
235
+ r_r2.set(0.24452216513554,-0.254895573340551)
198
236
  assert r_r1.equals(r_r2)
199
237
  end
200
238
  def test_gsl_complex_arccsch()
@@ -205,14 +243,14 @@ def test_gsl_complex_arccsch()
205
243
  r_r2.set(0.254895573340551,-0.24452216513554)
206
244
  assert r_r1.equals(r_r2)
207
245
  end
208
- def test_gsl_complex_add_real()
209
- v12 = GSL_Complex.create
210
- v12.set(2.0,2.0)
246
+ def test_gsl_complex_div_imag()
247
+ v26 = GSL_Complex.create
248
+ v26.set(2.0,2.0)
211
249
 
212
- v13 = 2.0
213
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_add_real(v12,v13)
250
+ v27 = 2.0
251
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_div_imag(v26,v27)
214
252
  r_r2 = GSL_Complex.new
215
- r_r2.set(4,2)
253
+ r_r2.set(1,-1)
216
254
  assert r_r1.equals(r_r2)
217
255
  end
218
256
  def test_gsl_complex_cos()
@@ -223,12 +261,20 @@ def test_gsl_complex_cos()
223
261
  r_r2.set(-1.56562583531574,-3.29789483631124)
224
262
  assert r_r1.equals(r_r2)
225
263
  end
226
- def test_gsl_complex_arcsinh()
227
- v66 = GSL_Complex.create
228
- v66.set(2.0,2.0)
229
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arcsinh(v66)
264
+ def test_gsl_complex_arccot()
265
+ v59 = GSL_Complex.create
266
+ v59.set(2.0,2.0)
267
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccot(v59)
230
268
  r_r2 = GSL_Complex.new
231
- r_r2.set(1.73432452148797,0.754249144698046)
269
+ r_r2.set(0.259573057123261,-0.238877861256859)
270
+ assert r_r1.equals(r_r2)
271
+ end
272
+ def test_gsl_complex_arccoth()
273
+ v73 = GSL_Complex.create
274
+ v73.set(2.0,2.0)
275
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccoth(v73)
276
+ r_r2 = GSL_Complex.new
277
+ r_r2.set(0.238877861256859,-0.259573057123261)
232
278
  assert r_r1.equals(r_r2)
233
279
  end
234
280
  def test_gsl_complex_add()
@@ -241,14 +287,28 @@ def test_gsl_complex_add()
241
287
  r_r2.set(4,4)
242
288
  assert r_r1.equals(r_r2)
243
289
  end
244
- def test_gsl_complex_log()
245
- v40 = GSL_Complex.create
246
- v40.set(2.0,2.0)
247
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_log(v40)
290
+ def test_gsl_complex_negative()
291
+ v30 = GSL_Complex.create
292
+ v30.set(2.0,2.0)
293
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_negative(v30)
248
294
  r_r2 = GSL_Complex.new
249
- r_r2.set(1.03972077083992,0.785398163397448)
295
+ r_r2.set(-2,-2)
250
296
  assert r_r1.equals(r_r2)
251
297
  end
298
+ def test_gsl_complex_tan()
299
+ v48 = GSL_Complex.create
300
+ v48.set(2.0,2.0)
301
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_tan(v48)
302
+ r_r2 = GSL_Complex.new
303
+ r_r2.set(-0.0283929528682323,1.02383559457047)
304
+ assert r_r1.equals(r_r2)
305
+ end
306
+ def test_gsl_complex_abs()
307
+ v2 = GSL_Complex.create
308
+ v2.set(2.0,2.0)
309
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_abs(v2)
310
+ assert_in_delta r_r1, 2.82842712474619, EPSILON
311
+ end
252
312
  def test_gsl_complex_sech()
253
313
  v62 = GSL_Complex.create
254
314
  v62.set(2.0,2.0)
@@ -257,6 +317,16 @@ def test_gsl_complex_sech()
257
317
  r_r2.set(-0.117475142661415,-0.24745418582076)
258
318
  assert r_r1.equals(r_r2)
259
319
  end
320
+ def test_gsl_complex_div()
321
+ v10 = GSL_Complex.create
322
+ v10.set(2.0,2.0)
323
+ v11 = GSL_Complex.create
324
+ v11.set(2.0,2.0)
325
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_div(v10,v11)
326
+ r_r2 = GSL_Complex.new
327
+ r_r2.set(1,0)
328
+ assert r_r1.equals(r_r2)
329
+ end
260
330
  def test_gsl_complex_polar()
261
331
 
262
332
  v33 = 2.0
@@ -267,20 +337,38 @@ def test_gsl_complex_polar()
267
337
  r_r2.set(-0.832293673094285,1.81859485365136)
268
338
  assert r_r1.equals(r_r2)
269
339
  end
270
- def test_gsl_complex_arctan()
271
- v58 = GSL_Complex.create
272
- v58.set(2.0,2.0)
273
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arctan(v58)
340
+ def test_gsl_complex_arcsin_real()
341
+
342
+ v51 = 2.0
343
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arcsin_real(v51)
274
344
  r_r2 = GSL_Complex.new
275
- r_r2.set(1.31122326967164,0.238877861256859)
345
+ r_r2.set(1.5707963267949,-1.31695789692482)
276
346
  assert r_r1.equals(r_r2)
277
347
  end
278
- def test_gsl_complex_inverse()
279
- v29 = GSL_Complex.create
280
- v29.set(2.0,2.0)
281
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_inverse(v29)
348
+ def test_gsl_complex_coth()
349
+ v65 = GSL_Complex.create
350
+ v65.set(2.0,2.0)
351
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_coth(v65)
282
352
  r_r2 = GSL_Complex.new
283
- r_r2.set(0.25,-0.25)
353
+ r_r2.set(0.975968735117309,0.0270655117325545)
354
+ assert r_r1.equals(r_r2)
355
+ end
356
+ def test_gsl_complex_mul_real()
357
+ v16 = GSL_Complex.create
358
+ v16.set(2.0,2.0)
359
+
360
+ v17 = 2.0
361
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_mul_real(v16,v17)
362
+ r_r2 = GSL_Complex.new
363
+ r_r2.set(4,4)
364
+ assert r_r1.equals(r_r2)
365
+ end
366
+ def test_gsl_complex_exp()
367
+ v39 = GSL_Complex.create
368
+ v39.set(2.0,2.0)
369
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_exp(v39)
370
+ r_r2 = GSL_Complex.new
371
+ r_r2.set(-3.07493232063936,6.71884969742825)
284
372
  assert r_r1.equals(r_r2)
285
373
  end
286
374
  def test_gsl_complex_arcsec()
@@ -291,6 +379,14 @@ def test_gsl_complex_arcsec()
291
379
  r_r2.set(1.32627416165936,0.254895573340551)
292
380
  assert r_r1.equals(r_r2)
293
381
  end
382
+ def test_gsl_complex_arccosh_real()
383
+
384
+ v68 = 2.0
385
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccosh_real(v68)
386
+ r_r2 = GSL_Complex.new
387
+ r_r2.set(1.31695789692482,0)
388
+ assert r_r1.equals(r_r2)
389
+ end
294
390
  def test_gsl_complex_sub_imag()
295
391
  v22 = GSL_Complex.create
296
392
  v22.set(2.0,2.0)
@@ -301,19 +397,23 @@ def test_gsl_complex_sub_imag()
301
397
  r_r2.set(2,0)
302
398
  assert r_r1.equals(r_r2)
303
399
  end
304
- def test_gsl_complex_arcsin()
305
- v50 = GSL_Complex.create
306
- v50.set(2.0,2.0)
307
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arcsin(v50)
400
+ def test_gsl_complex_log_b()
401
+ v42 = GSL_Complex.create
402
+ v42.set(2.0,2.0)
403
+ v43 = GSL_Complex.create
404
+ v43.set(2.0,2.0)
405
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_log_b(v42,v43)
308
406
  r_r2 = GSL_Complex.new
309
- r_r2.set(0.754249144698046,1.73432452148797)
407
+ r_r2.set(1,0)
310
408
  assert r_r1.equals(r_r2)
311
409
  end
312
- def test_gsl_complex_arg()
313
- v1 = GSL_Complex.create
314
- v1.set(2.0,2.0)
315
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arg(v1)
316
- assert_in_delta r_r1, 0.785398163397448, EPSILON
410
+ def test_gsl_complex_arccsc_real()
411
+
412
+ v57 = 2.0
413
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccsc_real(v57)
414
+ r_r2 = GSL_Complex.new
415
+ r_r2.set(0.523598775598299,0)
416
+ assert r_r1.equals(r_r2)
317
417
  end
318
418
  def test_gsl_complex_arctanh()
319
419
  v71 = GSL_Complex.create
@@ -323,14 +423,12 @@ def test_gsl_complex_arctanh()
323
423
  r_r2.set(0.238877861256859,1.31122326967164)
324
424
  assert r_r1.equals(r_r2)
325
425
  end
326
- def test_gsl_complex_sub_real()
327
- v14 = GSL_Complex.create
328
- v14.set(2.0,2.0)
329
-
330
- v15 = 2.0
331
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_sub_real(v14,v15)
426
+ def test_gsl_complex_conjugate()
427
+ v28 = GSL_Complex.create
428
+ v28.set(2.0,2.0)
429
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_conjugate(v28)
332
430
  r_r2 = GSL_Complex.new
333
- r_r2.set(0,2)
431
+ r_r2.set(2,-2)
334
432
  assert r_r1.equals(r_r2)
335
433
  end
336
434
  def test_gsl_complex_sec()
@@ -341,12 +439,12 @@ def test_gsl_complex_sec()
341
439
  r_r2.set(-0.117475142661415,0.24745418582076)
342
440
  assert r_r1.equals(r_r2)
343
441
  end
344
- def test_gsl_complex_arccosh()
345
- v67 = GSL_Complex.create
346
- v67.set(2.0,2.0)
347
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccosh(v67)
442
+ def test_gsl_complex_sinh()
443
+ v60 = GSL_Complex.create
444
+ v60.set(2.0,2.0)
445
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_sinh(v60)
348
446
  r_r2 = GSL_Complex.new
349
- r_r2.set(1.73432452148797,0.816547182096851)
447
+ r_r2.set(-1.50930648532362,3.42095486111701)
350
448
  assert r_r1.equals(r_r2)
351
449
  end
352
450
  def test_gsl_complex_sub()
@@ -359,14 +457,28 @@ def test_gsl_complex_sub()
359
457
  r_r2.set(0,0)
360
458
  assert r_r1.equals(r_r2)
361
459
  end
362
- def test_gsl_complex_log10()
363
- v41 = GSL_Complex.create
364
- v41.set(2.0,2.0)
365
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_log10(v41)
460
+ def test_gsl_complex_sqrt()
461
+ v31 = GSL_Complex.create
462
+ v31.set(2.0,2.0)
463
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_sqrt(v31)
366
464
  r_r2 = GSL_Complex.new
367
- r_r2.set(0.451544993495972,0.34109408846046)
465
+ r_r2.set(1.55377397403004,0.643594252905582)
368
466
  assert r_r1.equals(r_r2)
369
467
  end
468
+ def test_gsl_complex_cot()
469
+ v49 = GSL_Complex.create
470
+ v49.set(2.0,2.0)
471
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_cot(v49)
472
+ r_r2 = GSL_Complex.new
473
+ r_r2.set(-0.0270655117325545,-0.975968735117309)
474
+ assert r_r1.equals(r_r2)
475
+ end
476
+ def test_gsl_complex_abs2()
477
+ v3 = GSL_Complex.create
478
+ v3.set(2.0,2.0)
479
+ r_r1 = ::GSL4r::Complex::Methods::gsl_complex_abs2(v3)
480
+ assert_in_delta r_r1, 8, EPSILON
481
+ end
370
482
  def test_gsl_complex_csch()
371
483
  v63 = GSL_Complex.create
372
484
  v63.set(2.0,2.0)
@@ -375,116 +487,4 @@ def test_gsl_complex_csch()
375
487
  r_r2.set(-0.107954592221385,-0.244687073586957)
376
488
  assert r_r1.equals(r_r2)
377
489
  end
378
- def test_gsl_complex_pow()
379
- v35 = GSL_Complex.create
380
- v35.set(2.0,2.0)
381
- v36 = GSL_Complex.create
382
- v36.set(2.0,2.0)
383
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_pow(v35,v36)
384
- r_r2 = GSL_Complex.new
385
- r_r2.set(-1.4525046270557,-0.8098895463353)
386
- assert r_r1.equals(r_r2)
387
- end
388
- def test_gsl_complex_arccot()
389
- v59 = GSL_Complex.create
390
- v59.set(2.0,2.0)
391
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccot(v59)
392
- r_r2 = GSL_Complex.new
393
- r_r2.set(0.259573057123261,-0.238877861256859)
394
- assert r_r1.equals(r_r2)
395
- end
396
- def test_gsl_complex_negative()
397
- v30 = GSL_Complex.create
398
- v30.set(2.0,2.0)
399
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_negative(v30)
400
- r_r2 = GSL_Complex.new
401
- r_r2.set(-2,-2)
402
- assert r_r1.equals(r_r2)
403
- end
404
- def test_gsl_complex_arcsec_real()
405
-
406
- v55 = 2.0
407
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arcsec_real(v55)
408
- r_r2 = GSL_Complex.new
409
- r_r2.set(1.0471975511966,0)
410
- assert r_r1.equals(r_r2)
411
- end
412
- def test_gsl_complex_mul_imag()
413
- v24 = GSL_Complex.create
414
- v24.set(2.0,2.0)
415
-
416
- v25 = 2.0
417
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_mul_imag(v24,v25)
418
- r_r2 = GSL_Complex.new
419
- r_r2.set(-4,4)
420
- assert r_r1.equals(r_r2)
421
- end
422
- def test_gsl_complex_arcsin_real()
423
-
424
- v51 = 2.0
425
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arcsin_real(v51)
426
- r_r2 = GSL_Complex.new
427
- r_r2.set(1.5707963267949,-1.31695789692482)
428
- assert r_r1.equals(r_r2)
429
- end
430
- def test_gsl_complex_abs()
431
- v2 = GSL_Complex.create
432
- v2.set(2.0,2.0)
433
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_abs(v2)
434
- assert_in_delta r_r1, 2.82842712474619, EPSILON
435
- end
436
- def test_gsl_complex_arctanh_real()
437
-
438
- v72 = 2.0
439
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arctanh_real(v72)
440
- r_r2 = GSL_Complex.new
441
- r_r2.set(0.549306144334055,-1.5707963267949)
442
- assert r_r1.equals(r_r2)
443
- end
444
- def test_gsl_complex_mul_real()
445
- v16 = GSL_Complex.create
446
- v16.set(2.0,2.0)
447
-
448
- v17 = 2.0
449
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_mul_real(v16,v17)
450
- r_r2 = GSL_Complex.new
451
- r_r2.set(4,4)
452
- assert r_r1.equals(r_r2)
453
- end
454
- def test_gsl_complex_csc()
455
- v47 = GSL_Complex.create
456
- v47.set(2.0,2.0)
457
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_csc(v47)
458
- r_r2 = GSL_Complex.new
459
- r_r2.set(0.244687073586957,0.107954592221385)
460
- assert r_r1.equals(r_r2)
461
- end
462
- def test_gsl_complex_arccosh_real()
463
-
464
- v68 = 2.0
465
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_arccosh_real(v68)
466
- r_r2 = GSL_Complex.new
467
- r_r2.set(1.31695789692482,0)
468
- assert r_r1.equals(r_r2)
469
- end
470
- def test_gsl_complex_mul()
471
- v8 = GSL_Complex.create
472
- v8.set(2.0,2.0)
473
- v9 = GSL_Complex.create
474
- v9.set(2.0,2.0)
475
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_mul(v8,v9)
476
- r_r2 = GSL_Complex.new
477
- r_r2.set(0,8)
478
- assert r_r1.equals(r_r2)
479
- end
480
- def test_gsl_complex_log_b()
481
- v42 = GSL_Complex.create
482
- v42.set(2.0,2.0)
483
- v43 = GSL_Complex.create
484
- v43.set(2.0,2.0)
485
- r_r1 = ::GSL4r::Complex::Methods::gsl_complex_log_b(v42,v43)
486
- r_r2 = GSL_Complex.new
487
- r_r2.set(1,0)
488
- assert r_r1.equals(r_r2)
489
- end
490
490
  end
Binary file