COURSE(1p)
๐ COURSE(1p) โ PDL::Course ๐
โจ NAME โจ
PDL::Course - A journey through PDL's documentation, from beginner to advanced. It's giving whole-course energy, bestie. ๐ฆ
๐ AUTHOR, DATE ๐
This is written by David Mertens with edits by Daniel Carrera. ๐
๐ธ Preface ๐ธ
Okay so PDL's documentation is extensive. Some sections cover deep core magic while others cover more usual topics like IO and numerical computation. How are these related? Where should you begin? ๐ญ
This document is an attempt to pull all the key PDL documentation together in a coherent study course, starting from the beginner level, up to the expert. Periodt. โจ
I've broken down everything by level of expertise, and within expertise I've covered documentation, library, and workflow modules. The documentation modules are useful for what they tell you; the library modules are useful for the functions that they define for you; the workflow modules are useful for the way that they allow you to get your work done in new and different ways. It's a whole vibe. ๐
๐ฆ Introductory ๐ฆ
If you are new to PDL, these documentation modules will get you started down the right path for using PDL. No cap. ๐
๐ Documentation ๐
Modules that tell you how to start using PDL. Many of these are library modules technically, but they are included when you use PDL, so I've included them for their documentation. iykyk. ๐
After the first three, most of the docs listed below are rather dry. Perhaps they would be better summarized by tables or better synopses. You should at least scan through them to familiarize yourself with the basic capabilities of PDL. Don't skip the scan, bestie. ๐
PDL::Philosophy,PDL::QuickStartโ A couple of brief introductions to PDL. The second one is a bit more hands-on. If you are new to PDL, you should start with these. Start here fr fr. ๐PDL::Basicโ Covers basic ndarray-creation routines likesequence,rvals, andlogxvalsto name a random few. Also covershistandtranspose. Basic but iconic. โจPDL::Ufuncโ Explains a large collection of built-in functions which, given an N-dimension ndarray, will create an ndarray with N-1 dimensions. Math girlies rise. ๐งPDL::NiceSliceโ PDL came of age right around the turn of the millennium and NiceSlice came on the scene slightly after that. Some of the docs still haven't caught up. NiceSlice is the 'modern' way to slice and dice your ndarrays. Read the Synopsis, then scroll down to The New Slicing Syntax. After you've read to the bottom, return to and read the stuff at the top. It's giving time-travel reading order. ๐ฆPDL::Primitiveโ Defines a whole slew of useful built-in functions. These are the sorts of things that beginners are likely to write to the list and say, "How do I do xxx?" You would be well on your way to learning the ropes after you've gotten through this document. You got this. ๐ช- Selections from
PDL::Coreโ LikePDL::Primitive, defines a large set of useful functions. Unfortunately, some of the functions are quite esoteric, but are mixed in with the rest of the simple and easy ones. Skim the whole document, skipping over the complicated functions for now. I would point out in particular the functionapprox. Skim queen behavior. ๐
โจ Workflow โจ
- The
perldlorpdl2Shell โ ThePerldlShell is a REPL (Read-Evaluate-Print-Loop, in other words, a prompt or shell) that allows you to work with PDL (or any Perl, for that matter) in 'real time', loading data from files, plotting, manipulating... Anything you can do in a script, you can do in the PDL Shell, with instant feedback! Instant feedback is the moment. ๐ฅ
๐ Libraries ๐
PDLโ The main workhorse module. You'll include this in nearly every PDL program you write. Main character module. ๐
Normal Usage ๐
okay bestie, so these are the modules you'll probably use on the regular โ like in scripts or inside the perldl shell. Some you might literally never touch, but you should still know they exist, just in case you need their functionality. ๐
โจ Documentation โจ
PDL::Slicesโ Besides explaining the O.G. slicing-and-dicing functions (for which you can usually just usePDL::NiceSlice), this also covers a bunch of dimension-handling functions likemv,xchg, andreorder. It also thoroughly documents therangefunction โ which can be super powerful โ and covers a number of internal functions that you can probably skip. โจPDL::Indexingโ This one is giving deep conceptual ground, bestie. You need it to really use PDL to its full potential. It gets more complex as you go, so don't be troubled if you find yourself losing interest halfway through โ no shame. But reading this document all the way through will bring you much closer to PDL enlightenment. ๐งPDL::IOโ PDL has quite a few IO modules, and most of them get discussed in this summary module. ๐PDL::Tipsโ A collection of some of Tuomas's ideas for making good use of PDL. ๐PDL::BadValuesโ Explains what bad values are, plus how and why they're implemented. ๐- Selections from
Inline::Pdlppโ Even though writingPDL::PPcode is considered an Advanced topic (we get to that next section), you should know it's possible โ and surprisingly simple โ to write PDL-aware code. You don't need to read the whole thing right now, but to get a feel for how it works, read everything up through the first example. A copy of this documentation lives inPDL::PP-Inline. ๐ฆ PDL::Objectsโ Explains how to subclass an ndarray object. ๐PDL::Indexโ We talked about this in the Preface. It's an automatically generated file that lists every PDL module on your computer. There are tons of modules that might be on your machine but aren't documented here โ like bindings to the FFTW library, or GSL. Give it a read! ๐
๐ธ Libraries ๐ธ
PDL::FFTโ PDL's very own Fast Fourier Transform. If you have FFTW, you should probably use that instead; this is PDL's internal implementation and should always be available. โจ- GSL โ PDL doesn't have bindings for every single sub-library in the GNU Scientific Library, but it has quite a few. If GSL is installed on your machine, chances are decent that your PDL has the GSL bindings. For a full list of the GSL bindings, check
PDL::Index. ๐ฅ PDL::Funcโ A somewhat uniform interface to the different interpolation modules in PDL. ๐PDL::Badโ Includes some basic bad-value functionality โ like functions to query if an ndarray has bad values (isbad), and functions to set certain elements as bad (setbadatandsetbadif). Among other places, bad values are used inPDL::Graphics::PLplot'sxyplotto make a gap in a line plot. ๐PDL::DiskCacheโ A cool module that lets you tie a Perl array to a collection of files on your disk โ they get loaded into and out of memory as ndarrays. If you're writing scripts to process many data files, especially if that processing isn't necessarily in sequential order, you should considerPDL::DiskCache. ๐PDL::Charโ A PDL subclass that lets you store and manipulate collections of fixed-length character strings using PDL. ๐PDL::Image2Dโ A whole collection of methods for manipulating images whose image data are stored in an ndarray. These include methods for convolutions (smoothing), polygon fills, scaling, rotation, and warping, among others. ๐ธPDL::ImageNDโ Contains a few functions that are conceptually related to image processing, but can be defined for higher-dimensional data. For example, this module defines high-dimensional convolution and interpolation, among others. ๐งPDL::ImageRGBโ Defines some useful functions for working with RBG image data. It's not super feature-full, but it might have something you need โ and if not, you can always add more! ๐PDL::Transformโ Creates the transform class, which lets you create various coordinate transforms. For example, if your data is a collection of Cartesian coordinates, you could create a transform object to convert them to Spherical-Polar coordinates โ although many such standard coordinate transformations are predefined for you; in this case it's calledt_spherical. ๐ซPDL::Opt::Simplexโ This package states that it "implements the commonly used simplex optimization algorithm." I'm going to assume that if you need this algorithm, you already know what it is. ๐PDL::Mathโ A collection of fairly standard math functions โ like inverse trig functions, hyperbolic functions and their inverses, and others. This module is included in the standard call touse PDL, but not in the Lite versions. ๐งฎPDL::Matrixโ Provides a few functions that use the standard mathematical Matrix notation of row-column indexing instead of the PDL-standard column-row. It appears this module hasn't been heavily tested with other modules, so although it should work with other modules, don't be surprised if something breaks when you use it โ and feel free to offer any fixes you develop. ๐PDL::MatrixOpsโ Provides many standard matrix operations for ndarrays โ like computing eigenvalues, inverting square matrices, LU-decomposition, and solving a system of linear equations. Though it's not built onPDL::Matrix, it should generally work with that module. Also, the methods provided by this module do not depend on external libraries such as Slatec or GSL. ๐ฅPDL::Reduceโ Implements an interface to all the functions that return ndarrays with one less dimension (for example,sumover), so they can be called by supplying their name as a string. ๐
๐ฆ Workflow ๐ฆ
PDL::AutoLoaderโ Enables Matlab-style autoloading. When you call an unknown function, instead of complaining and croaking, PDL will go hunt around in the directories you specify for a like-named file. Particularly useful with the Perldl Shell. ๐ฆPDL::Dbgโ Declares thepxfunction, which can be handy for debugging your PDL scripts and/or perldl shell commands. ๐PDL::Optionsโ Suppose you define a powerful, versatile function. Chances are good you'll accept arguments as a hash or hashref. Now you face the problem of processing that hashref.PDL::Optionsassists you in writing code to process those options. (You'd think Perl would have tons of these sorts of modules lying around, but I couldn't find any.) Note this module does not depend on PDL for its usage or installation. ๐PDL::pdldocโ Ever fired up the perldl shell just to look up help for a particular function? You can usepdldocinstead. This shell script extracts information from the help index without needing to start the perldl shell. ๐
๐ Advanced Usage ๐
The sorts of modules and documentation that you'll use if you write modules that use PDL, or if you work on PDL maintenance. These modules can be difficult to use, but enable you to tackle some of your harder problems.
PDL::Lite,PDL::LiteFโ Lite-weight replacements foruse PDL, from the standpoint of namespace pollution and load time. ๐ชถInline::Pdlppโ We mentioned this earlier. Before you start reading aboutPDL::PP(next), remind yourself how to use this.Inline::Pdlppwill help you experiment withPDL::PPwithout the trouble of building a module and constructing makefiles โ but seePDL::pptemplatefor help with that. ๐งชPDL::PPโ The PDL Pre-Processor, which vastly simplifies making your C or Fortran code play with Perl and ndarrays. Most of PDL's basic functionality is written usingPDL::PP, so if you're thinking about integrating some numerical library written in C, look no further. ๐ฅPDL::pptemplateโ A script that automates the creation of modules that usePDL::PP, which should make your life as a module author a bit simpler. ๐ ๏ธPDL::CallExtโ Allows you to call functions using external shared libraries. This is an alternative to usingPDL::PP. The major difference betweenPDL::PPandPDL::CallExtis that the former will handle broadcasting over implicit broadcast dimensions for you, whereasPDL::CallExtsimply calls an external function.PDL::PPis generally the recommended way to interface your code with PDL, but it wouldn't be Perl if there wasn't another way to do it. ๐PDL::Configโ Defines the%PDL::Confighash, which has lots of useful information pertinent to your PDL build. โ๏ธPDL::Docโ Explanation of the PDL documentation conventions, and an interface to the PDL Documentation parser. Following these guidelines when writing documentation for PDL functions will ensure your wonderful documentation is accessible from the perldl shell and from calls tobarf. (Did you notice thatbarfused your documentation? Time to rereadPDL::Core...) ๐PDL::Exporterโ A simple replacement for the standard Exporter module. The only major difference is that the default imported modules are those marked:Func. ๐ฆPDL::Typesโ Defines some useful functions for getting an ndarray's type, as well as getting information about that type. ๐
๐ Expert Usage ๐
PDL::Core::Devโ Provides some decently useful functions that are pretty much only needed by the PDL Porters. ๐PDL::APIโ Explains how to make an ndarray by hand, from Perl or your C source code, using the PDL API. ๐ ๏ธPDL::Internalsโ Explains the nitty-gritty of the PDL data structures. After reading this (a few times :), you should be able to create an ndarray completely from scratch (i.e. without using the PDL API). Put a little differently, if you want to understand howPDL::PPworks, you'll need to read this. ๐
๐ COPYRIGHT ๐
okay so legal bit, but make it cute:
Copyright 2010 David Mertens (dcmertens.perl@gmail.com). periodt. โจ
You can distribute and/or modify this document under the same terms as the current Perl license. That's it, that's the deal, no cap. ๐ซถ
Wanna read the actual terms? Go here, bestie:
http://dev.perl.org/licenses/
and that's the whole page!! ๐ you made it all the way to the bottom of the COURSE(1p) manual, which is genuinely main character energy ๐
โจ this page is from perl v5.38.2, dated 2024-04-10, and now you know it inside out fr fr ๐ธ go forth and slay your Perl course stuff, bestie, you got this ๐๐ฆ๐
๐ฆ where this page comes from
- ubuntu noble: pdl 1:2.085-1ubuntu1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms