Algorithm-Simplex

 view release on metacpan or  search on metacpan

lib/Algorithm/Simplex/Float.pm  view on Meta::CPAN

    # TODO: Confirm whether clear is needed or not. Appears not in testing.
    # $self->clear_display_tableau;
    $self->number_of_pivots_made($self->number_of_pivots_made + 1);
    return;
};

=head2 is_optimal

Check the basement row to see if any positive entries exist.  Existence of
a positive entry means the solution is sub-optimal and optimal otherwise.
This is how we decide when to stop the algorithm.

Use EPSILON instead of zero because we're dealing with floats (imperfect numbers).

=cut

sub is_optimal {
    my $self = shift;

    for my $j (0 .. $self->number_of_columns - 1) {
        if ($self->tableau->[ $self->number_of_rows ]->[$j] > $self->EPSILON) {



( run in 1.249 second using v1.01-cache-2.11-cpan-de7293f3b23 )