File Coverage

blib/lib/Math/LP/Variable.pm
Criterion Covered Total %
statement 12 17 70.5
branch 0 4 0.0
condition 0 2 0.0
subroutine 4 5 80.0
pod 0 1 0.0
total 16 29 55.1


line stmt bran cond sub pod time code
1             package Math::LP::Variable;
2 4     4   23 use strict;
  4         10  
  4         162  
3             #use Math::LP::Object;
4 4     4   9422 use Math::SimpleVariable;
  4         2734  
  4         146  
5 4     4   52 use base qw(Math::SimpleVariable);
  4         9  
  4         717  
6             use fields(
7 4         19 'is_int', # flags whether it is an integer variable, defaults to false
8             'upper_bound', # defaults to +infinity
9             'lower_bound', # defaults to 0, as is the convention in linear programming
10             'col_index', # column index in an LP, used by the Math::LP functions
11 4     4   20 );
  4         8  
12              
13             sub initialize {
14 0     0 0   my Math::LP::Variable $this = shift;
15 0   0       $this->{is_int} ||= 0;
16 0 0         $this->{upper_bound} = $Math::LP::Solve::DEF_INFINITE
17             unless defined($this->{upper_bound});
18 0 0         $this->{lower_bound} = 0
19             unless defined($this->{lower_bound});
20 0           $this->SUPER::initialize();
21             }
22              
23             1;
24              
25             __END__