Binary-Heap-Array
view release on metacpan or search on metacpan
lib/Binary/Heap/Array.pm view on Meta::CPAN
confess unless speedSize;
$array->[5] //= (my $v = 0) # Field 6
}
sub currentWidth :lvalue ## The current width of the array
{my ($array) = @_;
no overloading;
confess unless speedWidth;
$array->[6] //= (my $v = 0) # Field 7
}
sub at($$) :lvalue # Address the element at a specified index so that it can get set or got
{my ($array, $index) = @_; # Array, index of element
my $n = size($array); # Array size
return undef if $index < -$n or $index >= $n; # Index out of range
return &atUp(@_) if $index >= 0;
&atDown(@_)
} # at # It would be nice to use overload @{} here but this requires flattening the array which would be very expensive on large arrays
sub inUseVector ($) :lvalue ## Sub arrays in use
{my ($array) = @_;
return inUse($array) if speedInUse;
( run in 1.675 second using v1.01-cache-2.11-cpan-5b529ec07f3 )