Statis...torBase(3pm)
π NAME π
Statistics::Basic::_TwoVectorBase β it's the base class for the two-vector girlies, like Correlation. Basically the blueprint other objects are built on, iykyk.
β¨ METHODS β¨
query()β asks the object what its value is rn. Bestie, it will hand you back the undefined value until there's actually something to calculate. No numbers yet? No tea. π«insert()β drops two new new values into the vectors (yes the original says "new new", we love a typo moment π ). This one must be given precisely two arguments, and honestly those arguments probably shouldn't be undefined values in most cases.
# insert a 4 in one vector and a 3 in the other
$object_instance->insert( 4, 3 );
append(),ginsert()β the growing insert π±. It adds new elements and grows the max size of the vector to accommodate them (if necessary). Same rules as above: precisely two arguments, and they probably shouldn't be undefined values in most cases.
# append a 4 in one vector and a 3 in the other
$object_instance->ginsert( 4, 3 );
query_size()β the current size of the vectors, periodt. This is regardless of their max size (the one you'd set with"set_size()"). Heads up: it returns a list, so like:
my @s = $obj->query_size; # two values
my $s = $obj->query_size; # the right hand value of the list
set_size()β sets the maximum size for the underlyingStatistics::Basic::Vectorobjects. Requires two arguments. Two. Not one, not three. πset_vector()β sets the vector objects used to calculate the object's value. Takes two arguments β and those can be either arrayrefs orStatistics::Basic::Vectorobjects. They must have the same number of elements (matching vibes only π).
my $v1 = vector
my $v2 = $v1->copy;
$example_correlation->set_vector($v1, $v2);
π₯ OVERLOADS π₯
This class provides overloads, and they're giving main character energy.
If you evaluate it as a string, it will attempt to print a pretty value for the object (or "n/a" β see "query()" above). The resulting string can be tuned, in terms of precision β see ipres for further information. β¨
If you evaluate it as a number, it will try to return the raw result of "query()", possibly turning the resulting "undef" (if applicable) into a 0 in the process. Lowkey important: Perl does this 0-izing, not the overload. Don't blame the overload, bestie. π
The "eq" and "==" operators are also overloaded, trying to do the right thing. Also see toler for further information.
π AUTHOR π
Paul Miller "<jettero@cpan.org>"
π COPYRIGHT π
Copyright 2012 Paul Miller -- Licensed under the LGPL
π¦ SEE ALSO π¦
perl(1), Statistics::Basic, Statistics::Basic::Vector
okay that's the whole page, no notes π huge slay to you for reading docs fr fr β this was perl v5.36.0, dated 2022-11-19, mwah π«Ά
π¦ 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