Class: Klam::Absvector

Inherits:
Array
  • Object
show all
Defined in:
lib/klam/absvector.rb

Instance Method Summary collapse

Instance Method Details

#[](i) ⇒ Object



3
4
5
6
7
8
# File 'lib/klam/absvector.rb', line 3

def [](i)
  if i < 0 || i >= size
    raise Klam::Error, "index out of bounds: #{i}"
  end
  super(i)
end

#[]=(i, x) ⇒ Object



10
11
12
13
14
15
# File 'lib/klam/absvector.rb', line 10

def []=(i, x)
  if i < 0 || i >= size
    raise Klam::Error, "index out of bounds: #{i}"
  end
  super(i, x)
end

#store(i, x) ⇒ Object



17
18
19
20
# File 'lib/klam/absvector.rb', line 17

def store(i, x)
  self[i] = x
  self
end