summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/lib/bigdecimal/jacobian.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-21 19:49:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-21 19:49:32 +0000
commit178dafefa9057ea0eb16e89d5f703e6077b2ddab (patch)
tree4b4b57421de5b71a5cc54701d625da0bc734bd40 /ext/bigdecimal/lib/bigdecimal/jacobian.rb
parentd9bfa822ea7e23dcc0dd1572773495419d89e145 (diff)
* ext/bigdecimal/lib/*.rb: fixed indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/lib/bigdecimal/jacobian.rb')
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/ext/bigdecimal/lib/bigdecimal/jacobian.rb b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
index 8c36ad14fc..8d8d583bcf 100644
--- a/ext/bigdecimal/lib/bigdecimal/jacobian.rb
+++ b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
@@ -26,13 +26,13 @@ module Jacobian
aa = a.abs
bb = b.abs
if aa == zero && bb == zero then
- true
+ true
else
- if ((a-b)/(aa+bb)).abs < e then
- true
- else
- false
- end
+ if ((a-b)/(aa+bb)).abs < e then
+ true
+ else
+ false
+ end
end
end
#++
@@ -52,17 +52,17 @@ module Jacobian
s = f.zero
deriv = []
if(nRetry>100) then
- raise "Singular Jacobian matrix. No change at x[" + i.to_s + "]"
+ raise "Singular Jacobian matrix. No change at x[" + i.to_s + "]"
end
dx = dx*f.two
x[i] += dx
fxNew = f.values(x)
for j in 0...n do
if !isEqual(fxNew[j],fx[j],f.zero,f.eps) then
- ok += 1
- deriv <<= (fxNew[j]-fx[j])/dx
+ ok += 1
+ deriv <<= (fxNew[j]-fx[j])/dx
else
- deriv <<= f.zero
+ deriv <<= f.zero
end
end
x[i] = xSave
@@ -77,7 +77,7 @@ module Jacobian
for i in 0...n do
df = dfdxi(f,fx,x,i)
for j in 0...n do
- dfdx[j*n+i] = df[j]
+ dfdx[j*n+i] = df[j]
end
end
dfdx