ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Algorithm-FEC/FEC.pm
(Generate patch)

Comparing Algorithm-FEC/FEC.pm (file contents):
Revision 1.9 by root, Sun Jun 27 12:43:08 2004 UTC vs.
Revision 1.14 by root, Thu Nov 22 01:41:39 2012 UTC

34 34
35require XSLoader; 35require XSLoader;
36 36
37no warnings; 37no warnings;
38 38
39$VERSION = 0.5; 39$VERSION = '1.1';
40 40
41XSLoader::load Algorithm::FEC, $VERSION; 41XSLoader::load Algorithm::FEC, $VERSION;
42 42
43=item $fec = new Algorithm::FEC $data_blocks, $encoded_blocks, $blocksize 43=item $fec = new Algorithm::FEC $data_blocks, $encoded_blocks, $blocksize
44 44
89=item $fec->set_decode_blocks ([array_of_blocks], [array_of_indices]) 89=item $fec->set_decode_blocks ([array_of_blocks], [array_of_indices])
90 90
91Prepares to decode C<data_blocks> of blocks (see C<set_encode_blocks> for 91Prepares to decode C<data_blocks> of blocks (see C<set_encode_blocks> for
92the C<array_of_blocks> parameter). 92the C<array_of_blocks> parameter).
93 93
94Since these are not necessarily the original data blocks, an array of 94Since these are not usually the original data blocks, an array of
95indices (ranging from C<0> to C<encoded_blocks-1>) must be supplied as 95indices (ranging from C<0> to C<encoded_blocks-1>) must be supplied as
96the second arrayref. 96the second arrayref.
97 97
98Both arrays must have exactly C<data_blocks> entries. 98Both arrays must have exactly C<data_blocks> entries.
99 99
100This method also reorders the blocks and index array in place (if 100This method also reorders the blocks and index array in place (if
101necessary) to reflect the order the blocks will have in the decoded 101necessary) to reflect the order the blocks will have in the decoded
102result. 102result.
103
104Both arrays must have exactly C<data_blocks> entries.
105 103
106The index array represents the decoded ordering, in that the n-th entry 104The index array represents the decoded ordering, in that the n-th entry
107in the indices array corresponds to the n-th data block of the decoded 105in the indices array corresponds to the n-th data block of the decoded
108result. The value stored in the n-th place in the array will contain the 106result. The value stored in the n-th place in the array will contain the
109index of the encoded data block. 107index of the encoded data block.
135 133
136The same same as C<set_decode_blocks>, with the exception that the blocks 134The same same as C<set_decode_blocks>, with the exception that the blocks
137are not actually set for decoding. 135are not actually set for decoding.
138 136
139This method is not normally used, but if you want to move blocks 137This method is not normally used, but if you want to move blocks
140around after reodering and before decoding, then calling Cshuffle> 138around after reordering and before decoding, then calling C<shuffle>
141followed by C<set_decode_blocks> incurs lower overhead than calling 139followed by C<set_decode_blocks> incurs lower overhead than calling
142C<set_decode_blocks> twice, as files are not mmapped etc. 140C<set_decode_blocks> twice, as files are not mmapped etc.
143 141
144=item $fec->decode 142=item $fec->decode
145 143
157 155
158=head1 COMPATIBILITY 156=head1 COMPATIBILITY
159 157
160The way this module works is compatible with the way freenet 158The way this module works is compatible with the way freenet
161(L<http://freenet.sf.net>) encodes files. Comaptibility to other file 159(L<http://freenet.sf.net>) encodes files. Comaptibility to other file
162formats or networks is not know, please tell me if you find more examples. 160formats or networks is not known, please tell me if you find more examples.
163 161
164=head1 SEE ALSO 162=head1 SEE ALSO
165 163
166L<Net::FCP>. And the author, who might be happy to receive mail from any 164L<Net::FCP>. And the author, who might be happy to receive mail from any
167user, just to see that this rather rarely-used module is actually being 165user, just to see that this rather rarely-used module is actually being
175 * utility functions for files should be provided. 173 * utility functions for files should be provided.
176 * 16 bit version not tested 174 * 16 bit version not tested
177 175
178=head1 AUTHOR 176=head1 AUTHOR
179 177
180 Marc Lehmann <pcg@goof.com> 178 Marc Lehmann <schmorp@schmorp.de>
181 http://home.schmorp.de 179 http://home.schmorp.de
182 180
183=cut 181=cut
184 182
1851; 1831;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines