Package dev.nm.analysis.sequence
Interface Sequence
-
- All Known Implementing Classes:
Fibonacci
public interface Sequence
A sequence is an ordered list of (real) numbers. Although some sequences, e.g., Fibonacci, have infinitely many elements, we can, in practice, compute only finitely many of them.- See Also:
- Wikipedia: Sequence
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
get(int i)
Get the i-th entry in the sequence, counting from 1.double[]
getAll()
Get a copy of the whole (finite) sequence indouble[]
.int
length()
Get the number of computed terms in the sequence.
-
-
-
Method Detail
-
length
int length()
Get the number of computed terms in the sequence.- Returns:
- the length of sequence
-
get
double get(int i)
Get the i-th entry in the sequence, counting from 1.- Parameters:
i
- an index- Returns:
- the i-th entry in the sequence
-
getAll
double[] getAll()
Get a copy of the whole (finite) sequence indouble[]
.- Returns:
- a copy of all the computed terms in the sequence
-
-