ruby-mext 0.4.1 → 0.5.0
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 +4 -4
- data/lib/mext/math/expon.rb +21 -1
- data/lib/mext/math/function.rb +8 -0
- data/lib/mext/math/line.rb +20 -0
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89c134d002e5da2d18b28325bd3153d4f3aea0f67a362152b32a984607016538
|
4
|
+
data.tar.gz: 9b9c21280afa82c51ef4c6f30e8cf82396826b38a617cf7c731f2b1c958e79a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e3ed69e38787efd0320ede22d4c3e3cbfe912ea29dd5e042216e8880baf88fa02d2a5d4b2fdb67150bdf884dec42564f7b0be68cc1abcc90d51cf3a98d57f46
|
7
|
+
data.tar.gz: 4d4c512bebbd0494db0546554f6b0a7dc006b747835b2b6dcee087894fc5d2d754e95885a5c95bc534575531d930cab2c8763c81ad03623eaab437c1c0f9e96f
|
data/lib/mext/math/expon.rb
CHANGED
@@ -51,6 +51,27 @@ module Math
|
|
51
51
|
"tau: #{self.tau}"
|
52
52
|
end
|
53
53
|
|
54
|
+
class << self
|
55
|
+
|
56
|
+
#
|
57
|
+
# +from_yaml(yaml_hash)+:
|
58
|
+
#
|
59
|
+
# creates a Math::Expon class from a yaml file which must have the
|
60
|
+
# relevant fields:
|
61
|
+
#
|
62
|
+
# +x_start+
|
63
|
+
# +x_end+
|
64
|
+
# +y_start+
|
65
|
+
# +y_end+
|
66
|
+
# +tau+
|
67
|
+
#
|
68
|
+
def from_yaml(yh)
|
69
|
+
args = [yh['y_start'], yh['y_end'], yh['x_start'], yh['x_end'], yh['tau']]
|
70
|
+
new(*args)
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
54
75
|
private
|
55
76
|
|
56
77
|
def setup
|
@@ -62,7 +83,6 @@ module Math
|
|
62
83
|
|
63
84
|
@a = (CMath::log(exp_ev) - CMath::log(exp_sv)) / x_length;
|
64
85
|
@b= CMath::log(exp_sv) - (self.a * x_start);
|
65
|
-
|
66
86
|
end
|
67
87
|
|
68
88
|
end
|
data/lib/mext/math/function.rb
CHANGED
data/lib/mext/math/line.rb
CHANGED
@@ -42,6 +42,26 @@ module Math
|
|
42
42
|
"a: #{self.a}\nb: #{self.b}"
|
43
43
|
end
|
44
44
|
|
45
|
+
class << self
|
46
|
+
|
47
|
+
#
|
48
|
+
# +from_yaml(yaml_hash)+:
|
49
|
+
#
|
50
|
+
# creates a Math::Line class from a yaml file which must have the
|
51
|
+
# relevant fields:
|
52
|
+
#
|
53
|
+
# +x_start+
|
54
|
+
# +x_end+
|
55
|
+
# +y_start+
|
56
|
+
# +y_end+
|
57
|
+
#
|
58
|
+
def from_yaml(yh)
|
59
|
+
args = [yh['y_start'], yh['y_end'], yh['x_start'], yh['x_end']]
|
60
|
+
new(*args)
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
45
65
|
private
|
46
66
|
|
47
67
|
def setup
|
data/lib/version.rb
CHANGED