Beispiel #1
0
 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());
 }
Beispiel #2
0
 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());
 }
Beispiel #3
0
 @Override
 public byte getRaw(int i) {
   return Convert.double2raw(orig.getDouble(i));
 }
Beispiel #4
0
 @Override
 public int getLogical(int i) {
   return Convert.double2logical(orig.getDouble(i));
 }
Beispiel #5
0
 @Override
 public int getInt(int i) {
   return Convert.double2int(orig.getDouble(i));
 }
Beispiel #6
0
 @Override
 public String getString(int i) {
   return Convert.double2string(orig.getDouble(i));
 }