-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCluster.php
More file actions
39 lines (32 loc) · 975 Bytes
/
Copy pathCluster.php
File metadata and controls
39 lines (32 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Created by PhpStorm.
* User: muntashir
* Date: 9/28/17
* Time: 10:24 PM
*/
namespace PHPPhylogeneticTrees;
/**
* Class Cluster
*
* The abstract class of clusters or rooted trees
*
* @package PHPPhylogeneticTrees
*/
abstract class Cluster{
/** @var int Cluster identifier */
protected $lab;
/** @var int|array Advanced cluster identifier */
protected $label;
/** @var int The number of sequences in the cluster */
protected $card;
/** @var Cluster|null Left and right children, or null */
protected $left, $right;
/** @var double[] Distances to lower-numbered nodes, or null */
protected $d_matrix = [];
public function alive() { return $this->d_matrix !== null; }
public function kill() { $this->d_matrix = null; }
public function getValue($index){ return $this->d_matrix[$index]; }
public function getLabel(){ return $this->label; }
public function getCard(){ return $this->card; }
}