Class: Java::WekaCore::FastVector
- Inherits:
-
Object
- Object
- Java::WekaCore::FastVector
- Includes:
- Enumerable
- Defined in:
- lib/eureka/core.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(int_or_array = 0) ⇒ FastVector
constructor
A new instance of FastVector.
Constructor Details
#initialize(int_or_array = 0) ⇒ FastVector
Returns a new instance of FastVector.
25 26 27 28 29 30 31 32 |
# File 'lib/eureka/core.rb', line 25 def initialize(int_or_array=0) if int_or_array.kind_of?(Fixnum) super(int_or_array) else super(int_or_array.size) int_or_array.each { |arg| self.add_element(arg) } end end |
Instance Method Details
#each ⇒ Object
41 42 43 |
# File 'lib/eureka/core.rb', line 41 def each size.times { |i| yield self[i] } end |