@SuppressWarnings("unchecked") private FastTable<Float64Vector> getRowsTable() { if (rows == null) { rows = (FastTable<Float64Vector>) ReflectionUtil.extractPrivateField(Float64Matrix.class, matrix, "_rows"); } return rows; }
private boolean getTransposed() { if (transposed == null) { transposed = (Boolean) ReflectionUtil.extractPrivateField(Float64Matrix.class, matrix, "_transposed"); } return transposed; }
private boolean getTransposed() { if (transposed == null) { transposed = (Boolean) ReflectionUtil.extractPrivateField(Float64Matrix.class, matrix, "_transposed"); } return transposed; }
@SuppressWarnings("unchecked") private FastTable<Float64Vector> getRowsTable() { if (rows == null) { rows = (FastTable<Float64Vector>) ReflectionUtil.extractPrivateField(Float64Matrix.class, matrix, "_rows"); } return rows; }
public static Object extractPrivateField(Object o, String fieldName) { return extractPrivateField(o.getClass(), o, fieldName); }
public int size() { try { prepareWriter(); return (int) (long) (Long) ReflectionUtil.extractPrivateField(MapFile.Writer.class, writer, "size"); } catch (Exception e) { throw new RuntimeException("could not query size", e); } }
public void setDouble(double value, long row, long column) { if (getTransposed()) { Float64Vector f = getRowsTable().get((int) column); double[] data = (double[]) ReflectionUtil.extractPrivateField(f, "_values"); data[(int) row] = value; } else { Float64Vector f = getRowsTable().get((int) row); double[] data = (double[]) ReflectionUtil.extractPrivateField(f, "_values"); data[(int) column] = value; } }
public void setDouble(double value, int row, int column) { if (getTransposed()) { Float64Vector f = getRowsTable().get(column); double[] data = (double[]) ReflectionUtil.extractPrivateField(Float64Vector.class, f, "_values"); data[row] = value; } else { Float64Vector f = getRowsTable().get(row); double[] data = (double[]) ReflectionUtil.extractPrivateField(Float64Vector.class, f, "_values"); data[column] = value; } }
public void setDouble(double value, int row, int column) { if (getTransposed()) { Float64Vector f = getRowsTable().get(column); double[] data = (double[]) ReflectionUtil.extractPrivateField(Float64Vector.class, f, "_values"); data[row] = value; } else { Float64Vector f = getRowsTable().get(row); double[] data = (double[]) ReflectionUtil.extractPrivateField(Float64Vector.class, f, "_values"); data[column] = value; } }
public void setDouble(double value, long row, long column) { if (getTransposed()) { Float64Vector f = getRowsTable().get((int) column); double[] data = (double[]) ReflectionUtil.extractPrivateField(f, "_values"); data[(int) row] = value; } else { Float64Vector f = getRowsTable().get((int) row); double[] data = (double[]) ReflectionUtil.extractPrivateField(f, "_values"); data[(int) column] = value; } }