VectorValued(3pm)
π PDL::VectorValued β bestie edition β¨
okay so, this is PDL::VectorValued β it's the module that handles utilities for vector-valued PDLs. Like, PDL but the values are whole vectors and we treat them as one lil data unit. iconic behavior honestly π«Ά
β¨ SYNOPSIS β¨
use PDL;
use PDL::VectorValued;
##---------------------------------------------------------------------
## ... stuff happens
(yes the "stuff happens" is literally in the source, we love an honest doc π)
πΈ DESCRIPTION πΈ
So basically PDL::VectorValued hands you generalizations of a handful of elementary PDL functions, but leveled up to higher-order PDLs β the kind that treat vectors as "data values". It's giving "your scalar functions but they went to college" π
π ALIASES π
Okay so here's the lore. To make it easier to fold selected vector-valued functions into the PDL core, all the PDL:PP-, XS-, C-, and perl-level functions that this module defines inside the PDL::VectorValued::Utils package namespace rock a vv_ prefix β and that's been true as of PDL::VectorValued v1.0.19. Before v1.0.19, a lot of these functions (like cmpvec(), for example) were defined by this module with no vv_ prefix at all. glow-up moment β¨
For PDL::VectorValued >= v1.0.19 and PDL > v2.079, most vector-valued functions are expected to live in the PDL core instead. For these so-called "moving" functions FUNC, the PDL core implementations get imported into the PDL::VectorValued namespace as both FUNC and vv_FUNC, and they clobber any local implementation hanging out in the PDL::VectorValued::Utils namespace. Meanwhile, local implementations vv_FUNC that were previously defined and exported as FUNC, or that have no binding for *PDL::FUNC at all, get bound to both *PDL::VectorValued::FUNC and *PDL::FUNC, and exported by default β for backwards-compatibility reasons, obviously. it's giving legacy support π«‘
Functions expected to move to the PDL core are:
- New code should use
FUNC()orPDL::FUNC(). - Backwards-compatible code can use
FUNC()orPDL::VectorValued::FUNC(). - Direct use of
PDL::VectorValued::Utils::vv_FUNC()is deprecated. - Direct use of
PDL::VectorValued::Utils::FUNC()is likely broken as ofPDL::VectorValuedv1.0.19. π
not me warning you twice β seriously, don't call the broken one, bestie.
π₯ FUNCTIONS π₯
vv_uniqvec π
Signature: (v(N,M); [o]vu(N,MU))
Drop-in replacement for the broken uniqvec(), except this one uses vv_qsortvec(). Aside from that it's copied straight 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.
It's a generalization of rle() and vv_rlevec(): hand it a set of values $data, and it generates a vector $counts with the number of occurrences of each element β where an "element" is a matrix of dimensions @vdims occurring as a sequential run over the final dimension in $data β plus a set of vectors $elts containing the elements which begin a run. Really it's just a wrapper for clump() and rlevec(). lowkey elegant π
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(): give it a vector $counts() holding the number of occurrences of each @vdims-dimensioned element, plus a set $elts() of @vdims-dimensioned elements, and it run-length decodes that into $data().
Really just a wrapper for clump() and rldvec(), no cap.
See also: PDL::Slices::rld, PDL::VectorValued::Utils::rldvec
β Datatype Utilities β
vv_indx π
Signature: vv_indx()
Returns the PDL::Type subclass used for indices. If it was built with PDL < v2.007, this should return PDL::long; otherwise it should return PDL::indx. it's giving "know your version" β¨
πΈ Low-Level Functions πΈ
Some additional low-level functions are provided in the PDL::VectorValued::Utils package. See PDL::VectorValued::Utils for details. iykyk π«Ά
π«Ά ACKNOWLEDGEMENTS π«Ά
perl by Larry Wall. the OG. periodt π
π AUTHOR π
Bryan Jurish <moocow@cpan.org>
PDL by Karl Glazebrook, Tuomas J. Lukka, Christian Soeller, and others. absolute legends, all of them π
π COPYRIGHT π
Copyright (c) 2007-2022, Bryan Jurish. All rights reserved.
This package is free software. You may redistribute it and/or modify it under the same terms as Perl itself. slay, free software π
π SEE ALSO π
perl(1), PDL(3perl), PDL::VectorValued::Utils(3perl)
okay that's the whole page, bestie π this doc shipped as perl v5.42.3 dated 2026-08-21, and the page itself is VectorValued(3pm). go forth and vector-value responsibly πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: libpdl-vectorvalued-perl 1.0.23-1build2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms