line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Math::GrahamFunction::SqFacts::Dipole; |
2
|
|
|
|
|
|
|
$Math::GrahamFunction::SqFacts::Dipole::VERSION = '0.02003'; |
3
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
61
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
13
|
use base qw(Math::GrahamFunction::SqFacts); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
259
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
13
|
use List::Util (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
767
|
|
10
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(result compose)); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _initialize |
13
|
|
|
|
|
|
|
{ |
14
|
791
|
|
|
791
|
|
1249
|
my $self = shift; |
15
|
791
|
|
|
|
|
1236
|
my $args = shift; |
16
|
|
|
|
|
|
|
|
17
|
791
|
|
|
|
|
2068
|
$self->result( $args->{result} ); |
18
|
791
|
|
|
|
|
8345
|
$self->compose( $args->{compose} ); |
19
|
|
|
|
|
|
|
|
20
|
791
|
|
|
|
|
7525
|
return 0; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub clone |
25
|
|
|
|
|
|
|
{ |
26
|
46
|
|
|
46
|
1
|
407
|
my $self = shift; |
27
|
46
|
|
|
|
|
107
|
return __PACKAGE__->new( |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'result' => $self->result()->clone(), |
30
|
|
|
|
|
|
|
'compose' => $self->compose()->clone(), |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub mult_by |
37
|
|
|
|
|
|
|
{ |
38
|
976
|
|
|
976
|
1
|
10090
|
my $n_ref = shift; |
39
|
976
|
|
|
|
|
1384
|
my $m_ref = shift; |
40
|
|
|
|
|
|
|
|
41
|
976
|
|
|
|
|
1829
|
$n_ref->result()->mult_by( $m_ref->result() ); |
42
|
976
|
|
|
|
|
2091
|
$n_ref->compose()->mult_by( $m_ref->compose() ); |
43
|
|
|
|
|
|
|
|
44
|
976
|
|
|
|
|
2333
|
return 0; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub is_square |
49
|
|
|
|
|
|
|
{ |
50
|
1364
|
|
|
1364
|
1
|
7665
|
my $self = shift; |
51
|
1364
|
|
|
|
|
2788
|
return $self->result()->is_square(); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub exists |
56
|
|
|
|
|
|
|
{ |
57
|
1850
|
|
|
1850
|
1
|
16969
|
my ( $self, $factor ) = @_; |
58
|
|
|
|
|
|
|
|
59
|
1850
|
|
|
|
|
3683
|
return $self->result()->exists($factor); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub first |
64
|
|
|
|
|
|
|
{ |
65
|
600
|
|
|
600
|
1
|
6265
|
my $self = shift; |
66
|
|
|
|
|
|
|
|
67
|
600
|
|
|
|
|
1117
|
return $self->result()->first(); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub factors |
72
|
|
|
|
|
|
|
{ |
73
|
580
|
|
|
580
|
1
|
1364
|
my $self = shift; |
74
|
|
|
|
|
|
|
|
75
|
580
|
|
|
|
|
1169
|
return $self->result->factors(); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub _get_ret |
79
|
|
|
|
|
|
|
{ |
80
|
56
|
|
|
56
|
|
546
|
my $self = shift; |
81
|
|
|
|
|
|
|
|
82
|
56
|
|
|
|
|
95
|
return [ @{ $self->compose->factors() } ]; |
|
56
|
|
|
|
|
102
|
|
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__END__ |