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