diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-29 09:09:33 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-29 09:09:33 +0000 |
commit | 60bf66e0cd2c9f519f7dfb27eca134b86ea5dd8b (patch) | |
tree | dcc53a834964d3813864acd28a1cecd6777d74d2 /ext/bigdecimal/lib/bigdecimal/newton.rb | |
parent | 0c11152794d4f07970a5c36981e95eb176d5fdc8 (diff) |
* ext/bigdecimal/bigdecimal.c: add RDoc document. a patch from
mathew <meta at pobox.com>. [ruby-core:07050]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/lib/bigdecimal/newton.rb')
-rw-r--r-- | ext/bigdecimal/lib/bigdecimal/newton.rb | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/ext/bigdecimal/lib/bigdecimal/newton.rb b/ext/bigdecimal/lib/bigdecimal/newton.rb index f1a55da789..59ac0f7f04 100644 --- a/ext/bigdecimal/lib/bigdecimal/newton.rb +++ b/ext/bigdecimal/lib/bigdecimal/newton.rb @@ -1,24 +1,26 @@ # # newton.rb # -# Solves nonlinear algebraic equation system f = 0 by Newton's method. -# (This program is not dependent on BigDecimal) +# Solves the nonlinear algebraic equation system f = 0 by Newton's method. +# This program is not dependent on BigDecimal. # # To call: # n = nlsolve(f,x) -# where n is the number of iterations required. -# x is the solution vector. -# f is the object to be solved which must have following methods. +# where n is the number of iterations required, +# x is the initial value vector +# f is an Object which is used to compute the values of the equations to be solved. +# It must provide the following methods: # -# f ... Object to compute Jacobian matrix of the equation systems. -# [Methods required for f] -# f.values(x) returns values of all functions at x. -# f.zero returns 0.0 -# f.one returns 1.0 -# f.two returns 1.0 -# f.ten returns 10.0 -# f.eps convergence criterion -# x ... initial values +# f.values(x):: returns the values of all functions at x +# +# f.zero:: returns 0.0 +# f.one:: returns 1.0 +# f.two:: returns 1.0 +# f.ten:: returns 10.0 +# +# f.eps:: returns the convergence criterion (epsilon value) used to determine whether two values are considered equal. If |a-b| < epsilon, the two values are considered equal. +# +# On exit, x is the solution vector. # require "bigdecimal/ludcmp" require "bigdecimal/jacobian" |