Class: Math::Expr::Sequence
- Inherits:
-
Object
show all
- Defined in:
- lib/ruuuby/math/expr/seq/sequence.rb
Overview
TODO: MISSING TDD!!!! TODO: look into Enumerator::ArithmeticSequence first
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(input_type, early_cache = []) ⇒ Sequence
Returns a new instance of Sequence.
15
16
17
18
19
20
21
22
23
|
# File 'lib/ruuuby/math/expr/seq/sequence.rb', line 15
def initialize(input_type, early_cache=[])
@input_type = input_type
@cached = early_cache
if @cached.
|
Instance Attribute Details
Returns the value of attribute input_type.
13
14
15
|
# File 'lib/ruuuby/math/expr/seq/sequence.rb', line 13
def input_type
@input_type
end
|
Instance Method Details
#[](index) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/ruuuby/math/expr/seq/sequence.rb', line 30
def [](index)
|
#A∀ₓ(max_x) ⇒ Object
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/ruuuby/math/expr/seq/sequence.rb', line 58
def A
|
#calc_val_at(n) ⇒ Object
81
82
83
84
|
# File 'lib/ruuuby/math/expr/seq/sequence.rb', line 81
def calc_val_at(n)
|
#populate_cache ⇒ Object
86
87
88
89
90
91
92
|
# File 'lib/ruuuby/math/expr/seq/sequence.rb', line 86
def populate_cache
i = 0
while i <= @max_cache_index
@cached[i] = self.calculate_value_at(i)
i += 1
end
end
|
#∀ₓ(max_i) ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/ruuuby/math/expr/seq/sequence.rb', line 50
def
|
#∀ₓᵢ(max_i) ⇒ Object
42
43
44
45
46
47
48
|
# File 'lib/ruuuby/math/expr/seq/sequence.rb', line 42
def
|
#∋?(n) ⇒ Boolean
25
26
27
28
|
# File 'lib/ruuuby/math/expr/seq/sequence.rb', line 25
def
|