blib/lib/Algorithm/DimReduction/Result.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 6 | 15 | 40.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 2 | 4 | 50.0 |
pod | 2 | 2 | 100.0 |
total | 10 | 21 | 47.6 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Algorithm::DimReduction::Result; | ||||||
2 | 2 | 2 | 10 | use strict; | |||
2 | 4 | ||||||
2 | 67 | ||||||
3 | 2 | 2 | 11 | use warnings; | |||
2 | 2 | ||||||
2 | 377 | ||||||
4 | |||||||
5 | sub new { | ||||||
6 | 0 | 0 | 1 | my $class = shift; | |||
7 | 0 | my %args = @_; | |||||
8 | 0 | return bless { %args }, $class; | |||||
9 | } | ||||||
10 | |||||||
11 | sub contribution_rate { | ||||||
12 | 0 | 0 | 1 | my $self = shift; | |||
13 | 0 | my $eigens = $self->{eigens}; | |||||
14 | 0 | my @rate; | |||||
15 | 0 | for my $i( 1 .. @$eigens){ | |||||
16 | 0 | push @rate, {reduct_to => $i, rate => $eigens->[$i-1] }; | |||||
17 | } | ||||||
18 | 0 | return \@rate; | |||||
19 | } | ||||||
20 | |||||||
21 | 1; | ||||||
22 | __END__ |