line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Algorithm::BIT::XS; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
14819
|
use 5.014000; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
137
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.003'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require XSLoader; |
10
|
|
|
|
|
|
|
XSLoader::load('Algorithm::BIT::XS', $VERSION); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
1
|
|
|
1
|
1
|
10
|
my ($class, $len) = @_; |
14
|
1
|
|
|
|
|
10
|
create($len); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get { |
18
|
4
|
|
|
4
|
1
|
3772
|
my ($b, $idx) = @_; |
19
|
4
|
|
|
|
|
24
|
$b->query($idx) - $b->query($idx - 1); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub set { |
23
|
2
|
|
|
2
|
1
|
6
|
my ($b, $idx, $value) = @_; |
24
|
2
|
|
|
|
|
5
|
$b->update($idx, $value - $b->get($idx)) |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
__END__ |