fort 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fort/type/character_type.rb +1 -1
- data/lib/fort/type/complex_type.rb +4 -12
- data/lib/fort/type/integer_type.rb +3 -13
- data/lib/fort/type/logical_type.rb +1 -1
- data/lib/fort/type/numeric_type.rb +24 -0
- data/lib/fort/type/real_type.rb +4 -12
- data/lib/fort/version.rb +1 -1
- metadata +7 -6
@@ -1,22 +1,14 @@
|
|
1
1
|
module Fort
|
2
2
|
class Type
|
3
|
-
class ComplexType < Type
|
3
|
+
class ComplexType < ::Fort::Type::NumericType
|
4
4
|
require 'ruby_patch'
|
5
5
|
extend ::RubyPatch::AutoLoad
|
6
6
|
|
7
|
-
attr_reader :kind
|
7
|
+
attr_reader :kind, :kind_const
|
8
8
|
|
9
9
|
def initialize(dim = 0, kind = 32)
|
10
|
-
super
|
11
|
-
@
|
12
|
-
end
|
13
|
-
|
14
|
-
def to_s
|
15
|
-
"#{super}Kind#{@kind}"
|
16
|
-
end
|
17
|
-
|
18
|
-
def declare
|
19
|
-
"#{@stem}(REAL#{@kind})#{super}"
|
10
|
+
super
|
11
|
+
@kind_const = "REAL#{@kind}"
|
20
12
|
end
|
21
13
|
end
|
22
14
|
end
|
@@ -1,22 +1,12 @@
|
|
1
1
|
module Fort
|
2
2
|
class Type
|
3
|
-
class IntegerType < Type
|
3
|
+
class IntegerType < ::Fort::Type::NumericType
|
4
4
|
require 'ruby_patch'
|
5
5
|
extend ::RubyPatch::AutoLoad
|
6
6
|
|
7
|
-
attr_reader :kind
|
8
|
-
|
9
7
|
def initialize(dim = 0, kind = 32)
|
10
|
-
super
|
11
|
-
@
|
12
|
-
end
|
13
|
-
|
14
|
-
def to_s
|
15
|
-
"#{super}Kind#{@kind}"
|
16
|
-
end
|
17
|
-
|
18
|
-
def declare
|
19
|
-
"#{@stem}(INT#{@kind})#{super}"
|
8
|
+
super
|
9
|
+
@kind_const = "INT#{@kind}"
|
20
10
|
end
|
21
11
|
end
|
22
12
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Fort
|
2
|
+
class Type
|
3
|
+
class NumericType < ::Fort::Type
|
4
|
+
require 'ruby_patch'
|
5
|
+
extend ::RubyPatch::AutoLoad
|
6
|
+
|
7
|
+
attr_reader :kind, :kind_const
|
8
|
+
|
9
|
+
def initialize(dim = 0, kind = 32)
|
10
|
+
super(dim)
|
11
|
+
@kind = kind
|
12
|
+
@kind_const = nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
"#{super}Kind#{@kind}"
|
17
|
+
end
|
18
|
+
|
19
|
+
def declare
|
20
|
+
"#{@stem}(#{@kind_const})#{super}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/fort/type/real_type.rb
CHANGED
@@ -1,22 +1,14 @@
|
|
1
1
|
module Fort
|
2
2
|
class Type
|
3
|
-
class RealType < Type
|
3
|
+
class RealType < ::Fort::Type::NumericType
|
4
4
|
require 'ruby_patch'
|
5
5
|
extend ::RubyPatch::AutoLoad
|
6
6
|
|
7
|
-
attr_reader :kind
|
7
|
+
attr_reader :kind, :kind_const
|
8
8
|
|
9
9
|
def initialize(dim = 0, kind = 32)
|
10
|
-
super
|
11
|
-
@
|
12
|
-
end
|
13
|
-
|
14
|
-
def to_s
|
15
|
-
"#{super}Kind#{@kind}"
|
16
|
-
end
|
17
|
-
|
18
|
-
def declare
|
19
|
-
"#{@stem}(REAL#{@kind})#{super}"
|
10
|
+
super
|
11
|
+
@kind_const = "REAL#{@kind}"
|
20
12
|
end
|
21
13
|
end
|
22
14
|
end
|
data/lib/fort/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
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: 2012-08-
|
12
|
+
date: 2012-08-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby_patch
|
16
|
-
requirement: &
|
16
|
+
requirement: &69161810 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *69161810
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: pry
|
27
|
-
requirement: &
|
27
|
+
requirement: &69176500 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0.9'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *69176500
|
36
36
|
description: Ruby library for Fortran 90 and newer.
|
37
37
|
email:
|
38
38
|
executables: []
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- lib/fort/type/complex_type.rb
|
51
51
|
- lib/fort/type/integer_type.rb
|
52
52
|
- lib/fort/type/logical_type.rb
|
53
|
+
- lib/fort/type/numeric_type.rb
|
53
54
|
- lib/fort/type/real_type.rb
|
54
55
|
- lib/fort/version.rb
|
55
56
|
- rakefile
|