| 1 | # Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Kevin Ryde | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | # This file is part of Math-PlanePath. | ||||||||||||||||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||||||||||||||||
| 5 | # Math-PlanePath is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 6 | # it under the terms of the GNU General Public License as published by the | ||||||||||||||||||||||||||||||||||||||||||
| 7 | # Free Software Foundation; either version 3, or (at your option) any later | ||||||||||||||||||||||||||||||||||||||||||
| 8 | # version. | ||||||||||||||||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||||||||||||||||
| 10 | # Math-PlanePath is distributed in the hope that it will be useful, but | ||||||||||||||||||||||||||||||||||||||||||
| 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||||||||||||||||||||||||||||||||||||||||||
| 12 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||||||||||||||||||||||||||||||||||||||||||
| 13 | # for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 14 | # | ||||||||||||||||||||||||||||||||||||||||||
| 15 | # You should have received a copy of the GNU General Public License along | ||||||||||||||||||||||||||||||||||||||||||
| 16 | # with Math-PlanePath. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | # Maybe: | ||||||||||||||||||||||||||||||||||||||||||
| 20 | # including_zero=>1 to have 0/1 for A038567 | ||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | package Math::PlanePath::DiagonalRationals; | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 7 | ▶ | use 5.004; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 7 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 7 | ▶ | use Carp 'croak'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | #use List::Util 'max'; | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 7 | *max = \&Math::PlanePath::_max; | |||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | 7 | ▶ | use vars '$VERSION', '@ISA'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | 7 | $VERSION = 128; | |||||||||||||||||||||||||||||||||||||||||
| 32 | 7 | ▶ | use Math::PlanePath; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 7 | @ISA = ('Math::PlanePath'); | |||||||||||||||||||||||||||||||||||||||||
| 34 | 7 | *_rect_for_first_quadrant = \&Math::PlanePath::_rect_for_first_quadrant; | |||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | use Math::PlanePath::Base::Generic | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 7 | 'is_infinite', | |||||||||||||||||||||||||||||||||||||||||
| 38 | 7 | ▶ | 'round_nearest'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | 7 | ▶ | use Math::PlanePath::CoprimeColumns; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | 7 | *_extend = \&Math::PlanePath::CoprimeColumns::_extend; | |||||||||||||||||||||||||||||||||||||||||
| 42 | 7 | *_coprime = \&Math::PlanePath::CoprimeColumns::_coprime; | |||||||||||||||||||||||||||||||||||||||||
| 43 | 7 | ▶ | use vars '@_x_to_n'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | 7 | *_x_to_n = \@Math::PlanePath::CoprimeColumns::_x_to_n; | |||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | # uncomment this to run the ### lines | ||||||||||||||||||||||||||||||||||||||||||
| 47 | # use Smart::Comments; | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | 7 | use constant parameter_info_array => | |||||||||||||||||||||||||||||||||||||||||
| 51 | [ { name => 'direction', | ||||||||||||||||||||||||||||||||||||||||||
| 52 | share_key => 'direction_downup', | ||||||||||||||||||||||||||||||||||||||||||
| 53 | display => 'Direction', | ||||||||||||||||||||||||||||||||||||||||||
| 54 | type => 'enum', | ||||||||||||||||||||||||||||||||||||||||||
| 55 | default => 'down', | ||||||||||||||||||||||||||||||||||||||||||
| 56 | choices => ['down','up'], | ||||||||||||||||||||||||||||||||||||||||||
| 57 | choices_display => ['Down','Up'], | ||||||||||||||||||||||||||||||||||||||||||
| 58 | description => 'Number points downwards or upwards along the diagonals.', | ||||||||||||||||||||||||||||||||||||||||||
| 59 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 60 | Math::PlanePath::Base::Generic::parameter_info_nstart1(), | ||||||||||||||||||||||||||||||||||||||||||
| 61 | 7 | ▶ | ]; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 7 | ▶ | use constant default_n_start => 1; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | 7 | ▶ | use constant class_x_negative => 0; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | 7 | ▶ | use constant class_y_negative => 0; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 7 | ▶ | use constant n_frac_discontinuity => .5; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 7 | ▶ | use constant x_minimum => 1; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 68 | 7 | ▶ | use constant y_minimum => 1; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 7 | ▶ | use constant gcdxy_maximum => 1; # no common factor | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | sub absdx_minimum { | ||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
absdx_minimum: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | return ($self->{'direction'} eq 'down' ? 0 : 1); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||
| 75 | sub absdy_minimum { | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
absdy_minimum: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | return ($self->{'direction'} eq 'down' ? 1 : 0); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 7 | ▶ | use constant dsumxy_minimum => 0; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | 7 | ▶ | use constant dsumxy_maximum => 1; # to next diagonal stripe | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||
| 82 | sub dir_minimum_dxdy { | ||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dir_minimum_dxdy: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | return ($self->{'direction'} eq 'down' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | ? (0,1) # North | ||||||||||||||||||||||||||||||||||||||||||
| 86 | : (1,0)); # East | ||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||
| 88 | sub dir_maximum_dxdy { | ||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dir_maximum_dxdy: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | return ($self->{'direction'} eq 'down' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | ? (1,-1) # South-East | ||||||||||||||||||||||||||||||||||||||||||
| 92 | : (2,-1)); # ESE at N=3 down to X axis | ||||||||||||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||
| 95 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||
| 97 | sub new { | ||||||||||||||||||||||||||||||||||||||||||
| 98 | 2 | ▶ | my $self = shift->SUPER::new (@_); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=5 SCAR=17.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | 2 | ▶ | if (! defined $self->{'n_start'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | 1 | $self->{'n_start'} = $self->default_n_start; | |||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||
| 103 | 2 | ▶ | my $direction = ($self->{'direction'} ||= 'down'); | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{"direction"} ||= "down"
MC/DC0%0/1
$self->{"direction"} ||= "down"
$self->{"direction"}
Truth table50%1/2
A
A= $self->{"direction"}
| |||||||||||||||||||||||||||||||||||||||||||
| 104 | 2 | ▶ | if (! ($direction eq 'up' || $direction eq 'down')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$direction eq "up" or $direction eq "down"
MC/DC0%0/2
$direction eq "up" or $direction eq "down"
$direction eq "up"
$direction eq "down"
Truth table33%1/3
A or B
A= $direction eq "up"B= $direction eq "down"
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | croak "Unrecognised direction option: ", $direction; | |||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | 2 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||
| 111 | sub n_to_xy { | ||||||||||||||||||||||||||||||||||||||||||
| 112 | 21 | ▶ | my ($self, $n) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
n_to_xy: called CC=3 SCAR=11.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 113 | ### DiagonalRationals n_to_xy(): $n | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | 21 | ▶ | if (2*($n - $self->{'n_start'}) < -1) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | ### before n_start ... | ||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | 21 | ▶ | my ($x,$y) = $self->Math::PlanePath::CoprimeColumns::n_to_xy($n+1) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | or return; | ||||||||||||||||||||||||||||||||||||||||||
| 121 | ### CoprimeColumns returned: "x=$x y=$y" | ||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | 21 | $x -= $y; | |||||||||||||||||||||||||||||||||||||||||
| 124 | ### shear to: "x=$x y=$y" | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | 21 | return ($x,$y); | |||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | # Note: shared by FactorRationals | ||||||||||||||||||||||||||||||||||||||||||
| 130 | sub xy_is_visited { | ||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | my ($self, $x, $y) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
xy_is_visited: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | $x = round_nearest ($x); | |||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | $y = round_nearest ($y); | |||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | if ($x < 1 | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$x < 1 or $y < 1 or not _coprime($x, $y)
$x < 1 or $y < 1
MC/DC0%0/3
$x < 1 or $y < 1 or not _coprime($x, $y)
$x < 1
$y < 1
not _coprime($x, $y)
Truth table0%0/4
A or B or not(C)
A= $x < 1B= $y < 1C= not _coprime($x, $y)
| |||||||||||||||||||||||||||||||||||||||||||
| 135 | || $y < 1 | ||||||||||||||||||||||||||||||||||||||||||
| 136 | || ! _coprime($x,$y)) { | ||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | sub xy_to_n { | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 5646 | ▶ | my ($self, $x, $y) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
xy_to_n: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | ### DiagonalRationals xy_to_n(): "$x,$y" | ||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | 5646 | my $n = Math::PlanePath::CoprimeColumns::xy_to_n($self,$x+$y,$y); | |||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||
| 148 | # not the N=0 at Xcol=1,Ycol=1 which is Xdiag=1,Ydiag=0 | ||||||||||||||||||||||||||||||||||||||||||
| 149 | 5646 | ▶ | if (defined $n && $n > $self->{'n_start'}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $n and $n > $self->{"n_start"}
MC/DC100%2/2
defined $n and $n > $self->{"n_start"}
defined $n
$n > $self->{"n_start"}
Truth table100%3/3
A and B
A= defined $nB= $n > $self->{"n_start"}
| |||||||||||||||||||||||||||||||||||||||||||
| 150 | 2028 | return $n-1; | |||||||||||||||||||||||||||||||||||||||||
| 151 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 3618 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||
| 156 | # not exact | ||||||||||||||||||||||||||||||||||||||||||
| 157 | sub rect_to_n_range { | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 23 | ▶ | my ($self, $x1,$y1, $x2,$y2) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
rect_to_n_range: called CC=7 SCAR=20.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | ### DiagonalRationals rect_to_n_range(): "$x1,$y1 $x2,$y2" | ||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||
| 161 | 23 | $x1 = round_nearest($x1); | |||||||||||||||||||||||||||||||||||||||||
| 162 | 23 | $y1 = round_nearest($y1); | |||||||||||||||||||||||||||||||||||||||||
| 163 | 23 | $x2 = round_nearest($x2); | |||||||||||||||||||||||||||||||||||||||||
| 164 | 23 | $y2 = round_nearest($y2); | |||||||||||||||||||||||||||||||||||||||||
| 165 | 23 | ▶ | ($x1,$x2) = ($x2,$x1) if $x1 > $x2; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | 23 | ▶ | ($y1,$y2) = ($y2,$y1) if $y1 > $y2; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||
| 168 | 23 | ▶ | if ($x2 < 1 || $y2 < 1) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$x2 < 1 or $y2 < 1
MC/DC0%0/2
$x2 < 1 or $y2 < 1
$x2 < 1
$y2 < 1
Truth table33%1/3
A or B
A= $x2 < 1B= $y2 < 1
| |||||||||||||||||||||||||||||||||||||||||||
| 169 | ### outside quadrant ... | ||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | return (1, 0); | |||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | ### rect: "$x1,$y1 $x2,$y2" | ||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | 23 | my $d2 = $x2 + $y2 + 1; | |||||||||||||||||||||||||||||||||||||||||
| 176 | 23 | ▶ | if (is_infinite($d2)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | return (1, $d2); | |||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||
| 179 | 23 | ▶ | while ($#_x_to_n < $d2) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | 192 | _extend(); | |||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||
| 182 | 23 | my $d1 = max (2, $x1 + $y1); | |||||||||||||||||||||||||||||||||||||||||
| 183 | ### $d1 | ||||||||||||||||||||||||||||||||||||||||||
| 184 | ### $d2 | ||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | return ($_x_to_n[$d1] - 1 + $self->{'n_start'}, | ||||||||||||||||||||||||||||||||||||||||||
| 187 | 23 | $_x_to_n[$d2] + $self->{'n_start'}); | |||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||
| 190 | 7 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 191 | __END__ | ||||||||||||||||||||||||||||||||||||||||||