PDL::Primitive Perl module contains primitive operations for pdl.
This module provides some primitive and useful functions defined using PDL::PP and able to use the new indexing tricks.
See PDL::Indexing for how to use indices creatively. For explanation of the signature format, see PDL::PP.
Inner product over one dimension
c = sum_i a_i * b_i
', BadDoc => 'If a() * b() contains only bad data, c() is set bad. Otherwise c() will have its bad flag cleared, as it will not contain any bad values.', ); # pp_def( inner )
pp_def( 'outer', HandleBad => 1, Pars => 'a(n); b(m); [o]c(n,m);', Code => 'loop(n,m) %{ $c() = $a() * $b(); %}', BadCode => 'loop(n,m) %{ if ( $ISBAD(a()) || $ISBAD(b()) ) { $SETBAD(c()); } else { $c() = $a() * $b(); } %}', Doc => ' =for ref
outer product over one dimension
Naturally, it is possible to achieve the effects of outer product simply by threading over the "*" operator but this function is provided for convenience.
'); # pp_def( outer )
pp_addpm(
Product's homepage
Requirements:
· Perl