Skip to content

Commit e0b73ff

Browse files
committed
multidim minimization namings changed
1 parent bf2943e commit e0b73ff

6 files changed

+8
-14
lines changed

lib/brent_root_finder.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,5 @@ def find_root(lo, hi, f)
9494
end
9595
end
9696
end
97-
9897
end
99-
10098
end
101-
102-
#root = Minimization::BrentRootFinder.new(nil)
103-
#func = proc{|x| (x-3.5872)**2}
104-
#puts root.find_root(0, 5, func)
File renamed without changes.

lib/powell.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ def brent_search(point, direction)
146146
# == Usage.
147147
# require 'minimization'
148148
# f = proc{ |x| (x[0] - 1)**2 + (2*x[1] - 5)**2 + (x[2]-3.3)**2}
149-
# min = Minimization::PowellMinimizer.new(f, [1, 2, 3], [0, 0, 0], [5, 5, 5])
149+
# min = Minimization::Powell.new(f, [1, 2, 3], [0, 0, 0], [5, 5, 5])
150150
# while(min.converging?)
151151
# min.minimize
152152
# end
153153
# min.f_minimum
154154
# min.x_minimum
155155
#
156-
class PowellMinimizer < ConjugateDirectionMinimizer
156+
class Powell < ConjugateDirectionMinimizer
157157

158158
attr_accessor :relative_threshold
159159
attr_accessor :absolute_threshold

spec/minimization_conjugate_gradient_fletcher_reeves.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require "./../lib/conjugate_gradient_minimizer.rb"
1+
require "./../lib/conjugate_gradient.rb"
22

33
describe Minimization::NonLinearConjugateGradientMinimizer do
44

spec/minimization_conjugate_gradient_polak_ribiere.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require "./../lib/conjugate_gradient_minimizer.rb"
1+
require "./../lib/conjugate_gradient.rb"
22

33
describe Minimization::NonLinearConjugateGradientMinimizer do
44

spec/minimization_powell_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "./../lib/powell.rb"
22

3-
describe Minimization::PowellMinimizer do
3+
describe Minimization::Powell do
44
before :all do
55
@n = 3
66
@limit = 100
@@ -18,22 +18,22 @@
1818

1919
# example 1
2020
f = proc{ |x| (x[0] - @p[0])**2 + (x[1] - @p[1])**2 + (x[2] - @p[2])**2 }
21-
@min1 = Minimization::PowellMinimizer.new(f, @start_point, [-@limit, -@limit, -@limit], [@limit, @limit, @limit])
21+
@min1 = Minimization::Powell.new(f, @start_point, [-@limit, -@limit, -@limit], [@limit, @limit, @limit])
2222
while(@min1.converging?)
2323
@min1.minimize
2424
end
2525

2626
# example 2
2727
@k = rand(@limit)
2828
f2 = proc{ |x| ( @p[0]*x[0] + @p[1]*x[1] + @p[2]*x[2] )**2 + @k}
29-
@min2 = Minimization::PowellMinimizer.new(f2, @start_point, [-@limit, -@limit, -@limit], [@limit, @limit, @limit])
29+
@min2 = Minimization::Powell.new(f2, @start_point, [-@limit, -@limit, -@limit], [@limit, @limit, @limit])
3030
while(@min2.converging?)
3131
@min2.minimize
3232
end
3333

3434
# example 3 : unidimensional
3535
f3 = proc{ |x| (x[0] - @p[0])**2 + @k}
36-
@min3 = Minimization::PowellMinimizer.new(f3, @start_point, [-@limit, -@limit, -@limit], [@limit, @limit, @limit])
36+
@min3 = Minimization::Powell.new(f3, @start_point, [-@limit, -@limit, -@limit], [@limit, @limit, @limit])
3737
while(@min3.converging?)
3838
@min3.minimize
3939
end

0 commit comments

Comments
 (0)