Algorithm-GaussianElimination-GF2

 view release on metacpan or  search on metacpan

lib/Algorithm/GaussianElimination/GF2.pm  view on Meta::CPAN

=head2 Algorithm::GaussianElimination::GF2 methods

Those are the interesting methods:

=over 4

=item $age = Algorithm::GaussianElimination::GF2->new;

=item $eq = $age->new_equation(@a, $b)

=item $eq = $age->new_equation()

Creates and adds a new equation to the algorithm.

The returned value is a reference to the equation object that can be
used to change the equation coeficients before calling the C<solve>
method.

=item ($sol, @base0) = $age->solve

=item $sol = $age->solve

This method solves the system of equations.

When the system is inconsistent it returns an empty list.

When the system is consistent and uniquely determined it returns the
solution as an array reference.

When the system is consistent and underdetermined it returns one
solution as an array reference and a base of the vector space formed
by the solutions of the homogeneous system. In scalar context, only
the solution vector is returned.

=back

=head2 Algorithm::GaussianElimination::GF2::Equation methods

Those are the methods available to manipulate the equation objects:

=over 4

=item $a = $eq->a($ix)

=item $eq->a($ix, $a)

Retrieves or sets the value of the equation coeficient at the given
index.

=item $b = $eq->b

=item $eq->b($b)

Retrieves or sets the value of the constant term of the equation.

=item $eq->len

Returns the internal length of the coeficients vector.

Note that this value is just a hint as the internal representation
grows transparently when new coeficients are set or inside the
C<solve> method.

=back

=head1 SEE ALSO

The Wikipedia page about systems of linear equations:
L<http://en.wikipedia.org/wiki/System_of_linear_equations>.

The Wikipedia page about the Galois Field of two elements GF(2):
L<http://en.wikipedia.org/wiki/GF%282%29>.

The Wikipedia page about the Gaussian Elimination algorithm:
L<http://en.wikipedia.org/wiki/Gaussian_elimination>.

The inception of this module lays on this PerlMonks post:
L<http://perlmonks.org/?node_id=940327>.

L<Math::FastGF2> implements a much richer and faster set of operations
for GF(2).

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2011, 2012 by Salvador FandiE<ntilde>o (sfandino@yahoo.com)

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.14.2 or,
at your option, any later version of Perl 5 you may have available.

=cut



( run in 0.432 second using v1.01-cache-2.11-cpan-d0baa829c65 )