File Coverage

blib/lib/PDLA.pm
Criterion Covered Total %
statement 4 12 33.3
branch 1 4 25.0
condition n/a
subroutine 2 5 40.0
pod 0 2 0.0
total 7 23 30.4


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