.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Dbg 3pm" .TH Dbg 3pm "2023-06-17" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PDL::Dbg \- functions to support debugging of PDL scripts .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use PDL; \& use PDL::Dbg; \& \& $c = $x\->slice("5:10,2:30")\->px\->diagonal(3,4); \& PDL\->px; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" These packages implements a couple of functions that should come in handy when debugging your \s-1PDL\s0 scripts. They make a lot of sense while you're doing rapid prototyping of new \s-1PDL\s0 code, let's say inside the perldl or pdl2 shell. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "px" .IX Subsection "px" Print info about an ndarray (or all known ndarrays) .PP .Vb 6 \& pdl> PDL\->px \& pdl> $y += $x\->clump(2)\->px(\*(Aqclumptest\*(Aq)\->sumover \& pdl> $x\->px(\*(Aq%C (%A) Type: %T\*(Aq) # prints nothing unless $PDL::debug \& pdl> $PDL::debug = 1 \& pdl> $x\->px(\*(Aq%C (%A) Type: %T\*(Aq) \& PDL (52433464) Type: Double .Ve .PP This function prints some information about ndarrays. It can be invoked as a class method (e.g. \f(CW\*(C`PDL\->px\*(C'\fR ) or as an instance method (e.g. \&\f(CW\*(C`$pdl\->px($arg)\*(C'\fR). If .IP "invoked as a class method" 2 .IX Item "invoked as a class method" it prints info about all ndarrays found in the current package (\fIexcluding\fR \f(CW\*(C`my\*(C'\fR variables). This comes in quite handy when you are not quite sure which pdls you have already defined, what data they hold , etc. \f(CW\*(C`px\*(C'\fR is supposed to support inheritance and prints info about all symbols for which an \f(CW\*(C`isa($class)\*(C'\fR is true. An optional string argument is interpreted as the package name for which to print symbols: .Sp .Vb 1 \& pdl> PDL\->px(\*(AqPDL::Mypack\*(Aq) .Ve .Sp The default package is that of the caller. .IP "invoked as an instance method" 2 .IX Item "invoked as an instance method" it prints info about that particular ndarray if \f(CW$PDL::debug\fR is true and returns the pdl object upon completion. It accepts an optional string argument that is simply prepended to the default info if it doesn't contain a \f(CW\*(C`%\*(C'\fR character. If, however, the argument contains a \f(CW\*(C`%\*(C'\fR then the string is passed to the \f(CW\*(C`info\*(C'\fR method to control the format of the printed information. This can be used to achieve customized output from \f(CW\*(C`px\*(C'\fR. See the documentation of \&\f(CW\*(C`PDL::info\*(C'\fR for further details. .PP The output of px will be determined by the default formatting string that is passed to the \f(CW\*(C`info\*(C'\fR method (unless you pass a string containing \f(CW\*(C`%\*(C'\fR to px when invoking as an instance method, see above). This default string is stored in \f(CW$PDL::Dbg::Infostr\fR and the default output format can be accordingly changed by setting this variable. If you do this you should also change the default title string that the class method branch prints at the top of the listing to match your new format string. The default title is stored in the variable \f(CW$PDL::Dbg::Title\fR. .PP For historical reasons \f(CW\*(C`vars\*(C'\fR is an alias for \f(CW\*(C`px\*(C'\fR. .SS "vars" .IX Subsection "vars" Alias for \f(CW\*(C`px\*(C'\fR .SH "BUGS" .IX Header "BUGS" There are probably some. Please report if you find any. Bug reports should be sent to the \s-1PDL\s0 mailing list pdl\-general@lists.sourceforge.net. .SH "AUTHOR" .IX Header "AUTHOR" Copyright(C) 1997 Christian Soeller (c.soeller@auckland.ac.nz). All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file \s-1COPYING\s0 in the \s-1PDL\s0 distribution. If this file is separated from the \s-1PDL\s0 distribution, the copyright notice should be included in the file.