| Summary | Package variables | Synopsis | Description | General documentation | Methods |
| Summary | Top |
| Clair::Network::Sample::SampleBase - Abstract class for network sampling |
| Package variables | Top |
| No package variables defined. |
| Included modules | Top |
| Carp |
| Math::Random |
| Synopsis | Top |
| Clair::Network::Sample::SampleBase should not be called directly, but instead inherited from a concrete SampleBase class. |
| Description | Top |
| This object is for sampling networks. |
| Methods | Top |
| get_old_net | Description | Code |
| get_random_edges | No description | Code |
| get_random_nodes | No description | Code |
| get_unique_integers | Description | Code |
| new | No description | Code |
| sample | Description | Code |
| get_old_net | code | next | Top |
| Return the original network |
| get_unique_integers | code | prev | next | Top |
| Return a list of random integers from a uniform distribution with no duplicates. |
| sample | code | prev | next | Top |
| Return a new random network sampled from the original network |
| get_old_net | description | prev | next | Top |
sub get_old_net
{ my $self = shift;
return $self->{oldnet};} |
| get_random_edges | description | prev | next | Top |
sub get_random_edges
{my $self = shift; my $num_edges = shift; my %parameters = @_; my @edges = (); # Allow choosing from a limited set of edges} |
| get_random_nodes | description | prev | next | Top |
sub get_random_nodes
{my $self = shift; my $num_nodes = shift; my %parameters = @_; my @vertices = (); # Allow choosing from a limited set of vertices} |
| get_unique_integers | description | prev | next | Top |
sub get_unique_integers
{ my $self = shift;
my $num = shift;
my $low = shift;
my $high = shift;
my %hash = ();
my $i = 0;
while ($i < $num) {
my $x = random_uniform_integer(1, $low, $high);
if (not defined $hash{$x}) {
$hash{$x} = 1;
$i++;
}
}
return keys %hash;} |
| new | description | prev | next | Top |
sub new
{ my $class = shift;
my $net = shift;
my $self = {};
if (defined $net) {
$self->{oldnet} = $net;
}
bless($self, $class);
return $self;} |
| sample | description | prev | next | Top |
sub sample
{croak "dist_function has not been implemented\n"; return;} |