Class: Korba::NewtonFunction
- Inherits:
-
Object
- Object
- Korba::NewtonFunction
- Defined in:
- lib/korba/newton_function.rb
Direct Known Subclasses
Instance Method Summary collapse
- #eps ⇒ Object
-
#initialize ⇒ NewtonFunction
constructor
A new instance of NewtonFunction.
- #one ⇒ Object
- #ten ⇒ Object
- #two ⇒ Object
- #values(x) ⇒ Object
- #zero ⇒ Object
Constructor Details
#initialize ⇒ NewtonFunction
Returns a new instance of NewtonFunction.
7 8 9 10 11 12 13 |
# File 'lib/korba/newton_function.rb', line 7 def initialize() @zero = BigDecimal("0.0") @one = BigDecimal("1.0") @two = BigDecimal("2.0") @ten = BigDecimal("10.0") @eps = BigDecimal("1.0e-14") end |
Instance Method Details
#eps ⇒ Object
19 |
# File 'lib/korba/newton_function.rb', line 19 def eps; @eps; end |
#one ⇒ Object
16 |
# File 'lib/korba/newton_function.rb', line 16 def one; @one; end |
#ten ⇒ Object
18 |
# File 'lib/korba/newton_function.rb', line 18 def ten; @ten; end |
#two ⇒ Object
17 |
# File 'lib/korba/newton_function.rb', line 17 def two; @two; end |
#values(x) ⇒ Object
21 22 23 |
# File 'lib/korba/newton_function.rb', line 21 def values(x) raise NotImplementedError end |
#zero ⇒ Object
15 |
# File 'lib/korba/newton_function.rb', line 15 def zero; @zero; end |