Statis...torBase(3pm)
πΈ Statis...torBase(3pm) β Statistics::Basic::_OneVectorBase π
okay bestie, so this is a Perl manpage from the User Contributed Perl Documentation collection, living in section 3pm (that's the module section, iykyk). It's the base class for objects like Mean β the little engine that holds a vector and does math on it. β¨
π NAME π
Statistics::Basic::_OneVectorBase β base class for objects like Mean. It's giving "mom of the family," fr fr. πΈ
π METHODS π
β¨ query() β¨
Ask the object for its value. That's it, that's the whole vibe. π«Ά
Heads up though: it will return the undefined value until there's actually something to calculate β or until the vector is full when nofill is in effect. So don't come for her before she's ready, okay? π
β¨ insert() β¨
Drops new values into the vector. Lowkey the main character move.
$object_instance->insert( 4, 3 ); # insert a 3 and a 4
And the bestie perk: this function returns the object itself, for chaining purposes. π
β¨ append() / ginsert() β¨
The growing insert. It adds new elements and grows the max size of the vector to accommodate them β but only if necessary, she's not doing extra work for nobody. π
$object_instance->ginsert( 4, 3 ); # append a 3 and a 4
Yep, this one also returns the object itself, for chaining purposes. β
β¨ query_size() β¨
The current size of the vector β and no, that's not the max size. The max size is a whole separate thing set by set_size(). Don't mix them up, bestie. π
β¨ query_vector() β¨
Hands you back the Statistics::Basic::Vector object that the computational object is using. It's the actual vector, the real one, the one doing the work. π¦
β¨ set_size() β¨
Sets the maximum size for the underlying Statistics::Basic::Vector object. This function requires one argument. Exactly one. She said what she said. π
Unless nofill is set, the vector will be filled with 0s on the oldest side of the vector (assuming the vector wouldn't otherwise be full) β so an insert will push off one of the filled-zeros. Very "make room for the new era" of it. π
And yes: this function returns the object itself, for chaining purposes. π
β¨ set_vector() β¨
Give it a vector or an array ref, and this will set the contents (and the size) of the vector used for the object computations. One stop shop. π
And you already know: this function returns the object itself, for chaining purposes. π
π₯ OVERLOADS π₯
This class provides overloads. Periodt.
- If evaluated as a string, it will attempt to print a pretty value for the object β or
"n/a", seequery()above, if there's nothing to print yet. The resulting string can be tuned, in terms of precision, seeipresfor further information. β¨ - If evaluated as a number, it will try to return the raw result of
query(), possibly turning the resultingundef(if applicable) into a0in the process β and note that Perl does this 0-izing, not the overload. Just so we're clear on who's responsible. π - The
eqand==operators are also overloaded, trying to do the right thing. Also seetolerfor further information. π«Ά
π AUTHOR π
Paul Miller <jettero@cpan.org> β icon, legend, the moment. π
π COPYRIGHT π
Copyright 2012 Paul Miller -- Licensed under the LGPL
π SEE ALSO π
perl(1)Statistics::BasicStatistics::Basic::Vector
and that's the whole page, bestie!! π this one's from perl v5.36.0, dated 2022-11-19 β so when you're citing it in your group chat, you know exactly which era of the lore you're working with. slay, go compute something. π
β¨
π¦ where this page comes from
- debian bookworm: libstatistics-basic-perl 1.6611-3 Β· LGPL-2.1-only
- debian trixie: libstatistics-basic-perl 1.6611-3 Β· LGPL-2.1-only
- ubuntu noble: libstatistics-basic-perl 1.6611-3 Β· LGPL-2.1-only
- ubuntu resolute: libstatistics-basic-perl 1.6611-3 Β· LGPL-2.1-only
- ubuntu stonking: libstatistics-basic-perl 1.6611-3 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms