$distmatrix=[[] , [0.25], [0.25,0.5], [1,0.75,0.75]]
####
$main::hd=[[]];
$main::a = [0.25];
$main::b = [0.25,0.5];
$main::c = [1,0.75,0.75];
push @{main::hd}, [@main::a];
push @{main::hd}, [@main::b];
push @{main::hd}, [@main::c];
####
#!/usr/bin/perl
#ex2
use warnings;
use strict;
sub clust;
$main::hd=[[]];
$main::a = [0.25];
$main::b = [0.25,0.5];
$main::c = [1,0.75,0.75];
push @{main::hd}, [@main::a];
push @{main::hd}, [@main::b];
push @{main::hd}, [@main::c];
$main::hdt = 0.4;
&clust;
for ($loop::i=0; $loop::i<=3; $loop::i++)
{
print $clust::cluster_ids->[$loop::i], "\n";
}
sub clust {
use Algorithm::Cluster::Thresh;
use Algorithm::Cluster qw/treecluster/;
$clust::tree = treecluster(data=>$main::hd, method=>'a');
$clust::cluster_ids = $clust::tree->cutthresh($main::hdt);
}
####
#!/usr/bin/perl
#ex2
use warnings;
use strict;
sub clust;
$main::hd=[[] , [0.25], [0.25,0.5], [1,0.75,0.75]];
$main::hdt = 0.4;
&clust;
for ($loop::i=0; $loop::i<=3; $loop::i++)
{
print $clust::cluster_ids->[$loop::i], "\n";
}
sub clust {
use Algorithm::Cluster::Thresh;
use Algorithm::Cluster qw/treecluster/;
$clust::tree = treecluster(data=>$main::hd, method=>'a');
$clust::cluster_ids = $clust::tree->cutthresh($main::hdt);
}
####
1
1
1
0