in reply to vector math

The PDL module is very easy to use. Just remember to use Perl's overloaded x operator for multiplication, not *

For example (borrowing from TQuid's answer):

$baz = $foo x $bar;
(well, this actually won't work with TQuid's matrices, but you get the point)

"test"

Replies are listed 'Best First'.
Re^2: vector math
by etj (Priest) on Jul 08, 2022 at 20:23 UTC
    In fact, x in PDL is overloaded to achieve matrix multiplication, so the left- and right-hand operands need to be appropriately dimensioned (it will error out in a hopefully-informative way if not). But * operates on an element-by-element basis (using "broadcasting") over vectors, thus achieving part of a dot-product (there is in fact an inner operation that does an actual dot-product).