Skip to content

Commit

Permalink
New attibute iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
clbustos committed Nov 15, 2010
1 parent d7618a7 commit 3b7fafd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
lib/multidimensional
doc
pkg
*~
3 changes: 3 additions & 0 deletions History.txt
@@ -1,3 +1,6 @@
=== 0.2.1 / 2010-11-14
* Added iterations method

=== 0.2.0 / 2010-04-15
* New Minimization::NewtonRahpson class, which implements a naive Newton-Rahpson minimization method
x=x_n-(f'(x)/f''(x))
Expand Down
6 changes: 4 additions & 2 deletions lib/minimization.rb
Expand Up @@ -16,10 +16,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
require 'text-table'
# Algorithms for unidimensional minimization
require 'text-table'
module Minimization
VERSION="0.2.0"
VERSION="0.2.1"
FailedIteration=Class.new(Exception)
# Base class for unidimensional minimizers
class Unidimensional
Expand All @@ -39,6 +39,8 @@ class Unidimensional
attr_accessor :epsilon
# Expected value. Fast minimum finding if set
attr_reader :expected
# Numbers of iterations
attr_reader :iterations
# Create a new minimizer
def initialize(lower, upper, proc)
raise "first argument should be lower than second" if lower>=upper
Expand Down

0 comments on commit 3b7fafd

Please sign in to comment.