NAME
App::MathImage::NumSeq::Runs -- runs of consecutive integers
SYNOPSIS
use App::MathImage::NumSeq::Runs;
my $seq = App::MathImage::NumSeq::Runs->new;
my ($i, $value) = $seq->next;
DESCRIPTION
This is various kinds of runs of integers. The runs_type
parameter (a string) can be
"0toN" 0, 0,1, 0,1,2, 0,1,2,3, etc runs 0..N
"1toN" 1, 1,2, 1,2,3, 1,2,3,4, etc runs 1..N
"Nto0" 0, 1,0, 2,1,0, 3,2,1,0, etc runs N..0
"Nto1" 1, 2,1, 3,2,1, 4,3,2,1, etc runs N..1
"0toNinc" 0, 1,2, 2,3,4, 3,4,5,6, etc runs 0..N increasing
"Nrep" 1, 2,2, 3,3,3, 4,4,4,4, etc N repetitions of N
"N+1rep" 0, 1,1, 2,2,2, 3,3,3,3, etc N+1 repetitions of N
FUNCTIONS
$seq = App::MathImage::NumSeq::Runs->new (key=>value,...)
-
Create and return a new sequence object.
$value = $seq->ith($i)
-
Return the
$i
'th value from the sequence. $bool = $seq->pred($value)
-
Return true if
$value
occurs in the sequence.