Package jebl.evolution.distances
Class BasicDistanceMatrix
java.lang.Object
jebl.evolution.distances.BasicDistanceMatrix
- All Implemented Interfaces:
DistanceMatrix
- Direct Known Subclasses:
F84DistanceMatrix
,HKYDistanceMatrix
,JukesCantorDistanceMatrix
,SequenceAlignmentsDistanceMatrix
,TamuraNeiDistanceMatrix
- Version:
- $Id: BasicDistanceMatrix.java 842 2007-11-12 22:33:48Z twobeers $
- Author:
- Andrew Rambaut, Alexei Drummond
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getDistance
(int row, int column) Gets the distance at a particular row and columndouble
getDistance
(Taxon taxonRow, Taxon taxonColumn) Gets the distance between 2 taxadouble[][]
Gets a 2-dimensional array containing the distancesint
getSize()
Gets the size of the matrix (which is square), i.e., number of rows or columns.getSubmatrix
(Collection<Taxon> taxonSubset) Gets a sub-matrix for only those taxa in the collection (all of which should be present in this matrix).getTaxa()
-
Constructor Details
-
BasicDistanceMatrix
-
-
Method Details
-
getSize
public int getSize()Gets the size of the matrix (which is square), i.e., number of rows or columns.- Specified by:
getSize
in interfaceDistanceMatrix
- Returns:
- the size
-
getTaxa
- Specified by:
getTaxa
in interfaceDistanceMatrix
- Returns:
- the list of taxa that the state values correspond to.
-
getDistance
public double getDistance(int row, int column) Gets the distance at a particular row and column- Specified by:
getDistance
in interfaceDistanceMatrix
- Parameters:
row
- the row indexcolumn
- the column index- Returns:
- the distance
-
getDistance
Gets the distance between 2 taxa- Specified by:
getDistance
in interfaceDistanceMatrix
- Parameters:
taxonRow
-taxonColumn
-- Returns:
- the distance
-
getSubmatrix
Gets a sub-matrix for only those taxa in the collection (all of which should be present in this matrix).- Specified by:
getSubmatrix
in interfaceDistanceMatrix
- Parameters:
taxonSubset
-- Returns:
- the new submatrix
-
getDistances
public double[][] getDistances()Gets a 2-dimensional array containing the distances- Specified by:
getDistances
in interfaceDistanceMatrix
- Returns:
- the distances
-