/** * {@inheritDoc} */ public synchronized void setRow(int row, double[] values) { m.setRow(row, values); }
/** * {@inheritDoc} */ public void setColumn(int column, double[] values) { m.setRow(column, values); }
/** * {@inheritDoc} */ public synchronized void setRow(int row, double[] values) { m.setRow(row, values); }
/** * {@inheritDoc} */ public void setColumn(int column, double[] values) { m.setRow(column, values); }
/** * {@inheritDoc} */ public void setColumn(int column, DoubleVector values) { m.setRow(column, values); }
/** * {@inheritDoc} */ public synchronized void setRow(int row, DoubleVector values) { m.setRow(row, values); }
/** * {@inheritDoc} */ public synchronized void setRow(int row, DoubleVector values) { m.setRow(row, values); }
/** * {@inheritDoc} */ public void setColumn(int column, DoubleVector values) { m.setRow(column, values); }
/** * {@inheritDoc} */ public void setRow(int row, DoubleVector values) { backingMatrix.setRow(getRealRow(row), values); }
/** * {@inheritDoc} */ public void setRow(int row, double[] columns) { backingMatrix.setRow(getRealRow(row), columns); }
/** * {@inheritDoc} */ public void setRow(int row, double[] columns) { backingMatrix.setRow(getRealRow(row), columns); }
/** * {@inheritDoc} */ public void setRow(int row, DoubleVector values) { backingMatrix.setRow(getRealRow(row), values); }
/** * Loads the {@link SemanticSpace} from the binary formatted file, adding * its words to {@link #termToIndex} and returning the {@code Matrix} * containing the space's vectors. * * @param sspaceFile a file in {@link SSpaceFormat#BINARY binary} format */ private Matrix loadBinary(InputStream fileStream) throws IOException { DataInputStream dis = new DataInputStream(fileStream); int rows = dis.readInt(); int cols = dis.readInt(); // create a dense matrix Matrix m = new ArrayMatrix(rows, cols); double[] d = new double[cols]; for (int row = 0; row < rows; ++row) { String word = dis.readUTF(); termToIndex.put(word, row); for (int col = 0; col < cols; ++col) { d[col] = dis.readDouble(); } m.setRow(row, d); } return m; }
/** * Loads the {@link SemanticSpace} from the binary formatted file, adding * its words to {@link #termToIndex} and returning the {@code Matrix} * containing the space's vectors. * * @param sspaceFile a file in {@link SSpaceFormat#BINARY binary} format */ private Matrix loadBinary(InputStream fileStream) throws IOException { DataInputStream dis = new DataInputStream(fileStream); int rows = dis.readInt(); int cols = dis.readInt(); // create a dense matrix Matrix m = new ArrayMatrix(rows, cols); double[] d = new double[cols]; for (int row = 0; row < rows; ++row) { String word = dis.readUTF(); termToIndex.put(word, row); for (int col = 0; col < cols; ++col) { d[col] = dis.readDouble(); } m.setRow(row, d); } return m; }
matrix.setRow(index, row); index++;
matrix.setRow(index, row); index++;