Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

PDL encore

by Evanovich (Scribe)
on Apr 01, 2003 at 06:37 UTC ( [id://247158]=perlquestion: print w/replies, xml ) Need Help??

Evanovich has asked for the wisdom of the Perl Monks concerning the following question:

Hello again. I was wondering if someone might help me with another PDL question. I want to take an inner product between two piddles, but I want to omit indices that contain a null tag (I currently use "999") in my product. In other words, I want an inner product that excludes any index if one of the two entries of that index is 999. Is there an elegant PDL way to do this, or do I need to pass the arrays into C?

Replies are listed 'Best First'.
Re: PDL encore
by Zaxo (Archbishop) on Apr 01, 2003 at 06:45 UTC

    Yes, use zero instead of 999. That's math :)

    After Compline,
    Zaxo

      Setting "bad" values to 0 is mathematically valid for this situation. A more PDL-ish approach however is to use "bad values"; doing $pdl->badvalue(999) would achieve the aim here.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://247158]
Approved by dga
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-20 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found