Пример #1
0
 // Slow-path append data
 private void append2slowUUID() {
   if (_ds == null && _ls != null) { // This can happen for columns with all NAs and then a UUID
     _xs = null;
     alloc_doubles(sparseLen());
     Arrays.fill(_ls, C16Chunk._LO_NA);
     Arrays.fill(_ds, Double.longBitsToDouble(C16Chunk._HI_NA));
   }
   if (_ls != null && _ls.length > 0) {
     _ls = MemoryManager.arrayCopyOf(_ls, sparseLen() << 1);
     _ds = MemoryManager.arrayCopyOf(_ds, sparseLen() << 1);
   } else {
     alloc_mantissa(4);
     alloc_doubles(4);
   }
   assert sparseLen() == 0 || _ls.length > sparseLen()
       : "_ls.length = " + _ls.length + ", _len = " + sparseLen();
 }
Пример #2
0
 // Slow-path append data
 private void append2slowd() {
   assert _ls == null;
   if (_ds != null && _ds.length > 0) {
     if (_id == null) { // check for sparseness
       int nzs = 0; // assume one non-zero for the element currently being stored
       for (double d : _ds) if (d != 0) ++nzs;
       if ((nzs + 1) * _sparseRatio < _len) set_sparse(nzs);
     } else _id = MemoryManager.arrayCopyOf(_id, sparseLen() << 1);
     _ds = MemoryManager.arrayCopyOf(_ds, sparseLen() << 1);
   } else {
     alloc_doubles(4);
     if (sparse()) alloc_indices(4);
   }
   assert sparseLen() == 0 || _ds.length > sparseLen()
       : "_ds.length = " + _ds.length + ", _len = " + sparseLen();
 }