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?
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.