Visit The New, Modern Unix Linux Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #526
Difficulty: Medium
In the ASCII Character Table, the first and second column indicate the binary and decimal representation respectively.
True or False?
Linux & Unix Commands - Search Man Pages

pdl(1) [redhat man page]

INTRO(1)						User Contributed Perl Documentation						  INTRO(1)

NAME
PDL::Intro - Introduction to the Perl Data Language Version 2.0 "Why is it that we entertain the belief that for every purpose odd numbers are the most effectual?" - Pliny the Elder. Karl Glazebrook [karlglazebrook@yahoo.com] DESCRIPTION
Perl is an extremely good and versatile scripting language, well suited to beginners and allows rapid prototyping. However until recently it did not support data structures which allowed it to do fast number crunching. However with the development of Perl v5, Perl acquired Objects. To put it simply users can define their own special data types, and write custom routines to manipulate them either in low level languages (C and Fortran) or in Perl itself. This has been fully exploited by the PDL developers. The "PDL" module is a complete Object-Oriented extension to Perl (although you don't have to know what an object is to use it) which allows large N-dimensional data sets, such as large images, spectra, time series, etc to be stored efficiently and manipulated en masse. For example with the PDL module we can write the perl code "$a=$b+$c", where $b and $c are large datasets (e.g. 2048x2048 images), and get the result in only a fraction of a second. PDL variables (or piddles as they have come to be known) support a wide range of fundamental data types - arrays can be bytes, short inte- gers (signed or unsigned), long integers, floats or double precision floats. And because of the Object-Oriented nature of PDL new cus- tomised datatypes can be derived from them. As well as the PDL modules, that can be used by normal perl programs, PerlDL comes with a command line perl shell, called perldl, which supports command line editing. In combination with the various PDL graphics modules this allows data to be easily played with and visu- alised. SYNOPSIS
This manual page provides a general introduction to the underlying philosophy of PDL. For an overview over the rest of the documentation see PDL::Index. As a beginner the following documents are particulary recommended: PDL::Impatient Quick summary - PDL for the impatient PDL::FAQ The Frequently Asked Questions list for PDL. PDL::Philosophy Why another matrix language? PDL::Indexing An introduction to using smart indices in PDL. PDL::NiceSlice The all important slicing of piddles. AUTHOR
Copyright (C) Karl Glazebrook (karlglazebrook@yahoo.com), Tuomas J. Lukka, (lukka@husc.harvard.edu) and Christian Soeller (c.soeller@auck- land.ac.nz) 1997-2002. Commercial reproduction of this documentation in a different format is forbidden without permission. perl v5.8.0 2002-03-18 INTRO(1)

Check Out this Related Man Page

OBJECTS(1)						User Contributed Perl Documentation						OBJECTS(1)

NAME
PDL::Objects -- Object-Orientation, what is it and how to exploit it DESCRIPTION
This still needs to be written properly. Inheritance There are basically two reasons for subclassing piddles. The first is simply that you want to be able to use your own routines like $piddle->something() but don't want to mess up the PDL namespace (a worthy goal, indeed!). The other is that you wish to provide special handling of some functions or more information about the data the piddle contains. In the first case, you can do with package BAR; @ISA=qw/PDL/; sub foo {my($this) = @_; fiddle;} package main; $a = PDL::pdl(BAR,5); $a->foo(); However, because a PDL object is an opaque reference to a C struct, it is not possible to extend the PDL class by e.g. extra data via subclassing. To circumvent this problem PerlDL has built-in support to extent the PDL class via the has-a relation for blessed hashes. You can get the HAS-A behave like IS-A simply in that you assign the "PDL" object to the attribute named PDL and redefine the method initialize(). package FOO; @FOO::ISA = qw(PDL); sub initialize { my $class = shift; my $self = { creation_time => time(), # necessary extension :-) PDL => null, # used to store PDL object }; bless $self, $class; } All PDL constructors will call initialize() to make sure that your extentions are added by all PDL constructors automaticly. The "PDL" attribute is used by perlDL to store the PDL object and all PDL methods use this attribute automaticly if they are called with a blessed hash reference instead of a PDL object (a blessed scalar). Do remember that if you subclass a class that is subclassed from a piddle, you need to call SUPER::initialize. NEED STUFF ABOUT CODE REFs!! Examples You can find some simple examples of PDL subclassing in the PDL distribution test-case files. Look in "t/subclass2.t", "t/subclass3.t", etc. Output Auto-Creation and Subclassed Objects For PDL Functions where the output is created and returned, PDL will either call the subclassed object's "initialize" or "copy" method to create the output object. (See PDL::Indexing for a discussion on Output Auto-Creation.) This behavior is summarized as follows: o For Simple functions, defined as having a signature of func( a(), [o]b() ) PDL will call $a->copy to create the output object. In the spirit of the perl philosophy of making Easy Things Easy, This behavior enables PDL-subclassed objects to be written without having to overload the many simple PDL functions in this category. The file t/subclass4.t in the PDL Distribution tests for this behavior. See that file for an example. o For other functions, PDL will call $class->initialize to create the output object. Where $class is the class name of the first argument supplied to the function. For these more complex cases, it is difficult to second-guess the subclassed-object's designer to know if a "copy" or a "initialize" is appropriate. So for these cases, $class->initialize is called by default. If this is not appropriate for you, overload the function in your subclass and do whatever is appropriate is the overloaded function's code. AUTHOR
Copyright (C) Karl Glazebrook (kgb@aaoepp.aao.gov.au), Tuomas J. Lukka, (lukka@husc.harvard.edu) and Christian Soeller (c.soeller@auckland.ac.nz) 2000. Commercial reproduction of this documentation in a different format is forbidden. perl v5.12.1 2009-10-17 OBJECTS(1)

Featured Tech Videos