line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Math::SymbolicX::Calculator::Command::DerivativeApplication; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
12
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
6
|
1
|
|
|
1
|
|
4
|
use Params::Util qw/_INSTANCE/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
7
|
1
|
|
|
1
|
|
4
|
use base 'Math::SymbolicX::Calculator::Command'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
228
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
0
|
|
|
0
|
1
|
|
my $proto = shift; |
13
|
0
|
|
0
|
|
|
|
my $class = ref($proto)||$proto; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my %args = @_; |
16
|
0
|
|
|
|
|
|
my $self = bless { |
17
|
|
|
|
|
|
|
symbol => $args{symbol}, |
18
|
|
|
|
|
|
|
level => $args{level}, |
19
|
|
|
|
|
|
|
} => $class; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
return $self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _execute { |
25
|
0
|
|
|
0
|
|
|
my $self = shift; |
26
|
0
|
|
|
|
|
|
my $c = shift; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $sym = $self->{symbol}; |
29
|
0
|
|
|
|
|
|
my $lvl = $self->{level}; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
my $func = $c->{stash}{$sym}; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
if (_INSTANCE($func, 'Math::Symbolic::Custom::Transformation')) { |
34
|
0
|
|
|
|
|
|
return "Cannot apply derivatives to a transformation '$sym'"; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
|
|
|
$func = $func->apply_derivatives(defined($lvl) ? $lvl : ()); |
38
|
0
|
|
|
|
|
|
$c->{stash}{$sym} = $func; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return($sym, '==', $func); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |