Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pdl::tutorials(1p) [debian man page]

TUTORIALS(1p)						User Contributed Perl Documentation					     TUTORIALS(1p)

NAME
PDL::Tutorials - A guide to PDL's tutorial documentation. MIGRATION
These are our migration guides for users familiar with other types of numerical analysis software. PDL::MATLAB Migration guide for MATLAB users. This page explains the key differences between MATLAB and PDL from the point of view of a MATLAB user. PDL::Scilab Migration guide for Scilab users. This page explains the key differences between Scilab and PDL from the point of view of a Scilab user. FOUNDATION
PDL::Philosophy Why did we write PDL? This document explains some of the history and motivation behind the Perl Data Language. It is an attempt to answer the question "Why PDL?". PDL::QuickStart Quick introduction to PDL features. A hands-on guide suitable for complete beginners. This page assumes no previous knowledge of Perl or PDL. PDL::Indexing After you have read the QuickStart guide, you should follow up with this document. This guide goes more deeply into the concepts of "indexing" and "slicing" and how they form the core of numerical analysis with PDL. INTERMEDIATE
PDL::Threading Threading is one of PDL's most powerful features. If you know MATLAB, you've heard of "vectorizing". Well, threading is like "vectorizing on steroids". It lets you make very fast and compact code by avoiding nested loops. All vector-based languages do this, but PDL generalizes the technique to all sorts of applications. This tutorial introduces PDL's threading feature, and it shows an example implementing Conway's Game of Life in 10 lines and 80 times faster than a classical implementation. PDL::BadValues Sometimes it is useful to specify that a certain value is "bad" or "missing". Scientific instruments some times include portions of invalid data. For example, a CCD camera might produce an image with over-exposed pixels. PDL's "bad values" feature gives you an easy way to deal with this sort of imperfect data. PDL::Tips Tips and suggestions for using PDL. This page is an assorted collection of programming tidbits that some PDL users have found useful. Some of these tips might be of help when you write your programs. ADVANCED
PDL::PP PDL's Pre-Processor is one of PDL's most powerful features. You write a function definition in special markup and the preprocessor generates real C code which can be compiled. With PDL:PP you get the full speed of native C code without having to deal with the full complexity of the C language. PDL::API A simple cookbook explaining how to create piddle manually, either from Perl or from C/XS code. This page covers the PDL core routines that comprise the PDL API. If you need to access piddles from C/XS, this is the document for you. PDL::Internals Description of the inner workings of the PDL module. Very few people need to see this. This page is mainly for PDL developers, or people interested in debugging PDL or changing the internals of PDL. If you can read this document and understand all of it, and you additionally understand PDL::PP, you will be awarded the title of "PDL Guru". COPYRIGHT
Copyright 2010 Daniel Carrera (dcarrera@gmail.com). You can distribute and/or modify this document under the same terms as the current Perl license. See: http://dev.perl.org/licenses/ perl v5.14.2 2012-01-02 TUTORIALS(1p)

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 func- tions 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 sub- classing. 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 initial- ize(). 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@auck- land.ac.nz) 2000. Commercial reproduction of this documentation in a different format is forbidden. perl v5.8.0 2000-05-25 OBJECTS(1)
Man Page