| 1 | package Graph::Maker::CircularLadder; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use Carp qw/croak/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use base qw/Graph::Maker/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | ▶ | use Graph; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | ▶ | use Graph::Maker; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | ▶ | use Graph::Maker::Ladder; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 2 | our $VERSION = '0.01'; | |||||||||
| 12 | |||||||||||
| 13 | sub init | ||||||||||
| 14 | 2 | ▶ | { | ||||||||
|
Subroutine
init: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 15 | 2 | my ($self, %params) = @_; | |||||||||
| 16 | |||||||||||
| 17 | 2 | my $r = $params{rungs}; | |||||||||
| 18 | |||||||||||
| 19 | 2 | my $g = new Graph::Maker('ladder', %params); | |||||||||
| 20 | |||||||||||
| 21 | 2 | ▶ | return if $r == 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | |||||||||||
| 23 | 2 | $g->add_edge(1, $r); | |||||||||
| 24 | 2 | ▶ | $g->add_edge($r, 1) unless $g->is_undirected(); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 2 | $g->add_edge($r+1, 2*$r); | |||||||||
| 26 | 2 | ▶ | $g->add_edge(2*$r, $r+1) unless $g->is_undirected(); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | |||||||||||
| 28 | 2 | return $g; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 2 | Graph::Maker->add_factory_type( 'circular_ladder' => __PACKAGE__ ); | |||||||||
| 32 | |||||||||||
| 33 | 2 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __DATA__ | ||||||||||