line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
=encoding utf8 |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
Math::Symbolic::Custom - Aggregate class for tree tests and transformations |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 SYNOPSIS |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Extending the class: |
11
|
|
|
|
|
|
|
package Math::Symbolic::Custom::MyTransformations; |
12
|
|
|
|
|
|
|
use Math::Symbolic::Custom::Base; |
13
|
|
|
|
|
|
|
BEGIN {*import = \&Math::Symbolic::Custom::Base::aggregate_import} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $Aggregate_Export = [qw/apply_transformation1 .../]; |
16
|
|
|
|
|
|
|
sub apply_transformation1 { |
17
|
|
|
|
|
|
|
# ... |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
# ... |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Using the custom class: |
22
|
|
|
|
|
|
|
use Math::Symbolic; |
23
|
|
|
|
|
|
|
use Math::Symbolic::Custom::MyTransformations; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# later... |
26
|
|
|
|
|
|
|
$tree->apply_transformation1(); |
27
|
|
|
|
|
|
|
$tree->mod_transformation2(); |
28
|
|
|
|
|
|
|
die unless $tree->is_type1(); |
29
|
|
|
|
|
|
|
die unless $tree->test_condition1(); |
30
|
|
|
|
|
|
|
die if $tree->contains_something1(); |
31
|
|
|
|
|
|
|
print $tree->to_latex(); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
This is an aggregate class for all custom modification, transformation, |
36
|
|
|
|
|
|
|
testing and output extensions for Math::Symbolic trees. |
37
|
|
|
|
|
|
|
Some default transformations and tests are implemented in the |
38
|
|
|
|
|
|
|
Math::Symbolic::Custom::DefaultMods and |
39
|
|
|
|
|
|
|
Math::Symbolic::Custom::DefaultTests packages, default output |
40
|
|
|
|
|
|
|
routines in Math::Symbolic::Custom::DefaultDumpers which are automatically |
41
|
|
|
|
|
|
|
loaded by the Math::Symbolic::Custom class. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Math::Symbolic::Custom imports all constants from |
44
|
|
|
|
|
|
|
Math::Symbolic::ExportConstants |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 EXPORT |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
None by default. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
package Math::Symbolic::Custom; |
53
|
|
|
|
|
|
|
|
54
|
23
|
|
|
23
|
|
412
|
use 5.006; |
|
23
|
|
|
|
|
86
|
|
|
23
|
|
|
|
|
948
|
|
55
|
23
|
|
|
23
|
|
149
|
use strict; |
|
23
|
|
|
|
|
48
|
|
|
23
|
|
|
|
|
774
|
|
56
|
23
|
|
|
23
|
|
120
|
use warnings; |
|
23
|
|
|
|
|
51
|
|
|
23
|
|
|
|
|
613
|
|
57
|
|
|
|
|
|
|
|
58
|
23
|
|
|
23
|
|
117
|
use Carp; |
|
23
|
|
|
|
|
112
|
|
|
23
|
|
|
|
|
1621
|
|
59
|
|
|
|
|
|
|
|
60
|
23
|
|
|
23
|
|
132
|
use Math::Symbolic::ExportConstants qw/:all/; |
|
23
|
|
|
|
|
57
|
|
|
23
|
|
|
|
|
7023
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
our $VERSION = '0.612'; |
63
|
|
|
|
|
|
|
our $AUTOLOAD; |
64
|
|
|
|
|
|
|
|
65
|
23
|
|
|
23
|
|
15139
|
use Math::Symbolic::Custom::DefaultTests; |
|
23
|
|
|
|
|
68
|
|
|
23
|
|
|
|
|
222
|
|
66
|
23
|
|
|
23
|
|
16934
|
use Math::Symbolic::Custom::DefaultMods; |
|
23
|
|
|
|
|
71
|
|
|
23
|
|
|
|
|
289
|
|
67
|
23
|
|
|
23
|
|
14432
|
use Math::Symbolic::Custom::DefaultDumpers; |
|
23
|
|
|
|
|
65
|
|
|
23
|
|
|
|
|
175
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
__END__ |