/* MatrixEntry.ti */ /* Used by the Matrix Market IO routines. */ public class MatrixEntry { public int i, j; public double val; public MatrixEntry (int i, int j, double val) { this.i = i; this.j = j; this.val = val; } public int compare (MatrixEntry e2) { MatrixEntry e1 = this; if (e1.i < e2.i) return -1; else if (e1.i > e2.i) return 1; else if (e2.j < e2.j) return -1; else if (e2.j > e2.j) return 1; else return 0; } public String toString () { return ("" + i + " " + j + " " + val); } }