Math::...ultMods(3pm)
π NAME π
Math::Symbolic::Custom::DefaultMods β the default Math::Symbolic transformations, bestie. That's the whole vibe.
β¨ SYNOPSIS β¨
use Math::Symbolic;
That's it. That's the whole synopsis. Iconic, honestly. π
π DESCRIPTION π
Okay so this is a class of default transformations for Math::Symbolic trees. Think of it as the glow-up station for your expression trees. π¦
And like, its sibling? Math::Symbolic::Custom::DefaultTests β that one defines the default tree testing routines. Different job, same family.
Wanna know how the whole custom method delegation model actually works under the hood? Go read Math::Symbolic::Custom and Math::Symbolic::Custom::Base. Do it. It's giving "required reading." π
πΈ EXPORT πΈ
Go check the docs for Math::Symbolic::Custom::Base for the deets, but real talk: do not try to use the standard Exporter semantics with this class. Not the move. π« No cap.
π SUBROUTINES π
π§ apply_derivatives()
Never modifies the tree in-place β it hands you back a modified copy of the original tree instead. Don't come for the original, she's fine. π
- Applied to variables and constants? This method just clones. Nothing fancy. π
- Applied to operators, and if the operator is a derivative: it applies the derivative to the derivative's first operand.
- Regardless of what kind of operator this is called on,
apply_derivativesgets applied recursively on its operands. Down the whole tree, bestie. π
If the first parameter to this function is an integer, then at maximum that number of derivatives are applied β from the top down the tree, if possible. β¨
π apply_constant_fold()
Does not modify the tree in-place by default β it returns a modified copy of the original tree instead. But okay here's the twist:
- If the first argument is true, the tree will not be cloned.
- If it's false or just straight up not there (non-existant), the tree will be cloned. π
Applied to variables and constants: this method just clones.
Applied to operators: every tree segment that contains nothing but constants and operators gets swapped out for Constant objects. Glow-up complete. β
π mod_add_constant
Give it a constant (an object or a number) as the argument, and this method tries hard to fold it into an existing constant β but only if the object it's called on is already a sum or a difference. πͺ
Basically, it's the same as $tree + $constant, except it does some simplification along the way. Same energy, less mess. β¨
πΈ mod_multiply_constant
Give it a constant (an object or a number) as the argument, and this method tries hard to fold it into an existing constant β but only if the object it's called on is already a product or a division. π₯
Basically, it's the same as $tree * $constant, except it does some simplification. Periodt.
π AUTHOR π
Okay so listen: send your feedback, your bug reports, and your support requests to the Math::Symbolic support mailing list:
math-symbolic-support at lists dot sourceforge dot net
And please consider letting them know how you use Math::Symbolic. They genuinely wanna hear it. Thank you!! π«Ά
Wanna help with development or extend the module's functionality? Then hit up the developers' mailing list:
math-symbolic-develop at lists dot sourceforge dot net
List of contributors:
Steffen MΓΌller, symbolic-module at steffen-mueller dot net
Stray Toaster, mwk at users dot sourceforge dot net
Oliver EbenhΓΆh
π SEE ALSO π
New versions of this module can be found at http://steffen-mueller.net or on CPAN. Module development happens on Sourceforge at http://sourceforge.net/projects/math-symbolic/ β go peek, iykyk. π
- Math::Symbolic::Custom
- Math::Symbolic::Custom::DefaultDumpers
- Math::Symbolic::Custom::DefaultTests
- Math::Symbolic
k bye bestie!! this whole thing came to you via perl v5.40.0, dated 2024-09-16 πβ¨π take care of your trees, mwah π
π¦ where this page comes from
- ubuntu resolute: libmath-symbolic-perl 0.613-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmath-symbolic-perl 0.613-1 Β· 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