private void append2slowd() {
    assert _ms==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
        int nonnas = 0;
        for(double d:_ds) {
          if(d != 0)++nzs;
          if(!Double.isNaN(d))++nonnas;
        }
        if((nzs+1)*_sparseRatio < _len) {
          set_sparse(nzs,Compress.ZERO);
          assert _sparseLen == 0 || _sparseLen <= _ds.length:"_sparseLen = " + _sparseLen + ", _ds.length = " + _ds.length + ", nzs = " + nzs +  ", len = " + _len;
          assert _id.length == _ds.length;
          assert _sparseLen <= _len;
          return;
        }
        else if((nonnas+1)*_sparseRatio < _len) {
          set_sparse(nonnas,Compress.NA);
          assert _sparseLen == 0 || _sparseLen <= _ds.length:"_sparseLen = " + _sparseLen + ", _ds.length = " + _ds.length + ", nonnas = " + nonnas +  ", len = " + _len;
          assert _id.length == _ds.length;
          assert _sparseLen <= _len;
          return;
        }
      }
      else {
        // verify we're still sufficiently sparse
        if((_sparseRatio*(_sparseLen) >> 2) > _len)  cancel_sparse();
        else _id = MemoryManager.arrayCopyOf(_id, _sparseLen << 1);
      }
      _ds = MemoryManager.arrayCopyOf(_ds, _sparseLen << 1);
    } else {
      alloc_doubles(4);
      if (_id != null) alloc_indices(4);
    }
    assert _sparseLen == 0 || _ds.length > _sparseLen :"_ds.length = " + _ds.length + ", _sparseLen = " + _sparseLen;
    assert _id == null || _id.length == _ds.length;
    assert _sparseLen <= _len;
  }
private void append2slowd ( ) { assert _ms == null ; if ( _ds != null && _ds . length > 0 ) { if ( _id == null ) { int nzs = 0 ; int nonnas = 0 ; for ( double d : _ds ) { if ( d != 0 ) ++ nzs ; if ( ! Double . isNaN ( d ) ) ++ nonnas ; } if ( ( nzs + 1 ) * _sparseRatio < _len ) { set_sparse ( nzs , Compress . ZERO ) ; assert _sparseLen == 0 || _sparseLen <= _ds . length : "_sparseLen = " + _sparseLen + ", _ds.length = " + _ds . length + ", nzs = " + nzs + ", len = " + _len ; assert _id . length == _ds . length ; assert _sparseLen <= _len ; return ; } else if ( ( nonnas + 1 ) * _sparseRatio < _len ) { set_sparse ( nonnas , Compress . NA ) ; assert _sparseLen == 0 || _sparseLen <= _ds . length : "_sparseLen = " + _sparseLen + ", _ds.length = " + _ds . length + ", nonnas = " + nonnas + ", len = " + _len ; assert _id . length == _ds . length ; assert _sparseLen <= _len ; return ; } } else { if ( ( _sparseRatio * ( _sparseLen ) > > 2 ) > _len ) cancel_sparse ( ) ; else _id = MemoryManager . arrayCopyOf ( _id , _sparseLen << 1 ) ; } _ds = MemoryManager . arrayCopyOf ( _ds , _sparseLen << 1 ) ; } else { alloc_doubles ( 4 ) ; if ( _id != null ) alloc_indices ( 4 ) ; } assert _sparseLen == 0 || _ds . length > _sparseLen : "_ds.length = " + _ds . length + ", _sparseLen = " + _sparseLen ; assert _id == null || _id . length == _ds . length ; assert _sparseLen <= _len ; }
Slow-path append data