SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.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
 double get(int index)
          Get the index-th entry in the sequence.
 double[] getAll()
          Get the whole (finite) sequence in a double[] array.
 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 index)
Get the index-th entry in the sequence. The indices count from 1.

Parameters:
index - the index
Returns:
the index-th entry in the sequence

getAll

double[] getAll()
Get the whole (finite) sequence in a double[] array.

Returns:
all the computed terms of the sequence

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.