Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Perl Data Language
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Array programming library for Perl}} {{Infobox programming language | name = Perl Data Language (PDL) | paradigm = [[Array programming|Array]] | released = {{Start date|1996}} | developer = [[Karl Glazebrook]], [[Jarle Brinchmann]], [[Tuomas Lukka]], and [[Christian Soeller]] | latest release version = {{wikidata|property|edit|reference|P348}} | latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}} | influenced by = [[APL (programming language)|APL]], [[IDL (programming language)|IDL]], [[Perl]] | operating_system = [[Cross-platform]] | license = [[GNU General Public License]], [[Artistic License]] | website = {{URL|https://pdl.perl.org/}} }} '''Perl Data Language''' (abbreviated '''PDL''') is a set of [[free software]] array programming extensions to the [[Perl|Perl programming language]]. PDL extends the data structures built into Perl, to include large [[Array data structure|multidimensional arrays]], and adds functionality to manipulate those arrays as vector objects. It also provides tools for [[image processing]], [[machine learning]], [[computer model]]ing of physical systems, and graphical plotting and presentation. Simple operations are automatically vectorized across complete arrays, and higher-dimensional operations (such as matrix multiplication) are supported. ==Language design== PDL is a vectorized [[array programming]] language: the expression syntax is a variation on standard mathematical [[Vector (geometric)|vector]] notation, so that the user can combine and operate on large arrays with simple expressions. In this respect, PDL follows in the footsteps of the [[APL programming language]], and it has been compared to commercial languages such as [[MATLAB]] and [[Interactive Data Language]], and to other free languages such as [[NumPy]] and [[GNU Octave#Octave.2C the language|Octave]].<ref>{{Cite web|url=http://blogs.perl.org/users/lhermida/2011/03/hi-everyone-as-a-bioinformatician.html|title=Putting Perl Back on Top in the Fields of Scientific and Financial Computing}}</ref> Unlike MATLAB and IDL, PDL allows great flexibility in indexing and vectorization: for example, if a subroutine normally operates on a 2-D [[matrix (mathematics)|matrix]] array, passing it a 3-D [[data cube]] will generally cause the same operation to happen to each 2-D layer of the cube.<ref>{{Cite web|url=http://pdl.perl.org/?docs=Threading&title=PDL::Threading|title=PDL online documentation (PDL::Threading section)}}</ref> PDL borrows from Perl at least three basic types of program structure: [[imperative programming]], [[functional programming]], and [[pipeline programming]] forms may be combined. Subroutines may be loaded either via a built-in [[autoload]] mechanism or via the usual Perl module mechanism. ==Graphics== [[Image:Pdl-plot.png|thumb|200px|right|A plot generated using PDL]] True to the [[glue language]] roots of Perl, PDL borrows from several different modules for graphics and plotting support. [[NetPBM]] provides image file I/O (though FITS is supported natively). [[Gnuplot]], [[PLplot]], [[PGPLOT]], and [[Prima (graphics software)|Prima]] modules are supported for 2-D graphics and plotting applications, and [[Gnuplot]] and [[OpenGL]] are supported for 3-D plotting and rendering. ==I/O== PDL provides facilities to read and write many open data formats, including [[JPEG]], [[Portable Network Graphics|PNG]], [[GIF]], [[portable pixmap|PPM]], [[MPEG]], [[FITS]], [[NetCDF]], [[GRIB]], raw binary files, and delimited ASCII tables. PDL programmers can use the [[CPAN]] Perl I/O libraries to read and write data in hundreds of standard and niche file formats. ==Machine learning== PDL can be used for [[machine learning]]. It includes modules that are used to perform classic [[k-means clustering]] or general and generalized linear modeling methods such as ANOVA, linear regression, PCA, and logistic regression. Examples of PDL usage for regression modelling tasks include evaluating association between education attainment and ancestry differences of parents,<ref name="pmid25734509">{{cite journal | vauthors = Abdellaoui A, Hottenga JJ, Willemsen G, Bartels M, van Beijsterveldt T, Ehli EA, Davies GE, Brooks A, Sullivan PF, Penninx BW, de Geus EJ, Boomsma DI | title = Educational Attainment Influences Levels of Homozygosity through Migration and Assortative Mating | journal = PLOS ONE | volume = 10 | issue = 3 | pages = e0118935 | date = Mar 2015 | pmid = 25734509 | pmc = 4347978 | doi = 10.1371/journal.pone.0118935 | bibcode = 2015PLoSO..1018935A | doi-access = free }}</ref> comparison of RNA-protein interaction profiles that needs regression-based normalization<ref name="pmid24398258">{{cite journal | vauthors = Wang T, Xie Y, Xiao G | title = dCLIP: a computational approach for comparative CLIP-seq analyses | journal = Genome Biology | volume = 15 | issue = 1 | pages = R11 | date = Jan 2014 | pmid = 24398258 | pmc = 4054096 | doi = 10.1186/gb-2014-15-1-r11 | doi-access = free }}</ref> and analysis of spectra of galaxies.<ref>{{cite journal | vauthors = Sánchez SF, Pérez E, Sánchez-Blázquez P, González JJ, Rosález-Ortega FF, Cano-Dí az M, López-Cobá C, Marino RA, Gil de Paz A, Mollá M, López-Sánchez AR, Ascasibar Y, Barrera-Ballesteros J | title = Pipe3D, a pipeline to analyze Integral Field Spectroscopy Data: I. New fitting philosophy of FIT3D | journal = Revista Mexicana de Astronomía y Astrofísica | volume = 52 | pages = 21–53 | date = April 2016 | arxiv = 1509.08552 | bibcode = 2016RMxAA..52...21S }}</ref> ==perldl== An installation of PDL usually comes with an interactive [[Shell (computing)|shell]] known as '''perldl''', which can be used to perform simple calculations without requiring the user to create a Perl program file. A typical session of perldl would look something like the following: <syntaxhighlight lang="perl"> perldl> $x = pdl [[1, 2], [3, 4]]; perldl> $y = pdl [[5, 6, 7],[8, 9, 0]]; perldl> $z = $x x $y; perldl> p $z; [ [21 24 7] [47 54 21] ] </syntaxhighlight> The commands used in the shell are Perl statements that can be used in a program with <code>PDL</code> module included. '''<code>x</code>''' is an [[overloaded operator]] for [[matrix multiplication]], and '''<code>p</code>''' in the last command is a shortcut for '''<code>print</code>'''. ==Implementation== The core of PDL is written in [[C (programming language)|C]]. Most of the functionality is written in '''PP''', a PDL-specific metalanguage that handles the vectorization of simple C snippets and interfaces them with the Perl host language via Perl's [[XS (Perl)|XS]] compiler. Some modules are written in [[Fortran]], with a C/PP interface layer. Many of the supplied functions are written in PDL itself. PP is available to the user to write C-language extensions to PDL. There is also an Inline module (Inline::Pdlpp) that allows PP function definitions to be inserted directly into a Perl script; the relevant code is low-level compiled and made available as a Perl subroutine. The PDL API uses the basic Perl 5 object-oriented functionality: PDL defines a new type of Perl scalar object ([[eponym]]ously called a "PDL", or "ndarray") that acts as a Perl scalar, but that contains a conventional [[data type|typed]] [[Array data type|array]] of numeric or character values. All of the standard Perl operators are overloaded so that they can be used on PDL objects transparently, and PDLs can be mixed-and-matched with normal Perl scalars. Several hundred object methods for operating on PDLs are supplied by the core modules. ==See also== {{Portal|Free and open-source software}} * [[Comparison of numerical-analysis software]] * [[List of numerical-analysis software]] ==References== {{Reflist}} ==External links== * {{Official website|http://pdl.perl.org/}} * [http://www.perlmonks.org/?node_id=587436 PDL Quick Reference] PDL Intro & resources * [https://www.youtube.com/watch?v=rf1yfZ2yUFo Tutorial lecture on PDL] * [http://sourceforge.net/projects/pdl/files/PDL_2013/PDL-Book/PDL-Book-20130322.pdf/download Draft release of the PDL Book for PDL-2.006] * [http://adsabs.harvard.edu/abs/2004SoPh..219....3D Example of PDL usage in the scientific literature] [[Category:Array programming languages]] [[Category:Free mathematics software]] [[Category:Free science software]] [[Category:Numerical programming languages]] [[Category:Perl modules]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Official website
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)