Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages
Math::Symbolic::Custom::Contains(3) User Contributed Perl Documentation Math::Symbolic::Custom::Contains(3)

Math::Symbolic::Custom::Contains - Find subtrees in Math::Symbolic expressions

  use Math::Symbolic qw/:all/;
  use Math::Symbolic::Custom::Contains;
  my $formula = parse_from_string('a*b+c');
  print 'found product' if $formula->contains_operator(B_PRODUCT);
  # works
  print 'found division' if $formula->contains_operator(B_DIVISION);

This module extends the functionality of Math::Symbolic by offering facilities to test a Math::Symbolic tree for existance of a specific subtree in the Math::Symbolic tree.
As of version 0.10, this has only been implemented for operators via the contains_operator method.
The module adds methods to all Math::Symbolic objects.

This method does not modify the Math::Symbolic tree itself, but instead tests the tree for existance of an operator of the specified operator type. It returns undef if no such operator exists in the tree and returns a reference to the first occurrance of the operator if there are such operators.
Operator types are constants exported by Math::Symbolic. Please refer to the Math::Symbolic manual for details.
If the operator type is omitted, the match will be performed for any operator. That means if the tree contains any operators at all, a reference to the top-most operator will be returned. (Which will always be the top-most node of the tree anyway.)

Please send feedback, bug reports, and support requests to one of the contributors or the Math::Symbolic mailing list.
List of contributors:
  Steffen MXller, symbolic-module at steffen-mueller dot net

New versions of this module can be found on or CPAN.
Math::Symbolic::Custom, Math::Symbolic::Custom::Base, Math::Symbolic::Custom::DefaultTests
2019-01-01 perl v5.28.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.