GSP
Quick Navigator

Search Site

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

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MATH::SYMBOLIC::CUSTOM::SIMPLIFICATION (3)

.ds Aq ’

NAME

Math::Symbolic::Custom::Simplification - User defined simplification routines

CONTENTS

SYNOPSIS



  package Math::Symbolic::Custom::MySimplification;
 
  use base Math::Symbolic::Custom::Simplification;
 
  sub simplify {
    my $tree = shift;
    # ... simplify tree ...
    return $simplified;
  }
 
  1;
 
  # Then, in another portion of your code.
 
  Math::Symbolic::Custom::MySimplification->register();
 
  # Code that uses MySimplification:
  # $tree->simplify() invokes
  # Math::Symbolic::Custom::MySimplification::simplify($tree).
 
  Math::Symbolic::Custom::MySimplification->unregister();
 
  # Code that uses the default simplification routines or whichever
  # simplification routines where registered before.



DESCRIPTION

This module is an extension to the Math::Symbolic module. A basic familiarity with that module is required.

Math::Symbolic offers some builtin simplification routines. These, however, are not capable of complex simplifications. This extension offers facilities to override the default simplification routines through means of subclassing this module. A subclass of this module is required to define a simplify object method that implements a simplification of Math::Symbolic trees.

There are two class methods to inherit: register and unregister. Calling the register method on your subclass registers your class as providing the simplify method that is invoked whenever simplify() is called on a Math::Symbolic::Operator object.

Calling unregister on your subclass restores whichever simplification routines where in place before.

Several subsequent register() and c<unregister()> calls on different subclasses can be used to localize simplification routines. The old routines are saved to a stack.

If there are several subclasses of this module, say MySimplification and MyOtherSimplification, calling MySimplification-register()>, then MyOtherSimplification-register()> will finally provide the simplification routines of MyOtherSimplification. Unregistering MyOtherSimplification revert to the routine from MySimplification.

If you unregister out of order (i.e. in the above example if you unregistered MySimplification instead of MyOtherSimplification), all simplification routines up to and including the one you’re unregistering are removed and the one that was in effect before MySimplification (here: the default simplify()) is restored.

    EXPORT

This module does not export anything.

    METHODS

register A class method to register the simplify() subroutine of the class as the new Math::Symbolic simplification rotuine.
unregister A class method to unregister the aformentioned simplification routine.

SEE ALSO

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

Math::Symbolic

Math::Symbolic::Operator which contains the default simplification routines.

Math::Symbolic::Custom and Math::Symbolic::Custom::Base for details on enhancing Math::Symbolic.

AUTHOR

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

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Steffen Mueller

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 172: Non-ASCII character seen before =encoding in ’Mueller,’. Assuming ISO8859-1
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MATH::SYMBOLIC::CUSTOM::SIMPLIFICATION (3) 2005-10-04

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