pretty_gsl 0.0.1 → 0.0.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.
- data/README.md +2 -2
- data/lib/pretty_gsl.rb +1 -0
- data/lib/pretty_gsl/minimizer.rb +3 -0
- data/lib/pretty_gsl/version.rb +1 -1
- data/pretty_gsl-0.0.1.gem +0 -0
- metadata +3 -2
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# PrettyGSL
|
2
2
|
|
3
|
-
This gem provides a nice interface to the GNU scientific library through the Ruby/GSL wrapper. I've simply attempted to update the interface to use more idiomatic ruby.
|
3
|
+
This gem provides a nice interface to the <a href = 'http://rb-gsl.rubyforge.org/'>GNU scientific library</a> through the <a href = 'http://www.gnu.org/software/gsl/manual/html_node/'>Ruby/GSL</a> wrapper. I've simply attempted to update the interface to use more idiomatic ruby.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
data/lib/pretty_gsl.rb
CHANGED
data/lib/pretty_gsl/minimizer.rb
CHANGED
@@ -13,8 +13,10 @@ module PrettyGSL
|
|
13
13
|
step_size: 0.01, # initial guess of the length scale of the minimiztion steps
|
14
14
|
direction_tolerance: 1e-4, # the tolerance for errors in the direction of line minimization
|
15
15
|
absolute_gradient_tolerance: 1e-3, # halt if the magnetude of the gradient falls below this value
|
16
|
+
logger: nil, # logger target
|
16
17
|
}.merge(options)
|
17
18
|
@result = nil
|
19
|
+
@logger = Logger.new(@params[:logger])
|
18
20
|
self
|
19
21
|
end
|
20
22
|
|
@@ -23,6 +25,7 @@ module PrettyGSL
|
|
23
25
|
@params[:max_iterations].times do |iter|
|
24
26
|
status = minimizer.iterate
|
25
27
|
status = test_gsl_convergence(minimizer)
|
28
|
+
@logger.info minimizer.x.to_a.inspect
|
26
29
|
if status != CONTINUE
|
27
30
|
@result = {
|
28
31
|
success: status == SUCCESS,
|
data/lib/pretty_gsl/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_gsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gsl
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/pretty_gsl.rb
|
43
43
|
- lib/pretty_gsl/minimizer.rb
|
44
44
|
- lib/pretty_gsl/version.rb
|
45
|
+
- pretty_gsl-0.0.1.gem
|
45
46
|
- pretty_gsl.gemspec
|
46
47
|
- test/minimizer_test.rb
|
47
48
|
- test/test_helper.rb
|