NAME
Math::Symbolic::Operator - Operators in symbolic calculations
SYNOPSIS
use Math::Symbolic;
DESCRIPTION
EXPORT
None by default.
METHODS
Constructor new
Expects a hash reference as first argument. That hash's contents will be treated as key-value pairs of object attributes.
Special case: if no hash reference was found, first argument is assumed to be the operator's symbol and the operator is assumed to be binary. The following 2 arguments will be treated as operands. This special case will ignore attempts to clone objects.
Returns a Math::Symbolic::Operator.
Method arity
Returns the operator's arity as an integer.
Method type
Optional integer argument that sets the operator's type. Returns the operator's type as an integer.
Method to_string
Returns a string representation of the operator and its operands. Optional argument: 'prefix' or 'infix'. Defaults to 'infix'.
Method term_type
Returns the type of the term. ( T_OPERATOR )
Method simplify
Term simpilification.
Method op1 and op2
Returns first/second operand of the operator if it exists or undef.
Method apply
Applies the operation to its operands' value() and returns the result as a constant (-object).
Method value
For operators, value() is just a wrapper around apply().
Method apply_derivatives
If the operator is a derivative, this applies the derivative to its 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).
AUTHOR
Steffen Mueller, <symbolic-module at steffen-mueller dot net>