source: branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/matrix/UPGMAMatrix.java @ 1734

Last change on this file since 1734 was 1734, checked in by rkrimmel, 10 years ago

Added automatically created javadoc, still needs to be commented properly though

File size: 1.1 KB
Line 
1/*
2 *
3 */
4package de.ugoe.cs.autoquest.tasktrees.alignment.matrix;
5
6// TODO: Auto-generated Javadoc
7/**
8 * The Class UPGMAMatrix.
9 */
10public class UPGMAMatrix extends StaticTriangleMatrix {
11
12        /**
13         * Instantiates a new UPGMA matrix.
14         *
15         * @param size the size
16         */
17        public UPGMAMatrix(int size) {
18                super(size);
19        }
20
21        /* (non-Javadoc)
22         * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.StaticTriangleMatrix#size()
23         */
24        @Override
25        public int size() {
26                return size;
27        }
28
29        /* (non-Javadoc)
30         * @see de.ugoe.cs.autoquest.tasktrees.alignment.matrix.StaticTriangleMatrix#toString()
31         */
32        @Override
33        public String toString() {
34                String result = "";
35                for (int i = 0; i < size; i++) {
36                        result = result + String.format("%8d", i);
37                }
38                result += "\n";
39
40                for (int i = 0; i < size; i++) {
41                        for (int j = 0; j < size; j++) {
42                                if (i < j) {
43                                        if (Double.isInfinite(this.get(i, j))) {
44                                                result = result + " -------";
45                                        } else {
46                                                result = result
47                                                                + String.format("%+8.2f", this.get(i, j));
48                                        }
49                                } else {
50                                        result = result + ("        ");
51                                }
52                        }
53                        result = result + "   " + i + "\n";
54                }
55                return result;
56        }
57
58}
Note: See TracBrowser for help on using the repository browser.