ruby-mpfr 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -30
- data/ext/mpfr_matrix/mpfr/extconf.rb +1 -0
- data/lib/mpfr/rake_compile.rb +29 -0
- data/lib/mpfr/version.rb +1 -1
- metadata +8 -8
- data/ext/mpfr_matrix/mpfr/ruby_mpfr.h +0 -44
data/Rakefile
CHANGED
@@ -1,31 +1,2 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
-
|
3
|
-
def each_extconf_directory(&block)
|
4
|
-
Dir.glob("ext/**/extconf.rb").each do |extconf|
|
5
|
-
cd File.dirname(extconf) do
|
6
|
-
yield
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
desc 'Compile extended library'
|
12
|
-
task 'ext:compile' do |t|
|
13
|
-
each_extconf_directory do
|
14
|
-
sh 'ruby extconf.rb' unless File.exist?('Makefile')
|
15
|
-
sh 'make'
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
desc 'Clean'
|
20
|
-
task 'ext:clean' do |t|
|
21
|
-
each_extconf_directory do
|
22
|
-
sh 'make clean' if File.exist?('Makefile')
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
desc 'Clean completely'
|
27
|
-
task 'ext:distclean' do |t|
|
28
|
-
each_extconf_directory do
|
29
|
-
sh 'make distclean' if File.exist?('Makefile')
|
30
|
-
end
|
31
|
-
end
|
2
|
+
require_relative 'lib/mpfr/rake_compile'
|
@@ -0,0 +1,29 @@
|
|
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/lib/mpfr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-mpfr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-08-
|
12
|
+
date: 2011-08-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &13901720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *13901720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: yard
|
27
|
-
requirement: &
|
27
|
+
requirement: &13901260 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *13901260
|
36
36
|
description: Ruby bindings of MPFR that is a C library for multiple-precision floating-point
|
37
37
|
computations
|
38
38
|
email:
|
@@ -65,11 +65,11 @@ files:
|
|
65
65
|
- ext/mpfr_matrix/mpfr/extconf.rb
|
66
66
|
- ext/mpfr_matrix/mpfr/func_mpfr_matrix.c
|
67
67
|
- ext/mpfr_matrix/mpfr/func_mpfr_matrix.h
|
68
|
-
- ext/mpfr_matrix/mpfr/ruby_mpfr.h
|
69
68
|
- ext/mpfr_matrix/mpfr/ruby_mpfr_matrix.c
|
70
69
|
- ext/mpfr_matrix/mpfr/ruby_mpfr_matrix.h
|
71
70
|
- lib/mpfr/gmp.rb
|
72
71
|
- lib/mpfr/matrix.rb
|
72
|
+
- lib/mpfr/rake_compile.rb
|
73
73
|
- lib/mpfr/rspec.rb
|
74
74
|
- lib/mpfr/version.rb
|
75
75
|
- ruby-mpfr.gemspec
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project: ruby-mpfr
|
124
|
-
rubygems_version: 1.8.
|
124
|
+
rubygems_version: 1.8.9
|
125
125
|
signing_key:
|
126
126
|
specification_version: 3
|
127
127
|
summary: Ruby bindings of MPFR
|
@@ -1,44 +0,0 @@
|
|
1
|
-
#ifndef _RUBY_MPFR_H_
|
2
|
-
#define _RUBY_MPFR_H_
|
3
|
-
|
4
|
-
#include <ruby.h>
|
5
|
-
#include <mpfr.h>
|
6
|
-
#include <stdio.h>
|
7
|
-
|
8
|
-
typedef __mpfr_struct MPFR;
|
9
|
-
|
10
|
-
VALUE r_mpfr_class, r_mpfr_math;
|
11
|
-
|
12
|
-
#define r_mpfr_make_struct(ruby_var, c_var) { ruby_var = Data_Make_Struct(r_mpfr_class, MPFR, 0, r_mpfr_free, c_var); }
|
13
|
-
#define r_mpfr_make_struct_init(ruby_var, c_var) { r_mpfr_make_struct(ruby_var, c_var); mpfr_init(c_var); }
|
14
|
-
#define r_mpfr_make_struct_init2(ruby_var, c_var, prec) { r_mpfr_make_struct(ruby_var, c_var); mpfr_init2(c_var, prec); }
|
15
|
-
#define r_mpfr_get_struct(c_var, ruby_var) { Data_Get_Struct(ruby_var, MPFR, c_var); }
|
16
|
-
|
17
|
-
#define r_mpfr_temp_alloc(var) { var=ALLOC_N(MPFR, 1); }
|
18
|
-
#define r_mpfr_temp_alloc_init(var) { r_mpfr_temp_alloc(var); mpfr_init(var); }
|
19
|
-
#define r_mpfr_temp_alloc_init2(var, prec) { r_mpfr_temp_alloc(var); mpfr_init2(var, prec); }
|
20
|
-
#define r_mpfr_temp_free(var) { mpfr_clear(var); free(var); }
|
21
|
-
|
22
|
-
#define r_mpfr_check_number(c_val) { if(mpfr_number_p(c_val) == 0) rb_raise(rb_eArgError, "Not an ordinary number."); }
|
23
|
-
#define r_mpfr_check_positive_number(c_val) { if(mpfr_number_p(c_val) == 0 && mpfr_sgn(c_val) <= 0) rb_raise(rb_eArgError, "Not a positive number."); }
|
24
|
-
#define r_mpfr_check_non_negative_number(c_val) { if(mpfr_number_p(c_val) == 0 && mpfr_sgn(c_val) < 0) rb_raise(rb_eArgError, "Not a non negative number."); }
|
25
|
-
#define r_mpfr_check_negative_number(c_val) { if(mpfr_number_p(c_val) == 0 && mpfr_sgn(c_val) >= 0) rb_raise(rb_eArgError, "Not a negative number."); }
|
26
|
-
#define r_mpfr_check_non_positive_number(c_val) { if(mpfr_number_p(c_val) == 0 && mpfr_sgn(c_val) > 0) rb_raise(rb_eArgError, "Not a non positive number."); }
|
27
|
-
|
28
|
-
void r_mpfr_free(void *ptr);
|
29
|
-
VALUE r_mpfr_make_new_fr_obj(MPFR *ptr);
|
30
|
-
VALUE r_mpfr_make_new_fr_obj2(MPFR *ptr, int prec);
|
31
|
-
VALUE r_mpfr_new_fr_obj(VALUE obj);
|
32
|
-
void r_mpfr_set_robj(MPFR *ptr, VALUE obj, mp_rnd_t rnd);
|
33
|
-
VALUE r_mpfr_robj_to_mpfr(VALUE obj, int argc, VALUE *argv);
|
34
|
-
|
35
|
-
mp_rnd_t r_mpfr_rnd_from_value(VALUE rnd);
|
36
|
-
mp_rnd_t r_mpfr_rnd_from_optional_argument(int min, int max, int argc, VALUE *argv);
|
37
|
-
mp_rnd_t r_mpfr_prec_from_optional_argument(int min, int max, int argc, VALUE *argv);
|
38
|
-
void r_mpfr_get_rnd_prec_from_optional_arguments(mp_rnd_t *rnd, mp_prec_t *prec, int min, int max, int argc, VALUE *argv);
|
39
|
-
|
40
|
-
char *r_mpfr_dump_to_string(MPFR *ptr_s);
|
41
|
-
void r_mpfr_load_string(MPFR *ptr_s, const char *dump);
|
42
|
-
|
43
|
-
#endif /* _RUBY_MPFR_H_ */
|
44
|
-
|