Class: Liblinear::Array::Integer
- Inherits:
-
Liblinear::Array
- Object
- Liblinear::Array
- Liblinear::Array::Integer
- Defined in:
- lib/liblinear/array/integer.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(array) ⇒ Integer
constructor
A new instance of Integer.
Methods inherited from Liblinear::Array
Constructor Details
#initialize(array) ⇒ Integer
Returns a new instance of Integer.
18 19 20 21 22 23 24 |
# File 'lib/liblinear/array/integer.rb', line 18 def initialize(array) @array = Liblinearswig.new_int(array.size) array.size.times do |index| Liblinearswig.int_setitem(@array, index, array[index]) end @size = array.size end |
Class Method Details
.decode(array, size) ⇒ Object
7 8 9 |
# File 'lib/liblinear/array/integer.rb', line 7 def decode(array, size) size.times.map {|index| Liblinearswig.int_getitem(array, index)} end |
.delete(array) ⇒ Object
12 13 14 |
# File 'lib/liblinear/array/integer.rb', line 12 def delete(array) Liblinearswig.delete_int(array) end |