Class: XRVG::BinaryTreeRange

Inherits:
Object
  • Object
show all
Defined in:
lib/interpolation.rb

Instance Method Summary collapse

Constructor Details

#initialize(limit, quadleft, quadright, range = nil) ⇒ BinaryTreeRange

Returns a new instance of BinaryTreeRange.



84
85
86
87
88
89
# File 'lib/interpolation.rb', line 84

def initialize( limit, quadleft, quadright, range=nil )
  @limit     = limit
  @quadleft  = quadleft
  @quadright = quadright
  @range     = range
end

Instance Method Details

#range(index) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
# File 'lib/interpolation.rb', line 91

def range( index )
  if @limit
    if index < @limit
	return @quadleft.range( index )
    else
	return @quadright.range( index )
    end
  else
    return @range
  end
end