summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/lib/bigdecimal/jacobian.rb
diff options
context:
space:
mode:
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