File Coverage

blib/lib/PDLA.pm
Criterion Covered Total %
statement 48 54 88.8
branch 1 4 25.0
condition n/a
subroutine 16 19 84.2
pod 0 2 0.0
total 65 79 82.2


line stmt bran cond sub pod time code
1             package PDLA;
2              
3             =head1 NAME
4              
5             PDLA - the Perl Data Language
6              
7             =head1 DESCRIPTION
8              
9             (For the exported PDLA constructor, pdl(), see L)
10              
11             PDLA is the Perl Data Language, a perl extension that is designed for
12             scientific and bulk numeric data processing and display. It extends
13             perl's syntax and includes fully vectorized, multidimensional array
14             handling, plus several paths for device-independent graphics output.
15              
16             PDLA is fast, comparable and often outperforming IDL and MATLAB in real
17             world applications. PDLA allows large N-dimensional data sets such as large
18             images, spectra, etc to be stored efficiently and manipulated quickly.
19              
20              
21             =head1 VECTORIZATION
22              
23             For a description of the vectorization (also called "threading"), see
24             L.
25              
26              
27             =head1 INTERACTIVE SHELL
28              
29             The PDLA package includes an interactive shell. You can learn about it,
30             run C, or run the shell C or C and type
31             C.
32              
33             =head1 LOOKING FOR A FUNCTION?
34              
35             If you want to search for a function name, you should use the PDLA
36             shell along with the "help" or "apropos" command (to do a fuzzy search).
37             For example:
38              
39             pdla> apropos xval
40             xlinvals X axis values between endpoints (see xvals).
41             xlogvals X axis values logarithmicly spaced...
42             xvals Fills a piddle with X index values...
43             yvals Fills a piddle with Y index values. See the CAVEAT for xvals.
44             zvals Fills a piddle with Z index values. See the CAVEAT for xvals.
45              
46             To learn more about the PDLA shell, see L or L.
47              
48             =head1 LANGUAGE DOCUMENTATION
49              
50             Most PDLA documentation describes the language features. The number of
51             PDLA pages is too great to list here. The following pages offer some
52             guidance to help you find the documentation you need.
53              
54              
55             =over 5
56              
57             =item L
58              
59             Frequently asked questions about PDLA. This page covers a lot of
60             questions that do not fall neatly into any of the documentation
61             categories.
62              
63             =item L
64              
65             A guide to PDLA's tutorial-style documentation. With topics from beginner
66             to advanced, these pages teach you various aspects of PDLA step by step.
67              
68             =item L
69              
70             A guide to PDLA's module reference. Modules are organized by level
71             (foundation to advanced) and by category (graphics, numerical methods,
72             etc) to help you find the module you need as quickly as possible.
73              
74             =item L
75              
76             This page compiles PDLA's tutorial and reference pages into a comprehensive
77             course that takes you from a complete beginner level to expert.
78              
79             =item L
80              
81             List of all available documentation, sorted alphabetically. If you
82             cannot find what you are looking for, try here.
83              
84             =back
85              
86              
87             =head1 MODULES
88              
89             PDLA includes about a dozen perl modules that form the core of the
90             language, plus additional modules that add further functionality.
91             The perl module "PDLA" loads all of the core modules automatically,
92             making their functions available in the current perl namespace.
93             Some notes:
94              
95             =over 5
96              
97             =item Modules loaded by default
98              
99             See the SYNOPSIS section at the end of this document for a list of
100             modules loaded by default.
101              
102             =item L and L
103              
104             These are lighter-weight alternatives to the standard PDLA module.
105             Consider using these modules if startup time becomes an issue.
106              
107             =item Exports
108              
109             C exports a large number of routines into the calling
110             namespace. If you want to avoid namespace pollution, you must instead
111             C, and include any additional modules explicitly.
112              
113             =item L
114              
115             Note that the L syntax is NOT automatically
116             loaded by C. If you want to use the extended slicing syntax in
117             a standalone script, you must also say C.
118              
119             =item L
120              
121             The L module has been added to the list of modules
122             for versions later than 2.3.1. Note that PDLA::Math is still
123             I included in the L and L
124             start-up modules.
125              
126             =back
127              
128             =head1 SYNOPSIS
129              
130             use PDLA; # Is equivalent to the following:
131              
132             use PDLA::Core;
133             use PDLA::Ops;
134             use PDLA::Primitive;
135             use PDLA::Ufunc;
136             use PDLA::Basic;
137             use PDLA::Slices;
138             use PDLA::Bad;
139             use PDLA::MatrixOps;
140             use PDLA::Math;
141             use PDLA::Version;
142             use PDLA::IO::Misc;
143             use PDLA::IO::FITS;
144             use PDLA::IO::Pic;
145             use PDLA::IO::Storable;
146             use PDLA::Lvalue;
147              
148             =cut
149              
150             our $VERSION = "2.019106";
151              
152             # Main loader of standard PDLA package
153              
154             sub PDLA::import {
155              
156 13     13   108 my $pkg = (caller())[0];
157 13     13   7848 eval <<"EOD";
  13     13   73  
  13     13   124  
  13     13   5485  
  13     13   36  
  13     13   108  
  13     13   7123  
  13     13   45  
  13     13   111  
  13     13   6935  
  13     13   67  
  13     13   95  
  13     13   5110  
  13     13   44  
  13     13   105  
  13         99  
  13         28  
  13         95  
  13         5607  
  13         41  
  13         209  
  13         90  
  13         26  
  13         83  
  13         84  
  13         30  
  13         78  
  13         6631  
  13         34  
  13         376  
  13         6352  
  13         40  
  13         102  
  13         7554  
  13         47  
  13         150  
  13         6457  
  13         46  
  13         111  
  13         88  
  13         26  
  13         360  
  13         5116  
  13         46  
  13         90  
  13         792  
158              
159             package $pkg;
160              
161             # Load the fundamental packages
162              
163             use PDLA::Core;
164             use PDLA::Ops;
165             use PDLA::Primitive;
166             use PDLA::Ufunc;
167             use PDLA::Basic;
168             use PDLA::Slices;
169             use PDLA::Bad;
170             use PDLA::Math;
171             use PDLA::MatrixOps;
172             use PDLA::Lvalue;
173              
174             # Load these for TPJ compatibility
175              
176             use PDLA::IO::Misc; # Misc IO (Ascii)
177             use PDLA::IO::FITS; # FITS IO (rfits/wfits; used by rpic/wpic too)
178             use PDLA::IO::Pic; # rpic/wpic
179              
180             # Load this so config/install info is available
181              
182             use PDLA::Config;
183              
184             # Load this to avoid mysterious Storable segfaults
185              
186             use PDLA::IO::Storable;
187              
188             EOD
189              
190 13 50       4061 die $@ if $@;
191              
192             }
193              
194             # support: use Inline with => 'PDLA';
195             # Returns a hash containing parameters accepted by recent versions of
196             # Inline, to tweak compilation. Not normally called by anyone but
197             # the Inline API.
198             #
199             # If you're trying to debug the actual code, you're looking for "IFiles.pm"
200             # which is currently in the Core directory. --CED 23-Feb-2015
201             sub Inline {
202 0     0 0   require PDLA::Install::Files;
203 0           goto &PDLA::Install::Files::Inline;
204             }
205              
206             ##################################################
207             # Rudimentary handling for multiple Perl threads #
208             ##################################################
209             my $clone_skip_should_be_quiet = 0;
210             sub CLONE_SKIP {
211 0 0   0     warn("* If you need to share PDLA data across threads, use memory mapped data, or\n"
212             . "* check out PDLA::Parallel::threads, available on CPAN.\n"
213             . "* You can silence this warning by saying `PDLA::no_clone_skip_warning;'\n"
214             . "* before you create your first thread.\n")
215             unless $clone_skip_should_be_quiet;
216 0           PDLA::no_clone_skip_warning();
217             # Whether we warned or not, always return 1 to tell Perl not to clone PDLA data
218 0           return 1;
219             }
220             sub no_clone_skip_warning {
221 0     0 0   $clone_skip_should_be_quiet = 1;
222             }
223              
224             # Exit with OK status
225             1;