line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Math::Matlab; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
112
|
|
4
|
3
|
|
|
3
|
|
15
|
use vars qw($VERSION $Revision); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
240
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
BEGIN { |
7
|
3
|
|
|
3
|
|
7
|
$VERSION = '0.08'; |
8
|
3
|
|
|
|
|
12003
|
$Revision = sprintf "%d.%03d", q$Revision: 1.9 $ =~ /: (\d+)\.(\d+)/; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
##----- Public Class Methods ----- |
12
|
0
|
|
|
0
|
0
|
0
|
sub new { die "Unable to create instance of abstract class " . __PACKAGE__; }; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
##----- Public Object Methods ----- |
15
|
0
|
|
|
0
|
1
|
0
|
sub execute { die "Abstract method execute() must be overridden." }; |
16
|
0
|
|
|
0
|
1
|
0
|
sub err_msg { my $self = shift; return $self->_getset('err_msg', @_); } |
|
0
|
|
|
|
|
0
|
|
17
|
0
|
|
|
0
|
0
|
0
|
sub clear_err_msg { return $_[0]->{err_msg} = undef; } |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub get_result { |
20
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
0
|
my ($result) = $self->{'result'} =~ /-----MATLAB-BEGIN-----\n-----SUCCESS\n(.*)/s; |
23
|
|
|
|
|
|
|
# $result =~ s/EDU>> //g; ##Êremove edu prompts |
24
|
|
|
|
|
|
|
# $result =~ s/>> //g; ## remove normal prompts |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
0
|
return $result; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub fetch_result { |
30
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
31
|
0
|
|
|
|
|
0
|
my $result = $self->get_result; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
0
|
$self->{'result'} = ''; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
0
|
return $result; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
1
|
0
|
sub get_raw_result { return $_[0]->{'result'}; } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub fetch_raw_result { |
41
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
42
|
0
|
|
|
|
|
0
|
my $result = $self->get_raw_result; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
0
|
$self->{'result'} = ''; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
0
|
return $result; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
##----- Private Object Methods ----- |
50
|
|
|
|
|
|
|
sub _getset { |
51
|
7
|
|
|
7
|
|
13
|
my ($self, $field, $val) = @_; |
52
|
7
|
50
|
|
|
|
34
|
$self->{$field} = $val if defined($val); |
53
|
7
|
|
|
|
|
36
|
return $self->{$field}; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
__END__ |