private final static NumberFormat PHYLIP_FORMATTER = new DecimalFormat(
"0.000000"); // straight from forester
- private final MatrixI jalviewMatrix;
- private final Sequence[] sequences;
+ private Sequence[] sequences;
+
+ private int width;
+
+ private int height;
private final double[][] values;
+ private String[] identifiers;
+
public ForesterMatrix(MatrixI jalviewInputMatrix,
Sequence[] matrixSequences)
{
- this.jalviewMatrix = jalviewInputMatrix;
+ width = jalviewInputMatrix.width();
+ height = jalviewInputMatrix.height();
+ values = new double[width][height];
+
this.sequences = matrixSequences;
- if (jalviewMatrix.width() != jalviewMatrix.height())
+
+ if (width != height)
{
// some kind of warning?
}
- values = new double[jalviewMatrix.width()][jalviewMatrix.height()];
+
}
+
@Override
public String getIdentifier(int i)
{
@Override
public int getSize()
{
- return jalviewMatrix.width();
+ return values.length;
}
@Override
public double getValue(int col, int row)
{
- return jalviewMatrix.getValue(row, col);
+ return values[row][col];
}
@Override
@Override
public void setValue(int col, int row, double distance)
{
- jalviewMatrix.setValue(row, col, distance);
+ values[row][col] = distance;
}
public double[][] getValues()
{
- return null;
+ return values;
}
@Override