| 1 | package # hide from PAUSE/MetaCPAN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | PDL::PP::Signature; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 6 | ▶ | use strict; use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 6 | ▶ | use PDL::PP::PdlParObj; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 6 | ▶ | use PDL::PP::Dims; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | PDL::PP::Signature - Internal module to handle signatures | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | Internal module to handle signatures | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | use PDL::PP::Signature; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | # Eliminate whitespace entries | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 471 | ▶ | sub nospacesplit {grep /\S/, split $_[0],$_[1]} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
nospacesplit: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 236 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=8 SCAR=20.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 236 | my ($type,$pars,$opname,$otherpars,$otherparsdefaults,$argorder) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 236 | ▶ | confess "$opname ArgOrder given defined but false value" if defined $argorder and !$argorder; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $argorder and not $argorder
MC/DC0%0/2
defined $argorder and not $argorder
defined $argorder
not $argorder
Truth table66%2/3
A and not(B)
A= defined $argorderB= not $argorder
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 236 | my @objects = map PDL::PP::PdlParObj->new($_, $opname), nospacesplit ';',$pars; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 235 | ▶ | my $this = bless { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$otherparsdefaults || {}
MC/DC100%1/1
$otherparsdefaults || {}
$otherparsdefaults
Truth table100%2/2
A
A= $otherparsdefaults
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | Names=>[map $_->name, @objects], Objects=>{map +($_->name => $_), @objects}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | OtherParsDefaults=>$otherparsdefaults||{}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | ArgOrder=>$argorder, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | }, $type; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 235 | my @objects_sorted = ((grep !$_->{FlagW}, @objects), (grep $_->{FlagW}, @objects)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 235 | $objects_sorted[$_]{Number} = $_ for 0..$#objects_sorted; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 235 | $this->{NamesSorted} = [ map $_->name, @objects_sorted ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 235 | $this->{DimsObj} = my $dimsobj = PDL::PP::PdlDimsObj->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 235 | $_->add_inds($dimsobj) for @objects; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 235 | ▶ | @$this{qw(OtherNames OtherObjs OtherAnyOut OtherFlags)} = $this->_otherPars_nft($otherpars||'', $opname); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$otherpars || ''
MC/DC100%1/1
$otherpars || ''
$otherpars
Truth table100%2/2
A
A= $otherpars
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 234 | $this->_validate($opname); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 230 | my $i=0; $dimsobj->ind_obj($_)->set_index($i++) for sort $dimsobj->ind_names; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 230 | $this; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 234 | ▶ | sub _validate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_validate: called CC=15 SCAR=27.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 234 | my ($sig, $name) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 234 | my ($argorder, $otherdefaults) = @$sig{qw(ArgOrder OtherParsDefaults)}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 234 | ▶ | if (!$argorder and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not $argorder and keys %$otherdefaults != (my(@other_args) = @{$sig->{"OtherNames"};})
MC/DC100%2/2
not $argorder and keys %$otherdefaults != (my(@other_args) = @{$sig->{"OtherNames"};})
not $argorder
keys %$otherdefaults != (my(@other_args) = @{$sig->{"OtherNames"};})
Truth table100%3/3
not(A) and B
A= not $argorderB= keys %$otherdefaults != (my(@other_args) = @{$sig->{"OtherNames"};})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 222 | keys(%$otherdefaults) != (my @other_args = @{ $sig->{OtherNames} }) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 34 | my $default_seen = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 34 | for (@other_args) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 59 | ▶ | $default_seen = $_ if exists $otherdefaults->{$_}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | confess "$name got default-less arg '$_' after default-ful arg '$default_seen'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 59 | ▶ | if $default_seen and !exists $otherdefaults->{$_}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$default_seen and not exists $otherdefaults->{$_}
MC/DC100%2/2
$default_seen and not exists $otherdefaults->{$_}
$default_seen
not exists $otherdefaults->{$_}
Truth table100%3/3
A and not(B)
A= $default_seenB= not exists $otherdefaults->{$_}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 233 | ▶ | if ($argorder and ref $argorder) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$argorder and ref $argorder
MC/DC100%2/2
$argorder and ref $argorder
$argorder
ref $argorder
Truth table100%3/3
A and B
A= $argorderB= ref $argorder
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 6 | my @names = @{ $sig->allnames(1, 1) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 6 | my %namehash = map +($_=>1), @names; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 6 | delete @namehash{@$argorder}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 6 | ▶ | confess "$name ArgOrder missed params: ".join(' ', keys %namehash) if keys %namehash; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 5 | my %orderhash = map +($_=>1), @$argorder; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 5 | delete @orderhash{@names}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 5 | ▶ | confess "$name ArgOrder too many params: ".join(' ', keys %orderhash) if keys %orderhash; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 4 | my %optionals = map +($_=>1), keys(%$otherdefaults), $sig->names_out, $sig->other_out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 4 | my $optional = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 4 | for (@$argorder) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 17 | ▶ | $optional = $_, next if exists $optionals{$_}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | confess "$name got mandatory argument '$_' after optional argument '$optional'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 12 | ▶ | if $optional and !exists $optionals{$_}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$optional and not exists $optionals{$_}
MC/DC50%1/2
$optional and not exists $optionals{$_}
$optional
not exists $optionals{$_}
Truth table66%2/3
A and not(B)
A= $optionalB= not exists $optionals{$_}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 235 | ▶ | sub _otherPars_nft { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_otherPars_nft: called CC=14 SCAR=27.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 235 | my ($sig,$otherpars,$opname) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 235 | ▶ | my $dimobjs = $sig && $sig->dims_obj; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$sig && $sig->dims_obj
MC/DC0%0/2
$sig && $sig->dims_obj
$sig
$sig->dims_obj
Truth table33%1/3
A && B
A= $sigB= $sig->dims_obj
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 235 | my (@names,%types,$type,$any_out,%allflags); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 235 | for (nospacesplit(';',$otherpars)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 85 | my (%flags); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 85 | ▶ | if (s/^\s*$PDL::PP::PdlParObj::sqbr_re\s*//) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 18 | %flags = my %lflags = map +($_=>1), split /\s*,\s*/, my $opts = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 18 | ▶ | croak "pp_def($opname): Can't have both [io] and [o]" if $lflags{o} && $lflags{io}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$lflags{"o"} and $lflags{"io"}
MC/DC0%0/2
$lflags{"o"} and $lflags{"io"}
$lflags{"o"}
$lflags{"io"}
Truth table66%2/3
A and B
A= $lflags{"o"}B= $lflags{"io"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 18 | ▶ | my $this_out = delete($lflags{o}) || delete($lflags{io}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
delete $lflags{'o'} || delete $lflags{'io'}
MC/DC0%0/2
delete $lflags{'o'} || delete $lflags{'io'}
delete $lflags{'o'}
delete $lflags{'io'}
Truth table66%2/3
A || B
A= delete $lflags{'o'}B= delete $lflags{'io'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 18 | ▶ | croak "pp_def($opname): Invalid options '$opts' in '$_'" if keys %lflags; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 18 | ▶ | $any_out ||= $this_out; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$any_out ||= $this_out
MC/DC0%0/2
$any_out ||= $this_out
$any_out
$this_out
Truth table66%2/3
A ||= B
A= $any_outB= $this_out
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 85 | ▶ | if (/^\s*([^=]+?)\s*=>\s*(\S+)\s*$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | # support 'int ndim => n;' syntax | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 2 | my ($ctype,$dim) = ($1,$2); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 2 | ▶ | print "OtherPars: setting dim '$dim' from '$ctype'\n" if $::PP_VERBOSE; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 2 | $type = PDL::PP::CType->new($ctype); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 2 | $dimobjs->get_indobj_make($dim)->set_from($type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 83 | $type = PDL::PP::CType->new($_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 85 | my $name = $type->protoname; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 85 | ▶ | confess "pp_def($opname): '$name' given in both Pars and OtherPars" if $sig->{Objects}{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | croak "pp_def($opname): Invalid OtherPars name: $name" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 85 | ▶ | if $PDL::PP::PdlParObj::INVALID_PAR{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 84 | push @names,$name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 84 | $types{$name} = $type; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 84 | ▶ | $types{"${name}_count"} = PDL::PP::CType->new("PDL_Indx ${name}_count") if $type->is_array; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 84 | $allflags{$name} = \%flags; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 234 | (\@names,\%types,$any_out,\%allflags); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | Copyright (C) Tuomas J. Lukka 1997 (lukka@husc.harvard.edu) and by Christian | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | Soeller (c.soeller@auckland.ac.nz). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | All rights reserved. There is no warranty. You are allowed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | to redistribute this software / documentation under certain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | conditions. For details, see the file COPYING in the PDL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | distribution. If this file is separated from the PDL distribution, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | the copyright notice should be included in the file. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 6 | ▶ | sub names { $_[0]{Names} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
names: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 73 | ▶ | sub names_sorted { $_[0]{NamesSorted} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
names_sorted: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 62 | ▶ | sub names_sorted_tuples { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
names_sorted_tuples: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 62 | my ($count, @names) = (0, @{$_[0]{NamesSorted}}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 62 | map [$count++, $_[0]{Objects}{$_}{FlagTemp}, $_], @names; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 935 | ▶ | sub objs { $_[0]{Objects} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
objs: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 276 | ▶ | sub names_in { my $o=$_[0]->objs; grep !$o->{$_}{FlagOut} && !$o->{$_}{FlagTemp}, @{$_[0]{Names}} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
names_in: called CC=2 SCAR=7.0
Pod
undocumented
Condition66%2/3
$o->{$_}{'FlagOut'} || $o->{$_}{'FlagTemp'}
MC/DC50%1/2
$o->{$_}{'FlagOut'} || $o->{$_}{'FlagTemp'}
$o->{$_}{'FlagOut'}
$o->{$_}{'FlagTemp'}
Truth table66%2/3
A || B
A= $o->{$_}{'FlagOut'}B= $o->{$_}{'FlagTemp'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 157 | ▶ | sub names_out { my $o=$_[0]->objs; grep $o->{$_}{FlagOut}, @{$_[0]{Names}} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
names_out: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 204 | ▶ | sub names_oca { my $o=$_[0]->objs; grep $o->{$_}{FlagCreateAlways}, @{$_[0]{Names}} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
names_oca: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 125 | ▶ | sub names_out_nca { my $o=$_[0]->objs; grep $o->{$_}{FlagOut} && !$o->{$_}{FlagCreateAlways}, @{$_[0]{Names}} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
names_out_nca: called CC=2 SCAR=6.9
Pod
undocumented
Condition100%3/3
$o->{$_}{'FlagOut'} && !$o->{$_}{'FlagCreateAlways'}
MC/DC100%2/2
$o->{$_}{'FlagOut'} && !$o->{$_}{'FlagCreateAlways'}
$o->{$_}{'FlagOut'}
!$o->{$_}{'FlagCreateAlways'}
Truth table100%3/3
A && not(B)
A= $o->{$_}{'FlagOut'}B= !$o->{$_}{'FlagCreateAlways'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | sub names_tmp { my $o=$_[0]->objs; grep $o->{$_}{FlagTemp}, @{$_[0]{Names}} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
names_tmp: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 317 | ▶ | sub dims_obj { $_[0]->{DimsObj} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dims_obj: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 59 | ▶ | sub dims_init { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dims_init: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 59 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | join "\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | (sort map $_->get_initdim, $self->{DimsObj}->ind_fromcomp), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 59 | (sort map $_->get_initdim, $self->{DimsObj}->ind_notfromcomp); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 1824 | ▶ | sub othernames { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
othernames: called CC=11 SCAR=24.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 1824 | my ($self, $omit_count, $with_xs, $except) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 1824 | ▶ | $except ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$except ||= {}
MC/DC100%1/1
$except ||= {}
$except
Truth table100%2/2
A
A= $except
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 1824 | ▶ | return $self->{OtherNames} if $omit_count && $omit_count > 0 && !keys %$except && $with_xs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition77%7/9
$omit_count and $omit_count > 0 and not keys %$except and $with_xs
$omit_count and $omit_count > 0 and not keys %$except
$omit_count and $omit_count > 0
MC/DC50%2/4
$omit_count and $omit_count > 0 and not keys %$except and $with_xs
$omit_count
$omit_count > 0
not keys %$except
$with_xs
Truth table60%3/5
A and B and not(C) and D
A= $omit_countB= $omit_count > 0C= not keys %$exceptD= $with_xs
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 1303 | ▶ | return [] if $omit_count && $omit_count < 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$omit_count and $omit_count < 0
MC/DC0%0/2
$omit_count and $omit_count < 0
$omit_count
$omit_count < 0
Truth table66%2/3
A and B
A= $omit_countB= $omit_count < 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 1303 | my $objs = $self->otherobjs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 1303 | my @raw_names = grep !$except->{$_}, @{$self->{OtherNames}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 1303 | ▶ | @raw_names = map $objs->{$_}->is_array ? ($_, "${_}_count") : $_, @raw_names if !$omit_count; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 1303 | ▶ | @raw_names = grep !$objs->{$_}{WasDollar}, @raw_names if !$with_xs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 1303 | \@raw_names; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 2795 | ▶ | sub otherobjs { $_[0]{OtherObjs} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
otherobjs: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 34 | ▶ | sub other_any_out { $_[0]{OtherAnyOut} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_any_out: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 1009 | ▶ | sub other_is_flag { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_is_flag: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 1009 | my $flag = $_[2]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 1009 | my $has_count = (my $without_count = $_[1]) =~ s/_count$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 1009 | ▶ | return $_[0]{OtherFlags}{$_[1]} && $_[0]{OtherFlags}{$_[1]}{$flag} if !$has_count; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$_[0]{'OtherFlags'}{$_[1]} && $_[0]{'OtherFlags'}{$_[1]}{$flag}
MC/DC100%2/2
$_[0]{'OtherFlags'}{$_[1]} && $_[0]{'OtherFlags'}{$_[1]}{$flag}
$_[0]{'OtherFlags'}{$_[1]}
$_[0]{'OtherFlags'}{$_[1]}{$flag}
Truth table100%3/3
A && B
A= $_[0]{'OtherFlags'}{$_[1]}B= $_[0]{'OtherFlags'}{$_[1]}{$flag}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 25 | ▶ | $_[0]{OtherFlags}{$without_count} && $_[0]{OtherFlags}{$without_count}{$flag}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 382 | ▶ | sub other_is_output { &other_is_out || &other_is_io } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_is_output: called CC=2 SCAR=6.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 567 | ▶ | sub other_is_out { $_[0]->other_is_flag($_[1], 'o') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_is_out: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 321 | ▶ | sub other_out { grep $_[0]->other_is_out($_), @{$_[0]{OtherNames}} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_out: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 442 | ▶ | sub other_is_io { $_[0]->other_is_flag($_[1], 'io') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_is_io: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 186 | ▶ | sub other_io { grep $_[0]->other_is_io($_), @{$_[0]{OtherNames}} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_io: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 450 | ▶ | sub allnames { my ($self, $omit_count, $with_xs, $except) = @_; [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
allnames: called CC=5 SCAR=19.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | ($omit_count && $omit_count < 0) ? (grep $self->{Objects}{$_}{FlagCreateAlways}, @{$self->{Names}}) : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
$except && $except->{$_} || $self->{'Objects'}{$_}{'FlagTemp'}
$except and $except->{$_}
MC/DC0%0/3
$except && $except->{$_} || $self->{'Objects'}{$_}{'FlagTemp'}
$except
$except->{$_}
$self->{'Objects'}{$_}{'FlagTemp'}
Truth table20%1/5
A and B || C
A= $exceptB= $except->{$_}C= $self->{'Objects'}{$_}{'FlagTemp'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 450 | (grep +(!$except || !$except->{$_}) && !$self->{Objects}{$_}{FlagTemp}, @{$self->{Names}}), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 450 | ▶ | @{$self->othernames(@_[1..3])}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$omit_count and $omit_count < 0
MC/DC0%0/2
$omit_count and $omit_count < 0
$omit_count
$omit_count < 0
Truth table66%2/3
A and B
A= $omit_countB= $omit_count < 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | ] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 124 | ▶ | sub allobjs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
allobjs: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 124 | my $pdltype = PDL::PP::CType->new("pdl *__foo__"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 124 | +{ ( map +($_,$pdltype), @{$_[0]{Names}} ), %{$_[0]->otherobjs} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 124 | ▶ | sub alldecls { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
alldecls: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 124 | my ($self, $omit_count, $indirect, $with_xs, $except) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 124 | my $objs = $self->allobjs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 124 | my @names = @{$self->allnames($omit_count, $with_xs, $except)}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 124 | ▶ | $indirect = $indirect ? { map +($_=>$self->other_is_output($_)), @names } : {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 124 | map $objs->{$_}->get_decl($_, {VarArrays2Ptrs=>1,AddIndirect=>$indirect->{$_}}), @names; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 72 | ▶ | sub getcomp { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getcomp: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 72 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 72 | my $objs = $self->otherobjs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 72 | my @names = @{$self->othernames(0)}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 72 | my $indirect = { map +($_=>$self->other_is_output($_)), @names }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 72 | join "\n", map " $_;", grep $_, map $objs->{$_}->get_decl($_, {VarArrays2Ptrs=>1,AddIndirect=>$indirect->{$_}}), @names; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 118 | ▶ | sub getfree { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getfree: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 118 | my ($self,$symbol) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 118 | my $objs = $self->otherobjs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | join '', map $objs->{$_}->get_free("\$$symbol($_)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 118 | { VarArrays2Ptrs => 1 }), @{$self->othernames(0)}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 62 | ▶ | sub getcopy { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getcopy: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 62 | my ($self, $to_pat) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 62 | my $objs = $self->otherobjs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 62 | PDL::PP::indent(2, join '', map $objs->{$_}->get_copy($_,sprintf $to_pat,$_)."\n", @{$self->othernames(0)}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 144 | ▶ | sub args_callorder { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
args_callorder: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 144 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 144 | my $argorder = $self->{ArgOrder}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 144 | ▶ | return $self->allnames(1, 1) if !$argorder; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 10 | ▶ | return $argorder if ref $argorder; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 6 | my $otherdefaults = $self->{OtherParsDefaults}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 6 | my %optionals = map +($_=>1), keys(%$otherdefaults); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | my @other_mand = grep !$optionals{$_} && !$self->other_is_out($_), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 6 | ▶ | my @other = @{$self->othernames(1, 1)}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$optionals{$_} || $self->other_is_out($_)
MC/DC100%2/2
$optionals{$_} || $self->other_is_out($_)
$optionals{$_}
$self->other_is_out($_)
Truth table100%3/3
A || B
A= $optionals{$_}B= $self->other_is_out($_)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 6 | my @other_opt = grep $optionals{$_}, @other; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 6 | [$self->names_in, @other_mand, @other_opt, $self->names_out, $self->other_out]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 10 | ▶ | sub realdims { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
realdims: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 10 | my $this = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 10 | [ map scalar @{$this->{Objects}{$_}{RawInds}}, @{$this->{Names}} ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 10 | ▶ | sub creating { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
creating: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 10 | my $this = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | confess "you must perform a checkdims before calling creating" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 10 | ▶ | unless defined $this->{Create}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 10 | return $this->{Create}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 12 | ▶ | sub checkdims { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
checkdims: called CC=9 SCAR=22.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 12 | my $this = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | # we have to recreate to keep defaults currently | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 12 | $this->{Dims} = PDL::PP::PdlDimsObj->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 12 | $this->{Objects}{$_}->add_inds($this->{Dims}) for @{$this->{Names}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 12 | my $n = @{$this->{Names}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 12 | ▶ | confess "not enough pdls to match signature" unless $#_ >= $n-1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 12 | my @pdls = @_[0..$n-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 12 | ▶ | if ($PDL::debug) { print "args: ". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | join(' ,',map { "[".join(',',$_->dims)."]," } @pdls) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | . "\n"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 12 | my $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | my @creating = map $this->{Objects}{$_}->perldimcheck($pdls[$i++]), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 12 | @{$this->{Names}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 10 | $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 10 | for (@{$this->{Names}}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 27 | ▶ | push @creating, $this->{Objects}{$_}->getcreatedims | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | if $creating[$i++]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 10 | $this->{Create} = \@creating; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 10 | $i = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 10 | my $corr = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 10 | for (@{$this->{Names}}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 27 | $corr = $this->{Objects}{$_}->finalcheck($pdls[$i++]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 27 | ▶ | next unless $#$corr>-1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 1 | my ($j,$str) = (0,""); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 1 | for (@$corr) {$str.= ":,"x($_->[0]-$j)."(0),*$_->[1],"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 1 | $j=$_->[0]+1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 1 | chop $str; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 1 | $_[$i-1] = $pdls[$i-1]->slice($str); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 6 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||