|
NAMEMath::Symbolic::Custom::Transformation::Group - Group of TransformationsSYNOPSISuse Math::Symbolic::Custom::Transformation qw/:all/; use Math::Symbolic qw/parse_from_string/; my $group = new_trafo_group( ',', new_trafo( 'TREE_x ^ 1' => 'TREE_x' ), new_trafo( 'TREE_x ^ CONST_a' => 'TREE_x * TREE_x^value{CONST_a-1}' ), ); my $function = parse_from_string( '(foo+1)^3 + bar^2' ); while(1) { my $result = $group->apply_recursive($function); last if not defined $result; $function = $result; } print $function."\n" # prints "((foo + 1) * ((foo + 1) * (foo + 1))) + (bar * bar)" DESCRIPTIONA "Math::Symbolic::Custom::Transformation::Group" object (Trafo Group for now) represents a conjunction of several transformations and is a transformation itself. An example is in order here:my $group = new_trafo_group( ',', $trafo1, $trafo2, ... ); Now, $group can be applied to Math::Symbolic trees as if it was an ordinary transformation object itself. In fact it is, because this is a subclass of Math::Symbolic::Custom::Transformation. The first argument to the constructor specifies the condition under which the grouped transformations are applied. ',' is the simplest form. It means that all grouped transformations are always applied. '&' means that the next transformation will only be applied if the previous one succeeded. Finally, '|' means that the first transformation to succeed is the last that is tried. '&' and '|' are "and" and "or" operators if you will. EXPORTNone by default, but you may choose to import the "new_trafo_group" subroutine as an alternative constructor for "Math::Symbolic::Custom::Transformation::Group" objects.METHODSThis is a list of public methods.
SUBROUTINESThis is a list of public subroutines.
SEE ALSONew versions of this module can be found on http://steffen-mueller.net or CPAN.This module uses the Math::Symbolic framework for symbolic computations. Math::Symbolic::Custom::Pattern implements the pattern matching routines. AUTHORSteffen Müller, <symbolic-module at steffen-mueller dot net>COPYRIGHT AND LICENSECopyright (C) 2006, 2007, 2008, 2013 by Steffen MuellerThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.1 or, at your option, any later version of Perl 5 you may have available.
Visit the GSP FreeBSD Man Page Interface. |