当前位置: 首页>>代码示例>>Java>>正文


Java UnsafeUtils.set8方法代码示例

本文整理汇总了Java中water.util.UnsafeUtils.set8方法的典型用法代码示例。如果您正苦于以下问题:Java UnsafeUtils.set8方法的具体用法?Java UnsafeUtils.set8怎么用?Java UnsafeUtils.set8使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在water.util.UnsafeUtils的用法示例。


在下文中一共展示了UnsafeUtils.set8方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CUDChunk

import water.util.UnsafeUtils; //导入方法依赖的package包/类
CUDChunk(byte[] bs, HashMap<Long,Byte> hs, int len) {
  _start = -1;
  numUniques = hs.size();
  set_len(len);
  _mem = MemoryManager.malloc1(computeByteSize(numUniques, _len), false);
  UnsafeUtils.set4(_mem, 0, _len);
  UnsafeUtils.set4(_mem, 4, numUniques);
  int j=0;
  //create the mapping and also store the unique values (as longs)
  for (Map.Entry<Long,Byte> e : hs.entrySet()) {
    e.setValue(new Byte((byte)(j-128))); //j is in 0...256  -> byte value needs to be in -128...127 for storage
    UnsafeUtils.set8(_mem, 8 + (j << 3), e.getKey());
    j++;
  }
  // store the mapping
  for (int i=0; i<len; ++i)
    UnsafeUtils.set1(_mem, 8 + (numUniques << 3) + i, hs.get(Double.doubleToLongBits(UnsafeUtils.get8d(bs, i << 3))));
}
 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:19,代码来源:CUDChunk.java

示例2: bufS

import water.util.UnsafeUtils; //导入方法依赖的package包/类
private byte[] bufS(int len, int id_sz, int val_sz,boolean na_sparse){
  long NA = CXIChunk.NA(val_sz);
  int elem_size = id_sz+val_sz;
  byte [] res = MemoryManager.malloc1(CXIChunk._OFF + _sparseLen*elem_size);
  UnsafeUtils.set4(res,0,len);
  res[4] = (byte)id_sz;
  res[5] = (byte)val_sz;
  res[6] = na_sparse?(byte)1:0;
  if(na_sparse)res[6] = (byte)1;
  for(int i = 0; i < _sparseLen; ++i){
    if(id_sz == 2) UnsafeUtils.set2(res,CXIChunk._OFF+i*elem_size+0,(short)_id[i]);
    else UnsafeUtils.set4(res,CXIChunk._OFF+i*elem_size+0,_id[i]);
    long val = isNA2(i)?NA:_ms.get(i);
    switch(val_sz){
      case 0: break; // no value store dfor binary chunks
      case 2: UnsafeUtils.set2(res,CXIChunk._OFF+i*elem_size+id_sz,(short)val); break;
      case 4: UnsafeUtils.set4(res,CXIChunk._OFF+i*elem_size+id_sz,(int)val); break;
      case 8: UnsafeUtils.set8(res,CXIChunk._OFF+i*elem_size+id_sz,val); break;
      default: throw H2O.unimpl();
    }
  }
  return res;
}
 
开发者ID:h2oai,项目名称:h2o-3,代码行数:24,代码来源:NewChunk.java

示例3: atomic

import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override public Value atomic( Value val ) {
  byte[] bits1 = val.memOrLoad();
  long l1 = UnsafeUtils.get8(bits1, 0);
  long l2 = UnsafeUtils.get8(bits1,8);
  l1 += 2;
  l2 += 2;
  byte[] bits2 = new byte[16];
  UnsafeUtils.set8(bits2,0,l1);
  UnsafeUtils.set8(bits2,8,l2);
  return new Value(_key,bits2);
}
 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:12,代码来源:KVTest.java

示例4: CSChunk

import water.util.UnsafeUtils; //导入方法依赖的package包/类
CSChunk( byte[] bs, long bias, int scale, int szLog) {
  _mem = bs;
  _start = -1;
  set_len((_mem.length - _OFF) >> szLog);
  _bias = bias;
  UnsafeUtils.set8(_mem, 0, bias);
  UnsafeUtils.set4(_mem, 8, scale);
  _scale = PrettyPrint.pow10(1,scale);
  UnsafeUtils.set4(_mem,12,szLog);
}
 
