num4equ 0.1.2 → 0.1.3

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -6
  3. data/lib/num4equ.rb +22 -3
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9999f0550bf5719b1f533abe772b711527b6ca26608f910fc53866944eea78e
4
- data.tar.gz: 1e898d1910107d1b81ea430ed79bdc92874413ce0320a992873bcc1c63d23f42
3
+ metadata.gz: 5cd6930b38ab1be297fc58060fc0eb27e54d97e65708e149849d5f05351a80b3
4
+ data.tar.gz: 86284e474cc156a137bbc0adab3da0be67b6a843a3eb974ba7b9f1460397781b
5
5
  SHA512:
6
- metadata.gz: 71701934716dc8bd1ab3952a226cb00741fd9a335a7030328747bda8dc981b1a891a388d693a89fa72a4421b44e6446472a0ecc99bdb995576504819e9eaa955
7
- data.tar.gz: 548a45584072da76972d4e964df7cd46b58e371c53106a978aa449abc29372552a46f726c3f1aac6016bb1df1837dcb4c98ea0a7dc97c677ae259de63ad8fe32
6
+ metadata.gz: e3c4f6c4b5be218bd446afbb01bd9f112156b75393158e3fa3047be904b39353b4eb8bf863391ab8d4fe0fe0cd7ef7caf821e19aa9775c1cabb2fbda80ca0811
7
+ data.tar.gz: 598f7f0ac9301025f25fe9392b4f9bbcfbf865cb958b018ec209d16c631a39d99ecdfc3ed7aa36d83ab6841b33552cb84e2b9ff0a7ba18626ce5c42185fb54b5
data/CHANGELOG.md CHANGED
@@ -2,19 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- ## [0.1.2] - 2023-05-28
5
+ ## [0.1.3] - 2023-08-29
6
6
 
7
- ### fixed
8
- - fix refactoring for newtonMethod
7
+ ### Changed
8
+ - chg add sample of yardoc
9
9
 
10
10
  ## [0.1.1] - 2023-05-20
11
11
 
12
12
  ### fixed
13
13
  - fix use definition of derivative for newtonMethod
14
14
 
15
- ### Added
16
- - Add wiki_rui into file of gemspec.
17
-
18
15
  ## [0.0.9] - 2023-04-18
19
16
 
20
17
  ### Added
data/lib/num4equ.rb CHANGED
@@ -21,12 +21,19 @@ module Num4EquLib
21
21
  attach_function :secantMethodFFI,
22
22
  :CNum4Equ_secantMethodFFI, [:double, :double, :f, :buffer_out], :double
23
23
  class << self
24
+ # ニュートン法による解法
25
+ #
24
26
  # @overload newtonMethod(a, func)
25
- # ニュートン法による解法
26
27
  # @param [double] a aの値
27
28
  # @param [callback] func aに対する値を計算
28
29
  # @return [double] xの値
29
30
  # @raise RangeError
31
+ # @example
32
+ # f1 = proc {|x|
33
+ # next x * x - 2
34
+ # }
35
+ # x = Num4EquLib.newtonMethod(-1.8, f1)
36
+ #
30
37
  def newtonMethod(a, func)
31
38
  ok_ptr = FFI::MemoryPointer.new :int
32
39
  x = newtonMethodFFI(a, func, ok_ptr)
@@ -37,13 +44,19 @@ module Num4EquLib
37
44
  end
38
45
  return x
39
46
  end
47
+ # 二分法による解法
48
+ #
40
49
  # @overload bisection(a, b, func)
41
- # 二分法による解法
42
50
  # @param [double] a aの値
43
51
  # @param [double] b bの値
44
52
  # @param [callback] func aに対する値を計算
45
53
  # @return [double] xの値
46
54
  # @raise RangeError
55
+ # @example
56
+ # f1 = proc {|x|
57
+ # next x * x - 2
58
+ # }
59
+ # x = Num4EquLib.bisectionMethod(-3, -1, f1)
47
60
  def bisectionMethod(a, b, func)
48
61
  ok_ptr = FFI::MemoryPointer.new :int
49
62
  x = bisectionMethodFFI(a, b, func, ok_ptr)
@@ -54,13 +67,19 @@ module Num4EquLib
54
67
  end
55
68
  return x
56
69
  end
70
+ # 割線法による解法
71
+ #
57
72
  # @overload secantMethod(a, b, func)
58
- # 割線法による解法
59
73
  # @param [double] a aの値
60
74
  # @param [double] b bの値
61
75
  # @param [callback] func aに対する値を計算
62
76
  # @return [double] xの値
63
77
  # @raise RangeError
78
+ # @example
79
+ # f1 = proc {|x|
80
+ # next x * x - 2
81
+ # }
82
+ # x = Num4EquLib.secantMethod(-1, 3, f1)
64
83
  def secantMethod(a, b, func)
65
84
  ok_ptr = FFI::MemoryPointer.new :int
66
85
  x = secantMethodFFI(a, b, func, ok_ptr)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: num4equ
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - siranovel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-28 00:00:00.000000000 Z
11
+ date: 2023-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi-compiler
@@ -69,7 +69,7 @@ licenses:
69
69
  - MIT
70
70
  metadata:
71
71
  changelog_uri: http://github.com/siranovel/num4equation/blob/main/CHANGELOG.md
72
- documentation_uri: https://rubydoc.info/gems/num4equ/0.1.2
72
+ documentation_uri: https://rubydoc.info/gems/num4equ/0.1.3
73
73
  homepage_uri: http://github.com/siranovel/num4equation
74
74
  wiki_uri: https://github.com/siranovel/mydocs/tree/main/num4equation
75
75
  post_install_message: