PDL::VectorValued(3pm)

PDL::VectorValued3pm

Utilities for vector-valued pdls

Usage

 use PDL;
 use PDL::VectorValued;
 ##---------------------------------------------------------------------
 ## ... stuff happens

Overview

PDL::VectorValued provides generalizations of some elementary PDL functions to higher-order PDLs which treat vectors as "data values".

Aliases

To facilitate incorporation of selected vector-valued functions into the PDL core, the PDL:PP-, XS-, C-, and perl-level functions defined by this module in the "PDL::VectorValued::Utils" package namespace all carry a "vv_" prefix as of PDL::VectorValued v1.0.19 Prior to v1.0.19, many of these functions (e.g. cmpvec()) were defined by this module without a "vv_" prefix.

For PDL::VectorValued >= v1.0.19 and PDL > v2.079, most vector-valued functions are expected to be defined in the PDL core. For such "moving" functions "FUNC", the PDL core implementations will be imported into the "PDL::VectorValued" namespace as both "FUNC" and "vv_FUNC", clobbering any local implementation from the "PDL::VectorValued::Utils" namespace. Local implementations "vv_FUNC" which were previously defined and exported as "FUNC" or for which no binding for *PDL::FUNC exists will be bound to both *PDL::VectorValued::FUNC and *PDL::FUNC, and exported by default, for backwards-compatibility.

Functions expected to move to the PDL core are:

•

New code should use FUNC() or PDL::FUNC().

•

Backwards-compatible code can use FUNC() or PDL::VectorValued::FUNC().

•

Direct use of PDL::VectorValued::Utils::vv_FUNC() is deprecated.

•

Direct use of PDL::VectorValued::Utils::FUNC() is likely broken as of PDL::VectorValued v1.0.19.

Functions

vv_uniqvec

  Signature: (v(N,M); [o]vu(N,MU))

Drop-in replacement for broken uniqvec() which uses vv_qsortvec(). Otherwise copied from PDL::Primitive::primitive.pd.

See also: PDL::VectorValued::Utils::vv_qsortvec, PDL::Primitive::uniqvec.

Higher-Order Run-Length Encoding and Decoding

The following functions generalize the builtin PDL functions rle() and rld() for higher-order "values".

See also: PDL::VectorValued::Utils::vv_rlevec(), PDL::VectorValued::Utils::vv_rldvec().

vv_rleND

  Signature: (data(@vdims,N); int [o]counts(N); [o]elts(@vdims,N))

Run-length encode a set of (sorted) n-dimensional values.

Generalization of rle() and vv_rlevec(): given set of values $data, generate a vector $counts with the number of occurrences of each element (where an "element" is a matrix of dimensions @vdims ocurring as a sequential run over the final dimension in $data), and a set of vectors $elts containing the elements which begin a run. Really just a wrapper for clump() and rlevec().

See also: PDL::Slices::rle, PDL::Ngrams::VectorValued::Utils::vv_rlevec.

vv_rldND

  Signature: (int counts(N); elts(@vdims,N); [o]data(@vdims,N);)

Run-length decode a set of (sorted) n-dimensional values.

Generalization of rld() and rldvec(): given a vector $counts() of the number of occurrences of each @vdims-dimensioned element, and a set $elts() of @vdims-dimensioned elements, run-length decode to $data().

Really just a wrapper for clump() and rldvec().

See also: PDL::Slices::rld, PDL::VectorValued::Utils::rldvec

Datatype Utilities

vv_indx

  Signature: vv_indx()

Returns PDL::Type subclass used for indices. If built with PDL < v2.007, this should return "PDL::long", otherwise "PDL::indx".

Low-Level Functions

Some additional low-level functions are provided in the PDL::VectorValued::Utils package. See PDL::VectorValued::Utils for details.

Acknowledgements

perl by Larry Wall.

Releases

4 releases since Debian 10 (Buster); the text changed 3 times.

  1. 10
  2. 11
  3. 12
  4. 13

Author

Bryan Jurish <[email protected]>

PDL by Karl Glazebrook, Tuomas J. Lukka, Christian Soeller, and others.

From libpdl-vectorvalued-perl 1.0.23-1+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.