minimization 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.travis.yml +12 -0
- data/Gemfile +3 -0
- data/History.txt +10 -8
- data/README.md +44 -0
- data/Rakefile +21 -12
- data/lib/minimization.rb +51 -10
- data/lib/minimization/version.rb +3 -0
- data/minimization.gemspec +29 -0
- data/spec/minimization_unidimensional_spec.rb +6 -6
- data/spec/spec_helper.rb +3 -3
- metadata +103 -119
- data.tar.gz.sig +0 -1
- data/Manifest.txt +0 -9
- data/README.txt +0 -41
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b1e3a5c66d134371cdc8bd31a5939c8d195be0fe
|
4
|
+
data.tar.gz: 20890b7e512b97c8365e76154e56d317447acb30
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 497250860ea7f006431d15c91c62c13ecb2b79f26a4430cfe7dd3897fec5a860016d473cd2f729cda610c26d6c4c8505311894851ad8ad050f23d68fdbd5daf2
|
7
|
+
data.tar.gz: df0d7a750434ba71ac01edf95fc6d9e62dae1bfeca50d1f785c1491e44bbd591a1fecda4cc1620ffb6a1bde4c39b63910ff80c1af9d1c6a021cc4eff1bad82af
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/History.txt
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
+
=== 0.2.2 / 2015-04-
|
2
|
+
* Added Travis-CI support.
|
3
|
+
* Removed Hoe in favor of using a gemspec.
|
4
|
+
|
1
5
|
=== 0.2.1 / 2010-11-14
|
2
|
-
* Added iterations method
|
6
|
+
* Added iterations method.
|
3
7
|
|
4
8
|
=== 0.2.0 / 2010-04-15
|
5
|
-
* New Minimization::NewtonRahpson class, which implements a naive Newton-Rahpson minimization method
|
6
|
-
|
7
|
-
=== 0.1.1 / 2010-03-19
|
9
|
+
* New Minimization::NewtonRahpson class, which implements a naive Newton-Rahpson minimization method
|
10
|
+
`x = x_n - (f'(x) / f''(x))`.
|
8
11
|
|
9
|
-
|
12
|
+
=== 0.1.1 / 2010-03-19
|
13
|
+
* New Minimization#minimize convenience method.
|
10
14
|
|
11
15
|
=== 0.1.0 / 2010-02-24
|
12
|
-
|
13
|
-
* Golden Section and Brent Algorithm
|
14
|
-
|
16
|
+
* Golden Section and Brent Algorithm.
|
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Minimization
|
2
|
+
|
3
|
+
[](https://travis-ci.org/SciRuby/minimization)
|
4
|
+
[](https://codeclimate.com/github/SciRuby/minimization)
|
5
|
+
|
6
|
+
* https://github.com/sciruby/minimization
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
Minimization algorithms on pure Ruby.
|
11
|
+
|
12
|
+
## FEATURES/PROBLEMS
|
13
|
+
|
14
|
+
Unidimensional:
|
15
|
+
* Newton-Rahpson (requires first and second derivative)
|
16
|
+
* Golden Section
|
17
|
+
* Brent (Port of GSL code)
|
18
|
+
|
19
|
+
If you needs speed, use rb-gsl
|
20
|
+
|
21
|
+
## SYNOPSIS
|
22
|
+
|
23
|
+
d=Minimization::Brent.new(-1000,20000 , proc {|x| x**2})
|
24
|
+
|
25
|
+
d.iterate
|
26
|
+
|
27
|
+
puts d.x_minimum
|
28
|
+
puts d.f_minimum
|
29
|
+
|
30
|
+
## REQUIREMENTS
|
31
|
+
|
32
|
+
* Pure Ruby
|
33
|
+
|
34
|
+
## INSTALL
|
35
|
+
|
36
|
+
sudo gem install minimization
|
37
|
+
|
38
|
+
## API
|
39
|
+
|
40
|
+
http://ruby-statsample.rubyforge.org/minimization/
|
41
|
+
|
42
|
+
## LICENSE
|
43
|
+
|
44
|
+
GPL-2 (See LICENSE.txt)
|
data/Rakefile
CHANGED
@@ -1,16 +1,25 @@
|
|
1
|
-
|
1
|
+
require 'rake'
|
2
|
+
require 'bundler'
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
require 'rdoc/task'
|
2
6
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
+
# Setup the necessary gems, specified in the gemspec.
|
8
|
+
begin
|
9
|
+
Bundler.setup(:default, :development)
|
10
|
+
rescue Bundler::BundlerError => e
|
11
|
+
$stderr.puts e.message
|
12
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
13
|
+
exit e.status_code
|
14
|
+
end
|
15
|
+
|
16
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
17
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
18
|
+
end
|
7
19
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
self.developer('Claudio Bustos', 'clbustos_AT_gmail.com')
|
12
|
-
self.remote_rdoc_dir = 'minimization'
|
13
|
-
self.extra_deps << ['text-table', "~>1.2"]
|
20
|
+
desc "Open an irb session preloaded with distribution"
|
21
|
+
task :console do
|
22
|
+
sh "irb -rubygems -I lib -r minimization.rb"
|
14
23
|
end
|
15
24
|
|
16
|
-
|
25
|
+
task :default => [:spec]
|
data/lib/minimization.rb
CHANGED
@@ -18,8 +18,8 @@
|
|
18
18
|
#
|
19
19
|
# Algorithms for unidimensional minimization
|
20
20
|
require 'text-table'
|
21
|
+
|
21
22
|
module Minimization
|
22
|
-
VERSION="0.2.1"
|
23
23
|
FailedIteration=Class.new(Exception)
|
24
24
|
# Base class for unidimensional minimizers
|
25
25
|
class Unidimensional
|
@@ -71,7 +71,7 @@ module Minimization
|
|
71
71
|
# == Usage:
|
72
72
|
# minimizer=Minimization::GoldenSection.minimize(-1000, 1000) {|x|
|
73
73
|
# x**2 }
|
74
|
-
#
|
74
|
+
#
|
75
75
|
def self.minimize(lower,upper,expected=nil,&block)
|
76
76
|
minimizer=new(lower,upper,block)
|
77
77
|
minimizer.expected=expected unless expected.nil?
|
@@ -86,7 +86,7 @@ module Minimization
|
|
86
86
|
@proc.call(x)
|
87
87
|
end
|
88
88
|
end
|
89
|
-
# Classic Newton-Raphson minimization method.
|
89
|
+
# Classic Newton-Raphson minimization method.
|
90
90
|
# Requires first and second derivative
|
91
91
|
# == Usage
|
92
92
|
# f = lambda {|x| x**2}
|
@@ -96,7 +96,7 @@ module Minimization
|
|
96
96
|
# min.iterate
|
97
97
|
# min.x_minimum
|
98
98
|
# min.f_minimum
|
99
|
-
#
|
99
|
+
#
|
100
100
|
class NewtonRaphson < Unidimensional
|
101
101
|
# == Parameters:
|
102
102
|
# * <tt>lower</tt>: Lower possible value
|
@@ -104,7 +104,7 @@ module Minimization
|
|
104
104
|
# * <tt>proc</tt>: Original function
|
105
105
|
# * <tt>proc_1d</tt>: First derivative
|
106
106
|
# * <tt>proc_2d</tt>: Second derivative
|
107
|
-
#
|
107
|
+
#
|
108
108
|
def initialize(lower, upper, proc, proc_1d, proc_2d)
|
109
109
|
super(lower,upper,proc)
|
110
110
|
@proc_1d=proc_1d
|
@@ -126,8 +126,8 @@ module Minimization
|
|
126
126
|
x=x-(@proc_1d.call(x).quo(@proc_2d.call(x)))
|
127
127
|
f_prev=f(x_prev)
|
128
128
|
f=f(x)
|
129
|
-
x_min,x_max=[x,x_prev].min, [x,x_prev].max
|
130
|
-
f_min,f_max=[f,f_prev].min, [f,f_prev].max
|
129
|
+
x_min,x_max=[x,x_prev].min, [x,x_prev].max
|
130
|
+
f_min,f_max=[f,f_prev].min, [f,f_prev].max
|
131
131
|
@log << [k, x_min, x_max, f_min, f_max, (x_prev-x).abs, (f-f_prev).abs]
|
132
132
|
end
|
133
133
|
raise FailedIteration, "Not converged" if k>=@max_iteration
|
@@ -186,7 +186,7 @@ module Minimization
|
|
186
186
|
f1 = f(x1);
|
187
187
|
end
|
188
188
|
@log << [k, x3,x0, f1,f2,(x3-x0).abs, (f1-f2).abs]
|
189
|
-
|
189
|
+
|
190
190
|
k +=1;
|
191
191
|
end
|
192
192
|
|
@@ -247,7 +247,7 @@ module Minimization
|
|
247
247
|
@f_minimum=f(v)
|
248
248
|
@do_bracketing=false
|
249
249
|
end
|
250
|
-
|
250
|
+
|
251
251
|
def bracketing
|
252
252
|
eval_max=10
|
253
253
|
f_left = @f_lower;
|
@@ -323,7 +323,7 @@ module Minimization
|
|
323
323
|
k+=1
|
324
324
|
result=brent_iterate
|
325
325
|
raise FailedIteration,"Error on iteration" if !result
|
326
|
-
begin
|
326
|
+
begin
|
327
327
|
@log << [k, @x_lower, @x_upper, @f_lower, @f_upper, (@x_lower-@x_upper).abs, (@f_lower-@f_upper).abs]
|
328
328
|
rescue =>@e
|
329
329
|
@log << [k, @e.to_s,nil,nil,nil,nil,nil]
|
@@ -442,4 +442,45 @@ module Minimization
|
|
442
442
|
|
443
443
|
end
|
444
444
|
end
|
445
|
+
|
446
|
+
# = Bisection Method for Minimization.
|
447
|
+
# See Unidimensional for methods.
|
448
|
+
# == Usage.
|
449
|
+
# require 'minimization'
|
450
|
+
# min=Minimization::Bisection.new(1,2 , proc {|x| (x)**3-(x)-2}
|
451
|
+
# min.iterate
|
452
|
+
# min.x_minimum
|
453
|
+
# min.f_minimum
|
454
|
+
# min.log
|
455
|
+
# Source:
|
456
|
+
# * R.L. Burden, J. Faires: Numerical Analysis
|
457
|
+
class Bisection < Unidimensional
|
458
|
+
|
459
|
+
def iterate()
|
460
|
+
ax = @lower
|
461
|
+
cx = @upper
|
462
|
+
k = 0;
|
463
|
+
while (ax-cx).abs > @epsilon and k<@max_iteration
|
464
|
+
bx = (ax + cx).quo(2);
|
465
|
+
fa = f(ax);
|
466
|
+
fb = f(bx);
|
467
|
+
fc = f(cx);
|
468
|
+
if (fa*fb <0)
|
469
|
+
cx = bx;
|
470
|
+
else (fb*fc <0)
|
471
|
+
ax = bx;
|
472
|
+
end
|
473
|
+
k +=1;
|
474
|
+
@log << [k, ax.to_f, cx.to_f, f(ax).to_f, f(cx).to_f, (ax-cx).abs.to_f, (f(ax)-f(cx)).abs.to_f]
|
475
|
+
end
|
476
|
+
|
477
|
+
if (fa<fc)
|
478
|
+
@x_minimum,@f_minimum = ax.to_f, f(ax).to_f;
|
479
|
+
else
|
480
|
+
@x_minimum,@f_minimum = cx.to_f, f(cx).to_f;
|
481
|
+
end
|
482
|
+
|
483
|
+
end
|
484
|
+
end
|
485
|
+
|
445
486
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'minimization/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "minimization"
|
8
|
+
s.version = Minimization::VERSION
|
9
|
+
s.date = Date.today.to_s
|
10
|
+
|
11
|
+
s.authors = ["Claudio Bustos", "Rajat Kapoor"]
|
12
|
+
s.email = ["clbustos@gmail.com", "rajat100493@gmail.com"]
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.homepage = "https://github.com/sciruby/minimization"
|
19
|
+
|
20
|
+
s.description = "Minimization algorithms on pure Ruby"
|
21
|
+
s.summary = "A suite for minimization in Ruby"
|
22
|
+
|
23
|
+
s.add_runtime_dependency 'text-table', '~> 1.2'
|
24
|
+
s.add_runtime_dependency 'rb-gsl', '~> 1.2'
|
25
|
+
|
26
|
+
s.add_development_dependency 'rake', '~> 10'
|
27
|
+
s.add_development_dependency 'bundler', '~> 1.3'
|
28
|
+
s.add_development_dependency 'rspec', '~> 3.2'
|
29
|
+
end
|
@@ -14,10 +14,10 @@ describe Minimization::Unidimensional, "subclass" do
|
|
14
14
|
@min.iterate
|
15
15
|
end
|
16
16
|
it "#x_minimum be close to expected" do
|
17
|
-
@min.x_minimum.should
|
17
|
+
@min.x_minimum.should be_within(@min.epsilon).of(@p1)
|
18
18
|
end
|
19
19
|
it "#f_minimum ( f(x)) be close to expected" do
|
20
|
-
@min.f_minimum.should
|
20
|
+
@min.f_minimum.should be_within(@min.epsilon).of(@p2)
|
21
21
|
end
|
22
22
|
context "#log" do
|
23
23
|
subject {@min.log}
|
@@ -32,10 +32,10 @@ describe Minimization::Unidimensional, "subclass" do
|
|
32
32
|
@min = Minimization::GoldenSection.minimize(-1000,1000, &@func)
|
33
33
|
end
|
34
34
|
it "#x_minimum be close to expected" do
|
35
|
-
@min.x_minimum.should
|
35
|
+
@min.x_minimum.should be_within(@min.epsilon).of(@p1)
|
36
36
|
end
|
37
37
|
it "#f_minimum ( f(x)) be close to expected" do
|
38
|
-
@min.f_minimum.should
|
38
|
+
@min.f_minimum.should be_within(@min.epsilon).of(@p2)
|
39
39
|
end
|
40
40
|
context "#log" do
|
41
41
|
subject {@min.log}
|
@@ -48,10 +48,10 @@ describe Minimization::Unidimensional, "subclass" do
|
|
48
48
|
@min = Minimization::Brent.minimize(-1000,1000, &@func)
|
49
49
|
end
|
50
50
|
it "should x be correct" do
|
51
|
-
@min.x_minimum.should
|
51
|
+
@min.x_minimum.should be_within(@min.epsilon).of(@p1)
|
52
52
|
end
|
53
53
|
it "should f(x) be correct" do
|
54
|
-
@min.f_minimum.should
|
54
|
+
@min.f_minimum.should be_within(@min.epsilon).of(@p2)
|
55
55
|
end
|
56
56
|
context "#log" do
|
57
57
|
subject {@min.log}
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
2
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
3
|
require 'minimization.rb'
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'rspec'
|
5
|
+
require 'rspec/autorun'
|
6
6
|
|
7
|
-
|
7
|
+
RSpec.configure do |config|
|
8
8
|
|
9
9
|
end
|
10
10
|
|
metadata
CHANGED
@@ -1,147 +1,131 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: minimization
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: false
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 1
|
10
|
-
version: 0.2.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.2
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Claudio Bustos
|
8
|
+
- Rajat Kapoor
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
|
-
cert_chain:
|
17
|
-
-
|
18
|
-
|
19
|
-
|
20
|
-
c3RvczEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
21
|
-
MB4XDTEwMDMyOTIxMzg1NVoXDTExMDMyOTIxMzg1NVowPzERMA8GA1UEAwwIY2xi
|
22
|
-
dXN0b3MxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
|
23
|
-
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf8JVMGqE7m5kYb+PNN
|
24
|
-
neZv2pcXV5fQCi6xkyG8bi2/SIFy/LyxuvLzEeOxBeaz1Be93bayIUquOIqw3dyw
|
25
|
-
/KXWa31FxuNuvAm6CN8fyeRYX/ou4cw3OIUUnIvB7RMNIu4wbgeM6htV/QEsNLrv
|
26
|
-
at1/mh9JpqawPrcjIOVMj4BIp67vmzJCaUf+S/H2uYtSO09F+YQE3tv85TPeRmqU
|
27
|
-
yjyXyTc/oJiw1cXskUL8UtMWZmrwNLHXuZWWIMzkjiz3UNdhJr/t5ROk8S2WPznl
|
28
|
-
0bMy/PMIlAbqWolRn1zl2VFJ3TaXScbqImY8Wf4g62b/1ZSUlGrtnLNsCYXrWiso
|
29
|
-
UPUCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFGu9
|
30
|
-
rrJ1H64qRmNNu3Jj/Qjvh0u5MA0GCSqGSIb3DQEBBQUAA4IBAQCV0Unka5isrhZk
|
31
|
-
GjqSDqY/6hF+G2pbFcbWUpjmC8NWtAxeC+7NGV3ljd0e1SLfoyBj4gnFtFmY8qX4
|
32
|
-
K02tgSZM0eDV8TpgFpWXzK6LzHvoanuahHLZEtk/+Z885lFene+nHadkem1n9iAB
|
33
|
-
cs96JO9/JfFyuXM27wFAwmfHCmJfPF09R4VvGHRAvb8MGzSVgk2i06OJTqkBTwvv
|
34
|
-
JHJdoyw3+8bw9RJ+jLaNoQ+xu+1pQdS2bb3m7xjZpufml/m8zFCtjYM/7qgkKR8z
|
35
|
-
/ZZt8lCiKfFArppRrZayE2FVsps4X6WwBdrKTMZ0CKSXTRctbEj1BAZ67eoTvBBt
|
36
|
-
rpP0jjs0
|
37
|
-
-----END CERTIFICATE-----
|
38
|
-
|
39
|
-
date: 2010-11-14 00:00:00 -03:00
|
40
|
-
default_executable:
|
41
|
-
dependencies:
|
42
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
43
15
|
name: text-table
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.2'
|
21
|
+
type: :runtime
|
44
22
|
prerelease: false
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.2'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rb-gsl
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.2'
|
55
35
|
type: :runtime
|
56
|
-
version_requirements: *id001
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
|
-
name: rubyforge
|
59
36
|
prerelease: false
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.2'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rake
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '10'
|
71
49
|
type: :development
|
72
|
-
version_requirements: *id002
|
73
|
-
- !ruby/object:Gem::Dependency
|
74
|
-
name: hoe
|
75
50
|
prerelease: false
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '10'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: bundler
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.3'
|
87
63
|
type: :development
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
-
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.3'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '3.2'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '3.2'
|
84
|
+
description: Minimization algorithms on pure Ruby
|
85
|
+
email:
|
86
|
+
- clbustos@gmail.com
|
87
|
+
- rajat100493@gmail.com
|
92
88
|
executables: []
|
93
|
-
|
94
89
|
extensions: []
|
95
|
-
|
96
|
-
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- ".travis.yml"
|
94
|
+
- Gemfile
|
97
95
|
- History.txt
|
98
96
|
- LICENSE.txt
|
99
|
-
-
|
100
|
-
- README.txt
|
101
|
-
files:
|
102
|
-
- History.txt
|
103
|
-
- LICENSE.txt
|
104
|
-
- Manifest.txt
|
105
|
-
- README.txt
|
97
|
+
- README.md
|
106
98
|
- Rakefile
|
107
99
|
- lib/minimization.rb
|
100
|
+
- lib/minimization/version.rb
|
101
|
+
- minimization.gemspec
|
108
102
|
- spec/minimization_unidimensional_spec.rb
|
109
103
|
- spec/spec.opts
|
110
104
|
- spec/spec_helper.rb
|
111
|
-
|
112
|
-
homepage: http://github.com/clbustos/minimization
|
105
|
+
homepage: https://github.com/sciruby/minimization
|
113
106
|
licenses: []
|
114
|
-
|
107
|
+
metadata: {}
|
115
108
|
post_install_message:
|
116
|
-
rdoc_options:
|
117
|
-
|
118
|
-
- README.txt
|
119
|
-
require_paths:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
120
111
|
- lib
|
121
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
-
|
123
|
-
requirements:
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
124
114
|
- - ">="
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
version: "0"
|
130
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
|
-
requirements:
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
133
119
|
- - ">="
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
|
136
|
-
segments:
|
137
|
-
- 0
|
138
|
-
version: "0"
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
139
122
|
requirements: []
|
140
|
-
|
141
|
-
|
142
|
-
rubygems_version: 1.3.7
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.2.2
|
143
125
|
signing_key:
|
144
|
-
specification_version:
|
145
|
-
summary:
|
146
|
-
test_files:
|
147
|
-
|
126
|
+
specification_version: 4
|
127
|
+
summary: A suite for minimization in Ruby
|
128
|
+
test_files:
|
129
|
+
- spec/minimization_unidimensional_spec.rb
|
130
|
+
- spec/spec.opts
|
131
|
+
- spec/spec_helper.rb
|
data.tar.gz.sig
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
��ֹ��w*7�
|
data/Manifest.txt
DELETED
data/README.txt
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
= minimization
|
2
|
-
|
3
|
-
* http://github.com/clbustos/minimization
|
4
|
-
|
5
|
-
== DESCRIPTION:
|
6
|
-
|
7
|
-
Minimization algorithms on pure Ruby.
|
8
|
-
|
9
|
-
== FEATURES/PROBLEMS:
|
10
|
-
|
11
|
-
Unidimensional:
|
12
|
-
* Newton-Rahpson (requires first and second derivative)
|
13
|
-
* Golden Section
|
14
|
-
* Brent (Port of GSL code)
|
15
|
-
|
16
|
-
If you needs speed, use rb-gsl
|
17
|
-
|
18
|
-
== SYNOPSIS:
|
19
|
-
|
20
|
-
d=Minimization::Brent.new(-1000,20000 , proc {|x| x**2})
|
21
|
-
|
22
|
-
d.iterate
|
23
|
-
|
24
|
-
puts d.x_minimum
|
25
|
-
puts d.f_minimum
|
26
|
-
|
27
|
-
== REQUIREMENTS:
|
28
|
-
|
29
|
-
* Pure Ruby
|
30
|
-
|
31
|
-
== INSTALL:
|
32
|
-
|
33
|
-
sudo gem install minimization
|
34
|
-
|
35
|
-
== API:
|
36
|
-
|
37
|
-
http://ruby-statsample.rubyforge.org/minimization/
|
38
|
-
|
39
|
-
== LICENSE:
|
40
|
-
|
41
|
-
GPL-2 (See LICENSE.txt)
|
metadata.gz.sig
DELETED
Binary file
|