Skip to content

Commit

Permalink
Protect logs from raises
Browse files Browse the repository at this point in the history
  • Loading branch information
clbustos committed Apr 15, 2010
1 parent 18c12d1 commit 3382768
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
6 changes: 5 additions & 1 deletion lib/minimization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ def iterate
k+=1
result=brent_iterate
raise "Error on iteration" if !result
@log+=sprintf("%d: [%0.5f - %0.5f] -> [%0.5f - %0.5f] E: %0.6f\n", k, @x_lower, @x_upper, @f_lower, @f_upper, (@x_lower-@x_upper).abs)
begin
@log+=sprintf("%d: [%0.5f - %0.5f] -> [%0.5f - %0.5f] E: %0.6f\n", k, @x_lower, @x_upper, @f_lower, @f_upper, (@x_lower-@x_upper).abs)
rescue =>@e
@log+=@e.to_s
end
end
@iterations=k
return true
Expand Down
4 changes: 0 additions & 4 deletions svn-commit.2.tmp

This file was deleted.

4 changes: 0 additions & 4 deletions svn-commit.3.tmp

This file was deleted.

4 changes: 0 additions & 4 deletions svn-commit.tmp

This file was deleted.

0 comments on commit 3382768

Please sign in to comment.