On Nov 2, 2011, at 10:58 AM, Jake Mannix wrote: > On Wed, Nov 2, 2011 at 7:34 AM, Grant Ingersoll <[email protected]> wrote: > >> What functionality, specifically, are you proposing to remove? > > > I'm suggesting we kill, from Matrix.java and descendents, all of the > following methods: > > Map<String, Integer> getColumnLabelBindings(); > Map<String, Integer> getRowLabelBindings(); > void setColumnLabelBindings(Map<String, Integer> bindings); > void setRowLabelBindings(Map<String, Integer> bindings); > double get(String rowLabel, String columnLabel); > void set(String rowLabel, String columnLabel, double value); > void set(String rowLabel, String columnLabel, int row, int column, double > value); > void set(String rowLabel, double[] rowData); > void set(String rowLabel, int row, double[] rowData); > > >> I know we had a lot of discussion around some of this stuff way back when >> as to how best to do it, but of course, that doesn't mean it has uptake. >> If it's on the Matrix, then doesn't it more easily get shipped around via >> the Writables vs. requiring the user to do that? Not sure it is an issue, >> but it's one less piece of code someone else has to write. > > > MatrixWritable does not, in fact, serialize the labels along with the > matrix, it turns out. There are two methods for (de-)serializing them > separately: > > public static void readLabels(DataInput in, > Map<String, Integer> columnLabelBindings, > Map<String, Integer> rowLabelBindings) > throws IOException; > > public static void writeLabelBindings(DataOutput out, > Map<String, Integer> > columnLabelBindings, > Map<String, Integer> > rowLabelBindings) throws IOException; > > but neither of these are used anywhere in the codebase (even in tests). >
writeMatrix calls them. Line 162 of MatrixWritable.