开发者ID:h2oai,项目名称:h2o-3,代码行数:11,代码来源:CSChunk.java

示例5: intern

import water.util.UnsafeUtils; //导入方法依赖的package包/类
public static H2ONode intern( byte[] bs, int off ) {
  byte[] b = new byte[H2Okey.SIZE_OF_IP]; // the size depends on version of selected IP stack
  int port;
  // The static constant should be optimized
  if (!H2O.IS_IPV6) { // IPv4
    UnsafeUtils.set4(b, 0, UnsafeUtils.get4(bs, off));
  } else { // IPv6
    UnsafeUtils.set8(b, 0, UnsafeUtils.get8(bs, off));
    UnsafeUtils.set8(b, 8, UnsafeUtils.get8(bs, off + 8));
  }
  port = UnsafeUtils.get2(bs,off + H2Okey.SIZE_OF_IP) & 0xFFFF;
  try { return intern(InetAddress.getByAddress(b),port); } 
  catch( UnknownHostException e ) { throw Log.throwErr(e); }
}
 
开发者ID:h2oai,项目名称:h2o-3,代码行数:15,代码来源:H2ONode.java

示例6: C2SChunk

import water.util.UnsafeUtils; //导入方法依赖的package包/类
C2SChunk( byte[] bs, long bias, double scale ) { _mem=bs; _start = -1; set_len((_mem.length-_OFF)>>1);
  _bias = bias; _scale = scale;
  UnsafeUtils.set8d(_mem, 0, scale);
  UnsafeUtils.set8 (_mem,8,bias );
}
 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:6,代码来源:C2SChunk.java

示例7: C1SChunk

import water.util.UnsafeUtils; //导入方法依赖的package包/类
C1SChunk( byte[] bs, long bias, double scale ) { _mem=bs; _start = -1; set_len(_mem.length-_OFF);
  _bias = bias; _scale = scale;
  UnsafeUtils.set8d(_mem, 0, scale);
  UnsafeUtils.set8 (_mem,8,bias );
}
 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:6,代码来源:C1SChunk.java

示例8: C4SChunk

import water.util.UnsafeUtils; //导入方法依赖的package包/类
C4SChunk( byte[] bs, long bias, double scale ) { _mem=bs; _start = -1; set_len((_mem.length - _OFF) >> 2);
  _bias = bias; _scale = scale;
  UnsafeUtils.set8d(_mem,0,scale);
  UnsafeUtils.set8 (_mem,8,bias );
}
 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:6,代码来源:C4SChunk.java

示例9: C0LChunk

import water.util.UnsafeUtils; //导入方法依赖的package包/类
public C0LChunk(long con, int len) { _mem=new byte[_OFF]; _start = -1; set_len(len);
  _con = con;
  UnsafeUtils.set8(_mem, 0, con);
  UnsafeUtils.set4(_mem,8,len);
}
 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:6,代码来源:C0LChunk.java

示例10: printx16

import water.util.UnsafeUtils; //导入方法依赖的package包/类
static public String printx16( long lo, long hi ) {
  UnsafeUtils.set8(pbuf, 0, lo);
  UnsafeUtils.set8(pbuf, 8, hi);
  return udp.UDPS[(int)(lo&0xFF)]._udp.print16(new AutoBuffer(pbuf));
}
 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:6,代码来源:UDP.java

示例11: set_impl

import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override boolean set_impl(int i, long lo, long hi) {
  if (isNA(lo, hi)) throw new IllegalArgumentException("Illegal uid value");
  UnsafeUtils.set8(_mem, i*16,     lo);
  UnsafeUtils.set8(_mem, i*16 + 8, hi);
  return true;
}
 
开发者ID:h2oai,项目名称:h2o-3,代码行数:7,代码来源:C16Chunk.java

示例12: setNA_impl

import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override boolean setNA_impl(int idx) { UnsafeUtils.set8(_mem,(idx<<3),_NA); return true; } 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:2,代码来源:C8Chunk.java

示例13: setNA_impl

import water.util.UnsafeUtils; //导入方法依赖的package包/类
@Override boolean setNA_impl(int idx) { UnsafeUtils.set8(_mem, (idx << 4), _LO_NA); UnsafeUtils.set8(_mem,(idx<<4),_HI_NA); return true; } 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:2,代码来源:C16Chunk.java


注:本文中的water.util.UnsafeUtils.set8方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。