Class: Vector

Inherits:
Object show all
Includes:
BasicStatistics
Defined in:
lib/feldtruby/vector.rb

Instance Method Summary collapse

Methods included from BasicStatistics

#average, #inter_quartile_range, #mean, #median, #quantile_at_ratio, #quantiles, #quartiles, #rms, #rms_from, #rms_from_scalar, #root_mean_square, #sd, #stdev, #sum, #sum_of_abs, #sum_of_abs_deviations, #sum_squared_error, #summary_stats, #var, #variance, #weighted_mean, #weighted_sum

Instance Method Details

#[](index, length = nil) ⇒ Object

Override index method and add slicing.



10
11
12
13
# File 'lib/feldtruby/vector.rb', line 10

def [](index, length = nil)
	return @elements[index] unless length
	Vector.elements(self.to_a[index, length])
end

#lengthObject

length is used by the BasicStatistics methods but is not available in Vector so add it…



6
# File 'lib/feldtruby/vector.rb', line 6

def length; size(); end