Data::BitStream::Code::Fibonacci - A Role implementing Fibonacci codes
version 0.08
A role written for Data::BitStream that provides get and set methods for the Fibonacci codes. The role applies to a stream object.
Insert one or more values as Fibonacci C1 codes. Returns 1.
Decode one or more Fibonacci C1 codes from the stream. If count is omitted, one value will be read. If count is negative, values will be read until the end of the stream is reached. In scalar context it returns the last code read; in array context it returns an array of all codes read.
Insert one or more values as generalized Fibonacci C1 codes with order m. Returns 1.
m
Decode one or more generalized Fibonacci C1 codes with order m from the stream. If count is omitted, one value will be read. If count is negative, values will be read until the end of the stream is reached. In scalar context it returns the last code read; in array context it returns an array of all codes read.
Insert one or more values as Fibonacci C2 codes. Returns 1.
Note that the C2 codes are not prefix-free codes, so will not work well with other codes. That is, these codes rely on the bit _after_ the code to be a 1 (or the end of the stream). Other codes may not meet this requirement.
Decode one or more Fibonacci C2 codes from the stream.
These methods are required for the role.
These papers introduce and describe the order m>=2 Fibonacci codes C1, C2, and C3. The m=2 C1 codes are what most people call Fibonacci codes.
m>=2
m=2
A description of the m=2 C1 code.
More information on Fibonacci codes, including m>2 codes.
m>2
Dana Jacobsen <dana@acm.org>
Copyright 2011-2012 by Dana Jacobsen <dana@acm.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Data::BitStream, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::BitStream
CPAN shell
perl -MCPAN -e shell install Data::BitStream
For more information on module installation, please visit the detailed CPAN module installation guide.