The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Math::Symbolic::Custom::DefaultMods - Default Math::Symbolic transformations

SYNOPSIS

  use Math::Symbolic;

DESCRIPTION

This is a class of default transformations for Math::Symbolic trees. Likewise, Math::Symbolic::Custom::DefaultTests defines default tree testing routines. For details on how the custom method delegation model works, please have a look at the Math::Symbolic::Custom and Math::Symbolic::Custom::Base classes.

EXPORT

Please see the docs for Math::Symbolic::Custom::Base for details, but you should not try to use the standard Exporter semantics with this class.

SUBROUTINES

apply_derivatives()

Never modifies the tree in-place, but returns a modified copy of the original tree instead.

Applied to variables and constants, this method just clones.

Applied to operators and if the operator is a derivative, this applies the derivative to the derivative's first operand.

Regardless what kind of operator this is called on, apply_derivatives will be applied recursively on its operands.

If the first parameter to this function is an integer, at maximum that number of derivatives are applied (from top down the tree if possible).

apply_constant_fold()

Does not modify the tree in-place by default, but returns a modified copy of the original tree instead. If the first argument is true, the tree will not be cloned. If it is false or not existant, the tree will be cloned.

Applied to variables and constants, this method just clones.

Applied to operators, all tree segments that contain constants and operators only will be replaced with Constant objects.

AUTHOR

Steffen Mueller, <symbolic-module at steffen-mueller dot net>

New versions of this module can be found on http://steffen-mueller.net or CPAN.

SEE ALSO

Math::Symbolic::Custom Math::Symbolic::Custom::DefaultTests Math::Symbolic