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::Base - Base class for symbols in symbolic calculations

SYNOPSIS

  use Math::Symbolic::Base;

DESCRIPTION

This is a base class for all Math::Symbolic::* terms such as Math::Symbolic::Operator, Math::Symbolic::Variable and Math::Symbolic::Constant objects.

EXPORT

None by default.

METHODS

Method to_string

Default method for stringification just returns the object's value.

Method value

value() evaluates the Math::Symbolic tree to its numeric representation.

value() without arguments requires that every variable in the tree contains a defined value attribute. Please note that this refers to every variable object, not just every named variable.

value() with one argument sets the object's value.

value() with named arguments (key/value pairs) associates variables in the tree with the value-arguments if the corresponging key matches the variable name. (Can one say this any more complicated?)

Example: $tree->value(x => 1, y => 2, z => 3, t => 0) assigns the value 1 to any occurrances of variables of the name "x", aso.

Method set_value

set_value() returns nothing.

set_value() requires named arguments (key/value pairs) that associate variable names of variables in the tree with the value-arguments if the corresponging key matches the variable name. (Can one say this any more complicated?)

Example: $tree->set_value(x => 1, y => 2, z => 3, t => 0) assigns the value 1 to any occurrances of variables of the name "x", aso.

As opposed to value(), set_value() assigns to the variables permanently and does not evaluate the tree.

Method simplify

Minimum method for term simpilification just clones.

Method apply_derivatives

Minimum method for application of derivatives just clones.

Method term_type

Returns the type of the term. This is a stub to be overridden.

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