| Text-NASA_Ames documentation | Contained in the Text-NASA_Ames distribution. |
Text::NASA_Ames::DataEntry - The simples NASA_Ames data-presentation
my $de = new Text::NASA_Ames::DataEntry({X => [1,2,3],
V => [3.3,3],
A => [1.4, "S"]});
my @x = @{ $de->X };
my @a = @{ $de->A };
my @v = @{ $de->V };
A dataentry consists of the independent variables X, the auxiliary variables A, and the primary dependent variables V.
all methods return list-references
set the data
get a list of the independent variable per point
get a list of the primary dependent variables for point X
get a list of the auxiliary variables for point X
| Text-NASA_Ames documentation | Contained in the Text-NASA_Ames distribution. |
package Pure::Text::NASA_Ames::DataEntry; use base qw(Class::Accessor); Pure::Text::NASA_Ames::DataEntry->mk_accessors(qw(A X V)); package Text::NASA_Ames::DataEntry; use base qw(Pure::Text::NASA_Ames::DataEntry); use Carp (); use 5.00600; use strict; sub _carp { return Carp::carp(@_); } our $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf " %d." . "%02d" x $#r, @r };
sub new { my ($class, $dataRef) = @_; $class = ref $class || $class; my $self = { X => [], A => [], V => [] }; if (ref $dataRef && (ref $dataRef eq 'HASH')) { foreach my $item (keys %$self) { if (exists $dataRef->{$item}) { if (ref $dataRef->{$item} eq 'ARRAY') { $self->{$item} = $dataRef->{$item}; } else { _carp "$item not a ArrayRef, got item:". $dataRef->{$item}; } } } } else { _carp "new need a hash as argument, got $dataRef"; } return bless $self, $class; }
1; __END__