view release on metacpan or search on metacpan
lib/Algorithm/ExpectationMaximization.pm view on Meta::CPAN
seed_tags => ['a26', 'b53', 'c49'],
terminal_output => 1,
);
# This example call to the constructor also illustrates how you can inject class
# priors into the clustering process. The class priors are the prior probabilities
# of the class distributions in your dataset. As explained later, injecting class
# priors in the manner shown above makes statistical sense only for the case of
# manual seeding. When you do inject class priors, the order in which the priors
# are expressed must correspond to the manually specified seeds for the clusters.
lib/Algorithm/ExpectationMaximization.pm view on Meta::CPAN
=item B<seed_the_clusters():>
$clusterer->seed_the_clusters();
This is also a required call. It processes the option you
supplied for C<seeding> in the constructor call to choose
the data elements for seeding the C<K> clusters.
=item B<EM():>
view all matches for this distribution
view release on metacpan or search on metacpan
result. The value stored in the n-th place in the array will contain the
index of the encoded data block.
Input blocks with indices less than C<data_blocks> will be moved to their
final position (block k to position k), while the gaps between them will
be filled with check blocks. The decoding process will not modify the
already decoded data blocks, but will modify the check blocks.
That is, if you call this function with C<indices = [4,3,1]>, with
C<data_blocks = 3>, then this array will be returned: C<[0,2,1]>. This
means that input block C<0> corresponds to file block C<0>, input block
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
}
close FH or die "close($_[0]): $!";
}
END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
.
if (
eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
qq(
==> Should we try to re-execute the autoinstall process with 'sudo'?),
((-t STDIN) ? 'y' : 'n')
) =~ /^[Yy]/
)
{
# try to bootstrap ourselves from sudo
print << ".";
*** Trying to re-execute the autoinstall process with 'sudo'...
.
my $missing = join( ',', @Missing );
my $config = join( ',',
UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
view all matches for this distribution
view release on metacpan or search on metacpan
GDiffDelta.pm view on Meta::CPAN
There are several formats used for binary deltas. The one supported
by this module is the GDIFF format, which is fairly simple and is
documented as a W3C note (See the SEE ALSO section below).
This module generates and processes deltas using file handles.
It supports both native Perl file handles (created with the built-in
C<open> format) and objects that support the right methods.
For an object to work it must support at least the C<read>, C<seek>,
and C<tell> methods (if it is an input file) or the C<write> method
(if it is an output file). This allows strings to be used for input
view all matches for this distribution
view release on metacpan or search on metacpan
GooglePolylineEncoding.pm view on Meta::CPAN
$result |= ($b & 0x1f) << $shift;
$shift += 5;
}
# Continue while the read byte is >= 0x20 since the last
# `chunk` was not OR'd with 0x20 during the conversion
# process. (Signals the end)
while ($b >= 0x20);
use integer; # see last paragraph of "Integer Arithmetic" in perlop.pod
# Check if negative, and convert. (All negative values have the last bit
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Win32.pm view on Meta::CPAN
Please download the file manually, save it to a directory in %PATH% (e.g.
C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
that directory, and run "Nmake15.exe" from there; that will create the
'nmake.exe' file needed by this module.
You may then resume the installation process described in README.
-------------------------------------------------------------------------------
END_MESSAGE
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
#
# Perl.pm - Algorithm::Hamming::Perl library. Implements 8,4 bit Hamming ECC.
#
# This code will be unusual to read - instead of finding the Hamming
# algorithm you will see hash after hash after hash. These are used to
# improve the speed of the library, and act as a cache of preprocessed
# results. An optional subrourine may be run:
# Algorithm::Hamming::Perl::hamming_faster()
# which uses a bigger cache for faster encoding/decoding (but more memory
# and slower startups).
#
my %Hamming8raw; # This hash is used during initialisation only. It
# contains binary text keys and binary text values
# as [data] -> [Hamming code] lookups,
# eg "00001010" => "000001010010"
my %Hamming8semi; # This hash is semi-processed, and is used in "slow"
# encoding mode. It contains byte keys and binary
# text values as [data] -> [Hamming code] lookups,
# eg "A" => "010010000100"
my %Hamming8by2; # This hash is fully-processed and provides speed at
# the cost of memory. It contains 2 byte keys and
# 3 byte values as [data] -> [Hamming code] lookups,
# eg "AA" => "HD " # (whatever the code is!)
# By using this hash, the program can read an
# input stream 2 bytes at a time, writing an output
# stream 3 bytes at a time - no messing aroung
# with half bytes or byte boundaries.
my %Hamming8rev; # This hash is semi-processed, and is used for
# decoding Hamming code to data. It contains
# binary text values for keys and bytes for values
# as [Hamming code] -> [data] lookups,
# eg "010010000100" => "A"
my %Hamming8by2rev; # This hash is fully-processed and provides speed at
# the cost of memory. It contains 3 byte keys and
# 2 byte values as [Hamming code] -> [data] lookups,
# eg "HD " => "AA" # (whatever the code is!)
# By using this hash, the program can read an
# input stream 3 bytes at a time, writing an output
my ($x,$y,$key,$char,$char1,$char2,$chars,$char_out,$ham_text,$number);
#
# Hamming8raw is NOT the lookup table used! :)
# (that would be dreadfully inefficient).
# This hash is processed into a bytes -> bytes lookup.
#
%Hamming8raw = ("00000000" => "000000000000",
"00000001" => "000000000111",
"00000010" => "000000011001",
"00000011" => "000000011110",
=item Algorithm::Hamming::Perl::hamming_faster ()
This is an optional subroutine that will speed Hamming encoding if it is
run once at the start of the program. It does this by using a larger (hash)
cache of preprocessed results. The disadvantage is that it uses more memory,
and can add several seconds to invocation time. Only use this if you are
encoding more than 1 Mb of data.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
pregfree|||
prepend_madprops|||
prescan_version||5.011004|
printbuf|||
printf_nocontext|||vn
process_special_blocks|||
ptr_table_clear||5.009005|
ptr_table_fetch||5.009005|
ptr_table_find|||n
ptr_table_free||5.009005|
ptr_table_new||5.009005|
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
.
if (
eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
qq(
==> Should we try to re-execute the autoinstall process with 'sudo'?),
((-t STDIN) ? 'y' : 'n')
) =~ /^[Yy]/
)
{
# try to bootstrap ourselves from sudo
print << ".";
*** Trying to re-execute the autoinstall process with 'sudo'...
.
my $missing = join( ',', @Missing );
my $config = join( ',',
UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/KNN/XS.pm view on Meta::CPAN
=over 4
=item * $knn->set_annMaxPtsVisit( ... )
This class method sets the maximum number of points that the search methods
are going to process before they abort. They can return more points than the
set value because the abort condition is only checked before processing a
leaf node.
$knn->set_annMaxPtsVisit(
max_points => 5,
);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
}
close FH or die "close($_[0]): $!";
}
END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version ($) {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
view all matches for this distribution
view release on metacpan or search on metacpan
DOCUMENTATION
POD style documentation is included in ./lib/Algorithm/Knapsack.pm and
./bin/filesack. These are normally converted to manual pages and installed
as part of the "make install" process.
AUTHOR
Alexander Anderson <a.anderson@utoronto.ca>
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
.
if (
eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
qq(
==> Should we try to re-execute the autoinstall process with 'sudo'?),
((-t STDIN) ? 'y' : 'n')
) =~ /^[Yy]/
)
{
# try to bootstrap ourselves from sudo
print << ".";
*** Trying to re-execute the autoinstall process with 'sudo'...
.
my $missing = join( ',', @Missing );
my $config = join( ',',
UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/LatticePoints.pm view on Meta::CPAN
}
=head1 DESCRIPTION
Lattice-point handling is a common chore. You do it for image
processing, 3-d processing, and more. Usually you do it via nested
for loops but it is boring and tedious. This module loops for you
instead.
=head2 METHODS
=over 2
=item new(\&coderef)
Pass a coderef which processes each lattice point.
=item visit([$s1,$s2...$sn],[$e1,$e2...$en])
Runs the code for each latice point between
[$s1,$s2...$sn] and [$e1,$e2...$en], inclusive.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/LeakyBucket.pm view on Meta::CPAN
=head1 CONSTRUCTOR
There are two required options to get the module to do anything useful. C<ticks> and C<seconds> set the number of
ticks allowed per that time period. If C<ticks> is 3 and C<seconds> is 14, you will be able to run 3 ticks every 14
seconds. Optionally you can pass C<memcached_servers> and C<memcached_key> to distribute the limiting across multiple
processes.
my $bucket = Algorithm::LeakyBucket->new( ticks => $ticks, seconds => $every_x_seconds,
memcached_key => 'some_key',
memcached_servers => [ { address => 'localhost:11211' } ] );
=DESCRIPTION
Implements leaky bucket as a rate limiter. While the code will do rate limiting for a single process, it was intended
as a limiter for multiple processes. (But see the BUGS section)
The syntax of the C<memcached_servers> argument should be the syntax expected by the local memcache module. If
Cache::Memcached::Fast is installed, use its syntax, otherwise you can use the syntax for Cache::Memcached. If
neither module is found it will use a locally defined set of vars internally to track rate limiting. Obviously
this keeps the code from being used across processes.
This is an alpha version of the code. Some early bugs have been ironed out and its in produciton in places, so we would
probably transition it to beta once we have seen it work for a bit.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
src/liblinear.xs view on Meta::CPAN
const char *filename;
CODE:
if (save_model(filename, self) != 0) {
Perl_croak(
aTHX_
"Error occured during save process: %s",
errno == 0 ? "unknown error" : strerror(errno)
);
}
void
view all matches for this distribution
view release on metacpan or search on metacpan
PL_exitlistlen|5.005000||Viu
PL_expect||5.003007|ponu
PL_fdpid|5.005000||Viu
PL_filemode|5.005000||Viu
PL_firstgv|5.005000||Viu
PL_forkprocess|5.005000||Viu
PL_formtarget|5.005000||Viu
PL_GCB_invlist|5.021009||Viu
PL_generation|5.005000||Viu
PL_gensym|5.005000||Viu
PL_globalstash|5.005000||Viu
PRINTF_FORMAT_NULL_OK|5.009005|5.009005|Vn
printf_nocontext|5.007001||vdVnu
PRIVLIB|5.003007|5.003007|Vn
PRIVLIB_EXP|5.003007|5.003007|Vn
PRIVSHIFT|5.003007||Viu
process_special_blocks|5.009005||Viu
PROCSELFEXE_PATH|5.007003|5.007003|Vn
PRUNE|5.009005||Viu
PRUNE_t8|5.035004||Viu
PRUNE_t8_p8|5.033003||Viu
PRUNE_t8_pb|5.033003||Viu
# Here, we are in the middle of accumulating a hint or warning.
my $end_of_hint = 0;
# A line containing a comment end marker closes the hint. Remove that
# marker for processing below.
if (s/\s*$rcce(.*?)\s*$//) {
die "Nothing can follow the end of comment in '$_'\n" if length $1 > 0;
$end_of_hint = 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/LineSegments.pm view on Meta::CPAN
# instead the cost is re-computed here for now.
#################################################################
my $cost = $o{cost}->($ix, $next{$ix});
#################################################################
# The callback can be by calling code to stop the merging process
#################################################################
last unless $o{continue}->($count, $cost);
my $k = $ix;
my $j = $next{$k};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/LinearManifoldDataClusterer.pm view on Meta::CPAN
=head1 CHANGES
Version 1.01: Typos and other errors removed in the documentation. Also included in
the documentation a link to a tutorial on data processing on manifolds.
=head1 DESCRIPTION
If you are new to machine learning and data clustering on linear and nonlinear
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/Loops.pm view on Meta::CPAN
use Algorithm::Loops qw( Filter );
@copy = Filter { s/\\(.)/$1/g } @list;
$text = Filter { s/^\s+// } @lines;
The same process can be accomplished using a careful and more complex
invocation of map, grep, or foreach. However, many incorrect ways to
attempt this seem rather seductively appropriate so this function helps
to discourage such (rather common) mistakes.
=head3 Usage
lib/Algorithm/Loops.pm view on Meta::CPAN
The MapCar* functions are all like C<map> except they each loop over more
than one list at the same time.
[ The name "mapcar" comes from LISP. As I understand it, 'car' comes from
the acronym for a register of the processor where LISP was first
developed, one of two registers used to implement lists in LISP. I only
mention this so you won't waste too much time trying to figure out what
"mapcar" is supposed to mean. ]
The MapCar* functions all have prototype specifications of (\&@).
lib/Algorithm/Loops.pm view on Meta::CPAN
corresponding order). Any value(s) returned by your subroutine are
pushed onto an array that will eventually be returned by MapCar*.
Next your subroutine is called and is passed the B<second> element of
each of the arrays and any value(s) returned are pushed onto the results
array. Then the process is repeated with the B<third> elements.
This continues until your subroutine has been passed all elements [except
for some cases with MapCarMin()]. If the longest array whose reference
you passed to MapCar() or MapCarU() contained $N elements, then your
subroutine would get called $N times.
lib/Algorithm/Loops.pm view on Meta::CPAN
Some permutation generators return the full set of all permutations (as a
huge list of lists). Your input list doesn't have to be very big at all
for the resulting set to be too large to fit in your available memory.
So the NextPermute* routines return each permutation, one at a time, so
you can process them all (eventually) without the need for lots of memory.
A programming object that gives you access to things one-at-a-time is
called an "iterator".
=item No context - Hardly any memory required
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/MCL.pm view on Meta::CPAN
easy integration MCL in perl scripts and modules. Algorithm::MCL accept references as input and every reference will be found later in some cluster.
=item *
performance and scale. Algorithm::MCL use Perl Data Language for most of its processing and should run very fast on very big clusters. Main Algorithm::MCL procedures are written with "pdlpp".
=back
=head1 METHODS
=head2 new()
create new Algorithm::MCL object that accumulate graph edges and process data.
=head2 addEdge($ref1, $ref2, $distance)
add new edge to graph. first two parameters are reference to vertex objects. third parameter is "connection strength measurement" between vetices. "connection strength measurement" should be number between 0 and 1, higher number means stronger connec...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/MLCS.pm view on Meta::CPAN
wantarray ? @lcs : scalar @lcs;
}
# Auxiliary function that gets single sequence arrayref and
# build specific data structure for further processing
# in order to find LCS
sub _build_seq {
my ( $seq, %dict, @seq_st ) = @_;
for ( 0 .. $#{$seq} ) { push @{ $dict{ $seq->[$_] } }, $_ }
view all matches for this distribution
view release on metacpan or search on metacpan
t/12_evo_mm.t
app/mm-eda.cgi
app/run_experiment.pl
app/run_experiment_all.pl
app/evorank.yaml
app/process_experiment.pl
META.yml Module meta-data (added by MakeMaker)
view all matches for this distribution
view release on metacpan or search on metacpan
pregfree|||
prepend_elem|||
prepend_madprops|||
printbuf|||
printf_nocontext|||vn
process_special_blocks|||
ptr_table_clear||5.009005|
ptr_table_fetch||5.009005|
ptr_table_find|||n
ptr_table_free||5.009005|
ptr_table_new||5.009005|
view all matches for this distribution
view release on metacpan or search on metacpan
0.03 - 22 Apr 2003
Fixed some bugs in the traverse_sequences3, diff3, and merge routines.
merge: properly manage conflicts that remain after processing the
diff3 results
traverse_sequences3: defined some more states in the Callback Map.
diff3: handle some sequence differences better
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/MinPerfHashTwoLevel.pm view on Meta::CPAN
used is SipHash 1-3. The full 64 bit hash is called h0, the high 32 bits are
called h1, and the low 32 bits are called h2.)
Computing the hash and mask is done in C (via XS).
The process for looking up a value in a two level hash with n buckets is
as follows:
0. compute the h0 for the key. (giving: h1 = h0 >> 32; h2 = h0 & 0xFFFFFFFF;)
1. compute idx1 = h1 % n;
2. find the xor_val for bucket[idx1]
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/NGram.pm view on Meta::CPAN
=cut
=item add_text
Splits a block of text up by whitespace and processes each word as a
token. Automatically calls C<add_start_token()> at the beginning of
the text and C<add_end_token()> at the end.
=cut
# process a block of text, auto-tokenizing it
sub add_text {
my ($self, $text) = @_;
$self->add_start_token;
view all matches for this distribution