public static RRaw doubleToRaw( RDouble value, ConversionStatus warn) { // eager to keep error semantics eager int size = value.size(); byte[] content = new byte[size]; for (int i = 0; i < size; i++) { double dval = value.getDouble(i); content[i] = Convert.double2raw(dval, warn); } return RRaw.RRawFactory.getFor(content, value.dimensions(), value.names()); }
public static RInt double2int( RDouble value, ConversionStatus warn) { // eager to keep error semantics eager int size = value.size(); int[] content = new int[size]; for (int i = 0; i < size; i++) { double d = value.getDouble(i); content[i] = Convert.double2int(d, warn); } return RInt.RIntFactory.getFor(content, value.dimensions(), value.names()); }
@Override public byte getRaw(int i) { return Convert.double2raw(orig.getDouble(i)); }
@Override public int getLogical(int i) { return Convert.double2logical(orig.getDouble(i)); }
@Override public int getInt(int i) { return Convert.double2int(orig.getDouble(i)); }
@Override public String getString(int i) { return Convert.double2string(orig.getDouble(i)); }