ruby-mpfr 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Rakefile +13 -1
- data/ext/mpfr/ruby_mpfr.c +4 -2
- data/ext/mpfr_matrix/mpfr/ruby_mpfr_matrix.c +28 -18
- data/lib/mpfr/matrix.rb +1 -1
- data/lib/mpfr/rspec.rb +1 -1
- data/lib/mpfr/version.rb +2 -2
- data/ruby-mpfr.gemspec +2 -0
- data/spec/gmp/convert_spec.rb +1 -1
- data/spec/gmp/rand_spec.rb +1 -1
- data/spec/mpfr/allocate_spec.rb +1 -1
- data/spec/mpfr/arithmetic_spec.rb +1 -1
- data/spec/mpfr/comparison_spec.rb +1 -1
- data/spec/mpfr/constant_spec.rb +1 -1
- data/spec/mpfr/conversion_spec.rb +15 -8
- data/spec/mpfr/exception_spec.rb +1 -1
- data/spec/mpfr/functions_spec.rb +5 -2
- data/spec/mpfr/marshal_spec.rb +1 -1
- data/spec/mpfr/precision_roundmode_spec.rb +1 -1
- data/spec/mpfr/rounding_spec.rb +1 -1
- data/spec/mpfr/set_value_spec.rb +1 -1
- data/spec/mpfr/string_spec.rb +1 -1
- data/spec/mpfr_matrix/mpfr_matrix_alloc_spec.rb +1 -1
- data/spec/mpfr_matrix/mpfr_matrix_arithmetic_spec.rb +1 -1
- data/spec/mpfr_matrix/mpfr_matrix_marshal_spec.rb +1 -1
- data/spec/mpfr_matrix/mpfr_matrix_set_element_spec.rb +1 -1
- data/spec/mpfr_matrix/mpfr_matrix_string_spec.rb +1 -1
- data/spec/mpfr_matrix/mpfr_square_matrix_spec.rb +1 -1
- data/spec/spec_helper.rb +13 -0
- metadata +51 -21
- data/lib/mpfr/rake_compile.rb +0 -29
- data/spec/gmp/spec_helper.rb +0 -14
- data/spec/mpfr/spec_helper.rb +0 -13
- data/spec/mpfr_matrix/spec_helper.rb +0 -16
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 89b359f833c1acb44cdd931eaf2658cfd2810e24
|
4
|
+
data.tar.gz: b0a0183ca3693ce5c8fd320fe0f27ed2db98a16f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b32f3177bd48bb3352303fdde3894d5fce120fc3c7d57324517fac3cae451df0eb9397260e7703d9ad4aebf4f7b7fe928ac47a86af50fb27098c8ea6a67f2186
|
7
|
+
data.tar.gz: 62de530570326a8844f2578c7345b9783b774302963a42cf7a21031e774401d58cd6b5b3559584ec8bd790cae4a853c38804da596e1f262572ec651d3dd5d74e
|
data/Rakefile
CHANGED
@@ -1,2 +1,14 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
-
|
2
|
+
|
3
|
+
require "extconf_task"
|
4
|
+
ExtconfTask.new
|
5
|
+
|
6
|
+
require "rspec/core/rake_task"
|
7
|
+
RSpec::Core::RakeTask.new do |t|
|
8
|
+
t.pattern = 'spec/**/*_spec.rb'
|
9
|
+
end
|
10
|
+
|
11
|
+
require "yard"
|
12
|
+
YARD::Rake::YardocTask.new do |t|
|
13
|
+
t.files = ["lib/**/*.rb", "lib/**/ext/**/*.c"]
|
14
|
+
end
|
data/ext/mpfr/ruby_mpfr.c
CHANGED
@@ -2144,7 +2144,7 @@ static VALUE r_mpfr_math_sin_cos(int argc, VALUE *argv, VALUE self)
|
|
2144
2144
|
r_mpfr_make_struct_init2(val_ret1, ptr_return1, prec);
|
2145
2145
|
r_mpfr_make_struct_init2(val_ret2, ptr_return2, prec);
|
2146
2146
|
mpfr_sin_cos(ptr_return1, ptr_return2, ptr_arg1, rnd);
|
2147
|
-
return rb_ary_new3(2,
|
2147
|
+
return rb_ary_new3(2, val_ret1, val_ret2);
|
2148
2148
|
}
|
2149
2149
|
|
2150
2150
|
/* mpfr_acos(ret, p1, rnd). */
|
@@ -2834,17 +2834,19 @@ static VALUE r_mpfr_math_sum(int argc, VALUE *argv, VALUE self){
|
|
2834
2834
|
mp_rnd_t rnd;
|
2835
2835
|
mp_prec_t prec;
|
2836
2836
|
VALUE val_ret;
|
2837
|
+
MPFR *ptr_return, **ptr_args;
|
2837
2838
|
for (num = 0; num < argc; num += 1) {
|
2838
2839
|
if(!MPFR_P(argv[num])){ break; }
|
2839
2840
|
}
|
2840
2841
|
r_mpfr_get_rnd_prec_from_optional_arguments(&rnd, &prec, num, num + 2, argc, argv);
|
2841
|
-
MPFR
|
2842
|
+
ptr_args = ALLOC_N(MPFR *, num);
|
2842
2843
|
for(i = 0; i < num; i++){
|
2843
2844
|
volatile VALUE tmp_argvi = r_mpfr_new_fr_obj(argv[i]);
|
2844
2845
|
r_mpfr_get_struct(ptr_args[i], tmp_argvi);
|
2845
2846
|
}
|
2846
2847
|
r_mpfr_make_struct_init2(val_ret, ptr_return, prec);
|
2847
2848
|
r_mpfr_set_special_func_state(mpfr_sum(ptr_return, ptr_args, argc, rnd));
|
2849
|
+
free(ptr_args);
|
2848
2850
|
return val_ret;
|
2849
2851
|
}
|
2850
2852
|
|
@@ -463,17 +463,18 @@ static VALUE r_mpfr_matrix_str_ary(VALUE self, VALUE format_str)
|
|
463
463
|
MPFRMatrix *ptr_self;
|
464
464
|
char *format, *tmp_str;
|
465
465
|
int i;
|
466
|
+
VALUE ret_ary;
|
466
467
|
r_mpfr_get_matrix_struct(ptr_self, self);
|
467
|
-
|
468
|
+
ret_ary = rb_ary_new2(ptr_self->size);
|
468
469
|
format = StringValuePtr(format_str);
|
469
470
|
for (i = 0; i < ptr_self->size; i++) {
|
470
471
|
if (!mpfr_asprintf(&tmp_str, format, ptr_self->data + i)) {
|
471
472
|
rb_raise(rb_eFatal, "Can not allocate a string by mpfr_asprintf.");
|
472
473
|
}
|
473
|
-
|
474
|
+
rb_ary_store(ret_ary, i, rb_str_new2(tmp_str));
|
474
475
|
mpfr_free_str(tmp_str);
|
475
476
|
}
|
476
|
-
return
|
477
|
+
return ret_ary;
|
477
478
|
}
|
478
479
|
|
479
480
|
/* Return two dimensinal array including strings which elements of matrix is converted to by MPFR#to_strf. */
|
@@ -482,9 +483,10 @@ static VALUE r_mpfr_matrix_str_ary2(VALUE self, VALUE format_str)
|
|
482
483
|
MPFRMatrix *ptr_self;
|
483
484
|
char *format, *tmp_str;
|
484
485
|
int i, j;
|
486
|
+
VALUE ret, *ary;
|
485
487
|
r_mpfr_get_matrix_struct(ptr_self, self);
|
486
488
|
format = StringValuePtr(format_str);
|
487
|
-
VALUE
|
489
|
+
ary = ALLOC_N(VALUE, ptr_self->row);
|
488
490
|
for(i = 0; i < ptr_self->row; i++){
|
489
491
|
ary[i] = rb_ary_new();
|
490
492
|
}
|
@@ -497,7 +499,9 @@ static VALUE r_mpfr_matrix_str_ary2(VALUE self, VALUE format_str)
|
|
497
499
|
mpfr_free_str(tmp_str);
|
498
500
|
}
|
499
501
|
}
|
500
|
-
|
502
|
+
ret = rb_ary_new4(ptr_self->row, ary);
|
503
|
+
free(ary);
|
504
|
+
return ret;
|
501
505
|
}
|
502
506
|
|
503
507
|
/* Retrn two dimensinal array including MPFR elements of matrix. */
|
@@ -505,12 +509,13 @@ static VALUE r_mpfr_matrix_to_array(VALUE self)
|
|
505
509
|
{
|
506
510
|
MPFRMatrix *ptr_self;
|
507
511
|
int i;
|
512
|
+
VALUE ret_ary;
|
508
513
|
r_mpfr_get_matrix_struct(ptr_self, self);
|
509
|
-
|
514
|
+
ret_ary = rb_ary_new2(ptr_self->size);
|
510
515
|
for (i = 0; i < ptr_self->size; i++) {
|
511
|
-
|
516
|
+
rb_ary_store(ret_ary, i, r_mpfr_make_new_fr_obj(ptr_self->data + i));
|
512
517
|
}
|
513
|
-
return
|
518
|
+
return ret_ary;
|
514
519
|
}
|
515
520
|
|
516
521
|
/* Retrn one dimensinal array including MPFR elements of matrix. */
|
@@ -518,8 +523,9 @@ static VALUE r_mpfr_matrix_to_array2(VALUE self)
|
|
518
523
|
{
|
519
524
|
MPFRMatrix *ptr_self;
|
520
525
|
int i, j;
|
526
|
+
VALUE ret_ary, *ary;
|
521
527
|
r_mpfr_get_matrix_struct(ptr_self, self);
|
522
|
-
VALUE
|
528
|
+
ary = ALLOC_N(VALUE, ptr_self->row);
|
523
529
|
for(i = 0; i < ptr_self->row; i++){
|
524
530
|
ary[i] = rb_ary_new();
|
525
531
|
}
|
@@ -528,7 +534,9 @@ static VALUE r_mpfr_matrix_to_array2(VALUE self)
|
|
528
534
|
rb_ary_push(ary[j], r_mpfr_make_new_fr_obj(ptr_self->data + i + j));
|
529
535
|
}
|
530
536
|
}
|
531
|
-
|
537
|
+
ret_ary = rb_ary_new4(ptr_self->row, ary);
|
538
|
+
free(ary);
|
539
|
+
return ret_ary;
|
532
540
|
}
|
533
541
|
|
534
542
|
/* Return _p1_-th row vector. */
|
@@ -803,14 +811,14 @@ static VALUE r_mpfr_square_matrix_dim (VALUE self)
|
|
803
811
|
static VALUE r_mpfr_square_matrix_lu_decomp (VALUE self)
|
804
812
|
{
|
805
813
|
MPFRMatrix *ptr_self, *ptr_ret_l, *ptr_ret_u;
|
806
|
-
VALUE ret_l, ret_u;
|
807
|
-
int i, j;
|
814
|
+
VALUE ret_l, ret_u, ret, ret_indx_ary;
|
815
|
+
int i, j, *indx;
|
808
816
|
r_mpfr_get_matrix_struct(ptr_self, self);
|
809
817
|
r_mpfr_matrix_suitable_matrix_init (&ret_l, &ptr_ret_l, ptr_self->row, ptr_self->column);
|
810
818
|
r_mpfr_matrix_suitable_matrix_init (&ret_u, &ptr_ret_u, ptr_self->row, ptr_self->column);
|
811
|
-
|
812
|
-
int indx[ptr_self->row];
|
819
|
+
indx = ALLOC_N(int, ptr_self->row);
|
813
820
|
if(mpfr_square_matrix_lu_decomp (ptr_ret_u, indx, ptr_self) >= 0){
|
821
|
+
ret_indx_ary = rb_ary_new2(ptr_self->row);
|
814
822
|
for(i = 1; i < ptr_ret_u->row; i++){
|
815
823
|
for(j = 0; j < i; j++){
|
816
824
|
mpfr_set(mpfr_matrix_get_element(ptr_ret_l, i, j), mpfr_matrix_get_element(ptr_ret_u, i, j), GMP_RNDN);
|
@@ -826,12 +834,14 @@ static VALUE r_mpfr_square_matrix_lu_decomp (VALUE self)
|
|
826
834
|
}
|
827
835
|
}
|
828
836
|
for(i = 0; i < ptr_ret_u->row; i++){
|
829
|
-
|
837
|
+
rb_ary_store(ret_indx_ary, i, INT2NUM(indx[i]));
|
830
838
|
}
|
831
|
-
|
832
|
-
}else{
|
833
|
-
|
839
|
+
ret = rb_ary_new3(3, ret_l, ret_u, ret_indx_ary);
|
840
|
+
} else {
|
841
|
+
ret = Qnil;
|
834
842
|
}
|
843
|
+
free(indx);
|
844
|
+
return ret;
|
835
845
|
}
|
836
846
|
|
837
847
|
/* Return determinant of matrix. */
|
data/lib/mpfr/matrix.rb
CHANGED
data/lib/mpfr/rspec.rb
CHANGED
data/lib/mpfr/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
VERSION = '0.0.
|
1
|
+
class MPFR < Numeric
|
2
|
+
VERSION = '0.0.15'
|
3
3
|
end
|
data/ruby-mpfr.gemspec
CHANGED
@@ -22,5 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
# specify any dependencies here; for example:
|
23
23
|
s.add_development_dependency "rspec"
|
24
24
|
s.add_development_dependency "yard"
|
25
|
+
s.add_development_dependency "extconf-task"
|
26
|
+
s.add_development_dependency "gmp"
|
25
27
|
# s.add_runtime_dependency "rest-client"
|
26
28
|
end
|
data/spec/gmp/convert_spec.rb
CHANGED
data/spec/gmp/rand_spec.rb
CHANGED
data/spec/mpfr/allocate_spec.rb
CHANGED
data/spec/mpfr/constant_spec.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)
|
2
|
-
|
3
|
-
MPFR.set_default_prec(256)
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "../spec_helper.rb"))
|
4
2
|
|
5
3
|
describe MPFR do
|
6
4
|
context "when converting to float" do
|
@@ -13,6 +11,11 @@ describe MPFR do
|
|
13
11
|
end
|
14
12
|
end
|
15
13
|
|
14
|
+
before(:all) do
|
15
|
+
@prec_old = MPFR.get_default_prec
|
16
|
+
MPFR.set_default_prec(256)
|
17
|
+
end
|
18
|
+
|
16
19
|
context "when rounding" do
|
17
20
|
it "should round a positive number." do
|
18
21
|
a = MPFR('1.3')
|
@@ -36,7 +39,7 @@ describe MPFR do
|
|
36
39
|
|
37
40
|
it "should round a big number." do
|
38
41
|
a = MPFR('1.3e+50')
|
39
|
-
a.round.should ==
|
42
|
+
a.round.should == ("13" + "0" * 49).to_i
|
40
43
|
end
|
41
44
|
|
42
45
|
it "should raise MPFRDomainError." do
|
@@ -69,7 +72,7 @@ describe MPFR do
|
|
69
72
|
|
70
73
|
it "should floor a big number." do
|
71
74
|
a = MPFR('1.3e+50')
|
72
|
-
a.floor.should ==
|
75
|
+
a.floor.should == ("13" + "0" * 49).to_i
|
73
76
|
end
|
74
77
|
|
75
78
|
it "should raise MPFRDomainError." do
|
@@ -102,7 +105,7 @@ describe MPFR do
|
|
102
105
|
|
103
106
|
it "should ceil a big number." do
|
104
107
|
a = MPFR('1.3e+50')
|
105
|
-
a.ceil.should ==
|
108
|
+
a.ceil.should == ("13" + "0" * 49).to_i
|
106
109
|
end
|
107
110
|
|
108
111
|
it "should raise MPFRDomainError." do
|
@@ -135,7 +138,7 @@ describe MPFR do
|
|
135
138
|
|
136
139
|
it "should truncate." do
|
137
140
|
a = MPFR('1.3e+50')
|
138
|
-
a.truncate.should ==
|
141
|
+
a.truncate.should == ("13" + "0" * 49).to_i
|
139
142
|
end
|
140
143
|
|
141
144
|
it "should raise MPFRDomainError." do
|
@@ -168,7 +171,7 @@ describe MPFR do
|
|
168
171
|
|
169
172
|
it "should to_i." do
|
170
173
|
a = MPFR('1.3e+50')
|
171
|
-
a.to_i.should ==
|
174
|
+
a.to_i.should == ("13" + "0" * 49).to_i
|
172
175
|
end
|
173
176
|
|
174
177
|
it "should raise MPFRDomainError." do
|
@@ -177,4 +180,8 @@ describe MPFR do
|
|
177
180
|
end.should raise_error MPFRDomainError
|
178
181
|
end
|
179
182
|
end
|
183
|
+
|
184
|
+
after(:all) do
|
185
|
+
MPFR.set_default_prec(@prec_old)
|
186
|
+
end
|
180
187
|
end
|
data/spec/mpfr/exception_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "../spec_helper.rb"))
|
2
2
|
|
3
3
|
describe MPFR, "when executing methods which are exception related functions" do
|
4
4
|
it "should get and set emin and emax" do
|
data/spec/mpfr/functions_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "../spec_helper.rb"))
|
2
2
|
|
3
3
|
MPFR.set_default_prec(256)
|
4
4
|
|
@@ -72,6 +72,9 @@ describe MPFR::Math do
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
|
75
|
+
it "should return sum of MPFR objects" do
|
76
|
+
nums = 10.times.to_a.map { |n| MPFR(n) }
|
77
|
+
MPFR::Math.sum(*nums).should == MPFR(45)
|
78
|
+
end
|
76
79
|
end
|
77
80
|
end
|
data/spec/mpfr/marshal_spec.rb
CHANGED
data/spec/mpfr/rounding_spec.rb
CHANGED
data/spec/mpfr/set_value_spec.rb
CHANGED
data/spec/mpfr/string_spec.rb
CHANGED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require "rspec"
|
2
|
+
|
3
|
+
gem_root = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
4
|
+
$:.unshift(File.join(gem_root, "lib"))
|
5
|
+
Dir.glob(File.join(gem_root, "ext/*")).each do |dir|
|
6
|
+
$:.unshift(dir)
|
7
|
+
end
|
8
|
+
|
9
|
+
require "mpfr"
|
10
|
+
require "mpfr/matrix"
|
11
|
+
require "mpfr/gmp"
|
12
|
+
require File.join(gem_root, "spec/mpfr/generate_number_modulue")
|
13
|
+
require File.join(gem_root, "spec/mpfr_matrix/generate_matrix_arguments")
|
metadata
CHANGED
@@ -1,38 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-mpfr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.15
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Takayuki YAMAGUCHI
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-09-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: yard
|
27
|
-
requirement:
|
28
|
-
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: extconf-task
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
29
44
|
requirements:
|
30
|
-
- -
|
45
|
+
- - '>='
|
31
46
|
- !ruby/object:Gem::Version
|
32
47
|
version: '0'
|
33
48
|
type: :development
|
34
49
|
prerelease: false
|
35
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: gmp
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
36
69
|
description: Ruby bindings of MPFR that is a C library for multiple-precision floating-point
|
37
70
|
computations
|
38
71
|
email:
|
@@ -69,13 +102,11 @@ files:
|
|
69
102
|
- ext/mpfr_matrix/mpfr/ruby_mpfr_matrix.h
|
70
103
|
- lib/mpfr/gmp.rb
|
71
104
|
- lib/mpfr/matrix.rb
|
72
|
-
- lib/mpfr/rake_compile.rb
|
73
105
|
- lib/mpfr/rspec.rb
|
74
106
|
- lib/mpfr/version.rb
|
75
107
|
- ruby-mpfr.gemspec
|
76
108
|
- spec/gmp/convert_spec.rb
|
77
109
|
- spec/gmp/rand_spec.rb
|
78
|
-
- spec/gmp/spec_helper.rb
|
79
110
|
- spec/mpfr/allocate_spec.rb
|
80
111
|
- spec/mpfr/arithmetic_spec.rb
|
81
112
|
- spec/mpfr/comparison_spec.rb
|
@@ -88,7 +119,6 @@ files:
|
|
88
119
|
- spec/mpfr/precision_roundmode_spec.rb
|
89
120
|
- spec/mpfr/rounding_spec.rb
|
90
121
|
- spec/mpfr/set_value_spec.rb
|
91
|
-
- spec/mpfr/spec_helper.rb
|
92
122
|
- spec/mpfr/string_spec.rb
|
93
123
|
- spec/mpfr_matrix/generate_matrix_arguments.rb
|
94
124
|
- spec/mpfr_matrix/mpfr_matrix_alloc_spec.rb
|
@@ -97,9 +127,10 @@ files:
|
|
97
127
|
- spec/mpfr_matrix/mpfr_matrix_set_element_spec.rb
|
98
128
|
- spec/mpfr_matrix/mpfr_matrix_string_spec.rb
|
99
129
|
- spec/mpfr_matrix/mpfr_square_matrix_spec.rb
|
100
|
-
- spec/
|
130
|
+
- spec/spec_helper.rb
|
101
131
|
homepage: ''
|
102
132
|
licenses: []
|
133
|
+
metadata: {}
|
103
134
|
post_install_message:
|
104
135
|
rdoc_options: []
|
105
136
|
require_paths:
|
@@ -108,21 +139,20 @@ require_paths:
|
|
108
139
|
- ext/gmp
|
109
140
|
- ext/mpfr_matrix
|
110
141
|
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
-
none: false
|
112
142
|
requirements:
|
113
|
-
- -
|
143
|
+
- - '>='
|
114
144
|
- !ruby/object:Gem::Version
|
115
145
|
version: '0'
|
116
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
-
none: false
|
118
147
|
requirements:
|
119
|
-
- -
|
148
|
+
- - '>='
|
120
149
|
- !ruby/object:Gem::Version
|
121
150
|
version: '0'
|
122
151
|
requirements: []
|
123
152
|
rubyforge_project: ruby-mpfr
|
124
|
-
rubygems_version:
|
153
|
+
rubygems_version: 2.0.3
|
125
154
|
signing_key:
|
126
|
-
specification_version:
|
155
|
+
specification_version: 4
|
127
156
|
summary: Ruby bindings of MPFR
|
128
157
|
test_files: []
|
158
|
+
has_rdoc:
|
data/lib/mpfr/rake_compile.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
def each_extconf_directory(&block)
|
2
|
-
Dir.glob("ext/**/extconf.rb").each do |extconf|
|
3
|
-
cd File.dirname(extconf) do
|
4
|
-
yield
|
5
|
-
end
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
desc 'Compile extended library'
|
10
|
-
task 'ext:compile' do |t|
|
11
|
-
each_extconf_directory do
|
12
|
-
sh 'ruby extconf.rb' unless File.exist?('Makefile')
|
13
|
-
sh 'make'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
desc 'Clean'
|
18
|
-
task 'ext:clean' do |t|
|
19
|
-
each_extconf_directory do
|
20
|
-
sh 'make clean' if File.exist?('Makefile')
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
desc 'Clean completely'
|
25
|
-
task 'ext:distclean' do |t|
|
26
|
-
each_extconf_directory do
|
27
|
-
sh 'make distclean' if File.exist?('Makefile')
|
28
|
-
end
|
29
|
-
end
|
data/spec/gmp/spec_helper.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'rspec'
|
3
|
-
rescue LoadError
|
4
|
-
require 'rubygems' unless ENV['NO_RUBYGEMS']
|
5
|
-
gem 'rspec'
|
6
|
-
require 'rspec'
|
7
|
-
end
|
8
|
-
|
9
|
-
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
10
|
-
$:.unshift(*Dir.glob(File.dirname(__FILE__) + '/../../ext/*'))
|
11
|
-
$:.unshift(File.dirname(__FILE__))
|
12
|
-
|
13
|
-
require 'mpfr'
|
14
|
-
require 'mpfr/gmp'
|
data/spec/mpfr/spec_helper.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'rspec'
|
3
|
-
rescue LoadError
|
4
|
-
require 'rubygems' unless ENV['NO_RUBYGEMS']
|
5
|
-
gem 'rspec'
|
6
|
-
require 'rspec'
|
7
|
-
end
|
8
|
-
|
9
|
-
$:.unshift(File.expand_path(File.dirname(__FILE__)) + '/../../lib')
|
10
|
-
$:.unshift(File.expand_path(File.dirname(__FILE__)) + '/../../ext')
|
11
|
-
$:.unshift(File.expand_path(File.dirname(__FILE__)))
|
12
|
-
require 'mpfr/mpfr'
|
13
|
-
require "generate_number_modulue"
|
@@ -1,16 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'rspec'
|
3
|
-
rescue LoadError
|
4
|
-
require 'rubygems' unless ENV['NO_RUBYGEMS']
|
5
|
-
gem 'rspec'
|
6
|
-
require 'rspec'
|
7
|
-
end
|
8
|
-
|
9
|
-
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
10
|
-
$:.unshift(*Dir.glob(File.dirname(__FILE__) + '/../../ext/*'))
|
11
|
-
$:.unshift(File.dirname(__FILE__))
|
12
|
-
|
13
|
-
require 'mpfr'
|
14
|
-
require 'mpfr/matrix'
|
15
|
-
require "generate_matrix_arguments"
|
16
|
-
|