line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pure::Text::NASA_Ames::DataEntry; |
2
|
10
|
|
|
10
|
|
38383
|
use base qw(Class::Accessor); |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
2326
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
Pure::Text::NASA_Ames::DataEntry->mk_accessors(qw(A X V)); |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Text::NASA_Ames::DataEntry; |
7
|
10
|
|
|
10
|
|
2566
|
use base qw(Pure::Text::NASA_Ames::DataEntry); |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
7600
|
|
8
|
10
|
|
|
10
|
|
69
|
use Carp (); |
|
10
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
530
|
|
9
|
|
|
|
|
|
|
|
10
|
10
|
|
|
10
|
|
259
|
use 5.00600; |
|
10
|
|
|
|
|
33
|
|
|
10
|
|
|
|
|
424
|
|
11
|
10
|
|
|
10
|
|
50
|
use strict; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
5050
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _carp { |
14
|
0
|
|
|
0
|
|
0
|
return Carp::carp(@_); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf " %d." . "%02d" x $#r, @r }; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 NAME |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Text::NASA_Ames::DataEntry - The simples NASA_Ames data-presentation |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $de = new Text::NASA_Ames::DataEntry({X => [1,2,3], |
28
|
|
|
|
|
|
|
V => [3.3,3], |
29
|
|
|
|
|
|
|
A => [1.4, "S"]}); |
30
|
|
|
|
|
|
|
my @x = @{ $de->X }; |
31
|
|
|
|
|
|
|
my @a = @{ $de->A }; |
32
|
|
|
|
|
|
|
my @v = @{ $de->V }; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 DESCRIPTION |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
A dataentry consists of the independent variables X, the auxiliary |
37
|
|
|
|
|
|
|
variables A, and the primary dependent variables V. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 PUBLIC METHODS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
all methods return list-references |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=over 4 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item new ({X => [X1...Xs], A => [A1...Ak], V => [V1..Vn]}) |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
set the data |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub new { |
52
|
809
|
|
|
809
|
1
|
10736
|
my ($class, $dataRef) = @_; |
53
|
809
|
|
33
|
|
|
3065
|
$class = ref $class || $class; |
54
|
809
|
|
|
|
|
7791
|
my $self = { X => [], |
55
|
|
|
|
|
|
|
A => [], |
56
|
|
|
|
|
|
|
V => [] }; |
57
|
809
|
50
|
33
|
|
|
4387
|
if (ref $dataRef && (ref $dataRef eq 'HASH')) { |
58
|
809
|
|
|
|
|
2606
|
foreach my $item (keys %$self) { |
59
|
2427
|
100
|
|
|
|
5752
|
if (exists $dataRef->{$item}) { |
60
|
2373
|
50
|
|
|
|
4440
|
if (ref $dataRef->{$item} eq 'ARRAY') { |
61
|
2373
|
|
|
|
|
5472
|
$self->{$item} = $dataRef->{$item}; |
62
|
|
|
|
|
|
|
} else { |
63
|
0
|
|
|
|
|
0
|
_carp "$item not a ArrayRef, got item:". |
64
|
|
|
|
|
|
|
$dataRef->{$item}; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
} else { |
69
|
0
|
|
|
|
|
0
|
_carp "new need a hash as argument, got $dataRef"; |
70
|
|
|
|
|
|
|
} |
71
|
809
|
|
|
|
|
5939
|
return bless $self, $class; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item X |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
get a list of the independent variable per point |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item V |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
get a list of the primary dependent variables for point X |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item A |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
get a list of the auxiliary variables for point X |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=back |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
__END__ |