Rev | Line | |
---|
[1572] | 1 | package de.ugoe.cs.autoquest.tasktrees.alignment.matrix; |
---|
[1570] | 2 | |
---|
| 3 | |
---|
[1572] | 4 | |
---|
[1702] | 5 | public class UPGMAMatrix extends StaticTriangleMatrix { |
---|
[1572] | 6 | |
---|
| 7 | public UPGMAMatrix(int size) { |
---|
[1570] | 8 | super(size); |
---|
| 9 | } |
---|
[1572] | 10 | |
---|
| 11 | public int size() { |
---|
| 12 | return size; |
---|
| 13 | } |
---|
| 14 | |
---|
| 15 | public String toString() { |
---|
| 16 | String result = ""; |
---|
| 17 | for (int i = 0; i < size; i++) { |
---|
| 18 | result = result + String.format("%8d", i); |
---|
| 19 | } |
---|
| 20 | result += "\n"; |
---|
| 21 | |
---|
| 22 | for (int i = 0; i < size; i++) { |
---|
| 23 | for(int j = 0; j< size; j++) { |
---|
| 24 | if(i<j) { |
---|
| 25 | if(Double.isInfinite(this.get(i,j))) { |
---|
| 26 | result = result + " -------"; |
---|
| 27 | } |
---|
| 28 | else { |
---|
| 29 | result = result + String.format("%+8.2f",this.get(i,j)); |
---|
| 30 | } |
---|
| 31 | } |
---|
| 32 | else { |
---|
| 33 | result = result + (" "); |
---|
| 34 | } |
---|
| 35 | } |
---|
| 36 | result = result + " " + i + "\n"; |
---|
| 37 | } |
---|
| 38 | return result; |
---|
| 39 | } |
---|
| 40 | |
---|
[1571] | 41 | |
---|
[1570] | 42 | |
---|
| 43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.