- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.yahoo.memory.WritableMemory.putDouble()
方法的一些代码示例,展示了WritableMemory.putDouble()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WritableMemory.putDouble()
方法的具体详情如下:
包路径:com.yahoo.memory.WritableMemory
类名称:WritableMemory
方法名:putDouble
[英]Puts the double value at the given offset
[中]将双精度值置于给定偏移量处
代码示例来源:origin: DataSketches/sketches-core
@Override
protected void setValues(final int index, final double[] values) {
long offset = valuesOffset_ + ((long) SIZE_OF_VALUE_BYTES * numValues_ * index);
for (int i = 0; i < numValues_; i++) {
mem_.putDouble(offset, values[i]);
offset += SIZE_OF_VALUE_BYTES;
}
}
代码示例来源:origin: DataSketches/sketches-core
static void insertMaxDouble(final WritableMemory wmem, final double value) {
wmem.putDouble(MAX_DOUBLE, value);
}
}
代码示例来源:origin: DataSketches/sketches-core
static void insertHipAccum(final WritableMemory wmem, final double hipAccum) {
wmem.putDouble(HIP_ACCUM_DOUBLE, hipAccum);
}
代码示例来源:origin: DataSketches/sketches-core
static void insertMinDouble(final WritableMemory wmem, final double value) {
wmem.putDouble(MIN_DOUBLE, value);
}
代码示例来源:origin: DataSketches/sketches-core
static void insertTotalRWeight(final WritableMemory wmem, final double weight) {
wmem.putDouble(TOTAL_WEIGHT_R_DOUBLE, weight);
}
代码示例来源:origin: DataSketches/sketches-core
static void insertOuterTauNumerator(final WritableMemory wmem, final double numer) {
wmem.putDouble(OUTER_TAU_NUM_DOUBLE, numer);
}
代码示例来源:origin: DataSketches/sketches-core
static void insertKxQ0(final WritableMemory wmem, final double kxq0) {
wmem.putDouble(KXQ0_DOUBLE, kxq0);
}
代码示例来源:origin: DataSketches/sketches-core
static void insertKxQ1(final WritableMemory wmem, final double kxq1) {
wmem.putDouble(KXQ1_DOUBLE, kxq1);
}
代码示例来源:origin: DataSketches/sketches-core
@Override
public byte[] serializeToByteArray(final Double[] items) {
final byte[] bytes = new byte[Double.BYTES * items.length];
final WritableMemory mem = WritableMemory.wrap(bytes);
long offsetBytes = 0;
for (int i = 0; i < items.length; i++) {
mem.putDouble(offsetBytes, items[i]);
offsetBytes += Double.BYTES;
}
return bytes;
}
代码示例来源:origin: DataSketches/sketches-core
@Override
void putMinValue(final double minValue) {
assert (mem_.getCapacity() >= COMBINED_BUFFER);
mem_.putDouble(MIN_DOUBLE, minValue);
}
代码示例来源:origin: DataSketches/sketches-core
@Override
void putMaxValue(final double maxValue) {
assert (mem_.getCapacity() >= COMBINED_BUFFER);
mem_.putDouble(MAX_DOUBLE, maxValue);
}
代码示例来源:origin: DataSketches/sketches-core
@Override
protected void updateValues(final int index, final double[] values) {
long offset = valuesOffset_ + ((long) SIZE_OF_VALUE_BYTES * numValues_ * index);
for (int i = 0; i < numValues_; i++) {
mem_.putDouble(offset, mem_.getDouble(offset) + values[i]);
offset += SIZE_OF_VALUE_BYTES;
}
}
代码示例来源:origin: DataSketches/sketches-core
@Override
void addToHipAccum(final double delta) {
final double hipAccum = mem.getDouble(HIP_ACCUM_DOUBLE);
wmem.putDouble(HIP_ACCUM_DOUBLE, hipAccum + delta);
}
代码示例来源:origin: DataSketches/sketches-core
@Override
public void reset() {
if (mem_.getCapacity() >= COMBINED_BUFFER) {
mem_.putByte(FLAGS_BYTE, (byte) EMPTY_FLAG_MASK); //not compact, not ordered
mem_.putLong(N_LONG, 0L);
mem_.putDouble(MIN_DOUBLE, Double.NaN);
mem_.putDouble(MAX_DOUBLE, Double.NaN);
}
}
代码示例来源:origin: DataSketches/sketches-core
@Override
double set(final int index, final double value) {
assert index >= 0 && index < numItems_;
assert n_ == ds_.getN();
assert !ds_.isCompact(); // can't write to a compact sketch
final int idxOffset = offset_ + (index << 3);
final WritableMemory mem = ds_.getMemory();
final double oldVal = mem.getDouble(idxOffset);
mem.putDouble(idxOffset, value);
return oldVal;
}
代码示例来源:origin: DataSketches/sketches-core
static void putPinnedSlidingHipNoSv(final WritableMemory wmem,
final int lgK,
final int fiCol,
final int numCoupons, //unsigned
final int wLengthInts,
final double kxp,
final double hipAccum,
final short seedHash,
final int[] wStream) {
final Format format = Format.PINNED_SLIDING_HIP_NOSV;
final byte preInts = getDefinedPreInts(format);
final byte flags = (byte) ((format.ordinal() << 2) | COMPRESSED_FLAG_MASK);
checkCapacity(wmem.getCapacity(), 4L * (preInts + wLengthInts));
putFirst8(wmem, preInts, (byte) lgK, (byte) fiCol, flags, seedHash);
wmem.putInt(getHiFieldOffset(format, HiField.NUM_COUPONS), numCoupons);
wmem.putInt(getHiFieldOffset(format, HiField.W_LENGTH_INTS), wLengthInts);
wmem.putDouble(getHiFieldOffset(format, HiField.KXP), kxp);
wmem.putDouble(getHiFieldOffset(format, HiField.HIP_ACCUM), hipAccum);
wmem.putIntArray(getWStreamOffset(wmem), wStream, 0, wLengthInts);
}
代码示例来源:origin: DataSketches/sketches-core
static void putSparseHybridHip(final WritableMemory wmem,
final int lgK,
final int numCoupons, //unsigned
final int svLengthInts,
final double kxp,
final double hipAccum,
final short seedHash,
final int[] svStream) {
final Format format = Format.SPARSE_HYBRID_HIP;
final byte preInts = getDefinedPreInts(format);
final byte fiCol = (byte) 0;
final byte flags = (byte) ((format.ordinal() << 2) | COMPRESSED_FLAG_MASK);
checkCapacity(wmem.getCapacity(), 4L * (preInts + svLengthInts));
putFirst8(wmem, preInts, (byte) lgK, fiCol, flags, seedHash);
wmem.putInt(getHiFieldOffset(format, HiField.NUM_COUPONS), numCoupons);
wmem.putInt(getHiFieldOffset(format, HiField.SV_LENGTH_INTS), svLengthInts);
wmem.putDouble(getHiFieldOffset(format, HiField.KXP), kxp);
wmem.putDouble(getHiFieldOffset(format, HiField.HIP_ACCUM), hipAccum);
wmem.putIntArray(getSvStreamOffset(wmem), svStream, 0, svLengthInts);
}
代码示例来源:origin: DataSketches/sketches-core
@Test
public void checkCorruptSerializedWeight() {
final VarOptItemsSketch<String> vis = VarOptItemsSketch.newInstance(24);
for (int i = 1; i < 10; ++i) {
vis.update(Integer.toString(i), i);
}
final byte[] sketchBytes = vis.toByteArray(new ArrayOfStringsSerDe(), String.class);
final WritableMemory mem = WritableMemory.wrap(sketchBytes);
// weights will be stored in the first double after the preamble
final int numPreLongs = PreambleUtil.extractPreLongs(mem);
final int weightOffset = numPreLongs << 3;
mem.putDouble(weightOffset, -1.25); // inject a negative weight
try {
VarOptItemsSketch.heapify(mem, new ArrayOfStringsSerDe());
fail();
} catch (final SketchesArgumentException e) {
assertTrue(e.getMessage().equals("Possible Corruption: Non-positive weight in "
+ "heapify(): -1.25"));
}
}
代码示例来源:origin: DataSketches/sketches-core
static void putPinnedSlidingHip(final WritableMemory wmem,
final int lgK,
final int fiCol,
final int numCoupons, //unsigned
final int numSv,
final double kxp,
final double hipAccum,
final int svLengthInts,
final int wLengthInts,
final short seedHash,
final int[] svStream,
final int[] wStream) {
final Format format = Format.PINNED_SLIDING_HIP;
final byte preInts = getDefinedPreInts(format);
final byte flags = (byte) ((format.ordinal() << 2) | COMPRESSED_FLAG_MASK);
checkCapacity(wmem.getCapacity(), 4L * (preInts + svLengthInts + wLengthInts));
putFirst8(wmem, preInts, (byte) lgK, (byte) fiCol, flags, seedHash);
wmem.putInt(getHiFieldOffset(format, HiField.NUM_COUPONS), numCoupons);
wmem.putInt(getHiFieldOffset(format, HiField.NUM_SV), numSv);
wmem.putDouble(getHiFieldOffset(format, HiField.KXP), kxp);
wmem.putDouble(getHiFieldOffset(format, HiField.HIP_ACCUM), hipAccum);
wmem.putInt(getHiFieldOffset(format, HiField.SV_LENGTH_INTS), svLengthInts);
wmem.putInt(getHiFieldOffset(format, HiField.W_LENGTH_INTS), wLengthInts);
wmem.putIntArray(getSvStreamOffset(wmem), svStream, 0, svLengthInts);
wmem.putIntArray(getWStreamOffset(wmem), wStream, 0, wLengthInts);
}
代码示例来源:origin: DataSketches/sketches-core
@Test
public void checkHeapifyUnsortedCompactV2() {
final int k = 64;
final UpdateDoublesSketch qs = DoublesSketch.builder().setK(64).build();
for (int i = 0; i < (3 * k); ++i) {
qs.update(i);
}
assertEquals(qs.getBaseBufferCount(), k);
final byte[] sketchBytes = qs.toByteArray(true);
final WritableMemory mem = WritableMemory.wrap(sketchBytes);
// modify to make v2, clear compact flag, and insert a -1 in the middle of the base buffer
PreambleUtil.insertSerVer(mem, 2);
PreambleUtil.insertFlags(mem, 0);
final long tgtAddr = COMBINED_BUFFER + ((Double.BYTES * k) / 2);
mem.putDouble(tgtAddr, -1.0);
assert mem.getDouble(tgtAddr - Double.BYTES) > mem.getDouble(tgtAddr);
// ensure the heapified base buffer is sorted
final HeapCompactDoublesSketch qs2 = HeapCompactDoublesSketch.heapifyInstance(mem);
checkBaseBufferIsSorted(qs2);
}
本文整理了Java中com.yahoo.memory.WritableMemory.putByte()方法的一些代码示例,展示了WritableMemory.putByte()的具体用法。这些代码示例
本文整理了Java中com.yahoo.memory.WritableMemory.getDouble()方法的一些代码示例,展示了WritableMemory.getDouble()的具体用法。这些
本文整理了Java中com.yahoo.memory.WritableMemory.copyTo()方法的一些代码示例,展示了WritableMemory.copyTo()的具体用法。这些代码示例主要
本文整理了Java中com.yahoo.memory.WritableMemory.clear()方法的一些代码示例,展示了WritableMemory.clear()的具体用法。这些代码示例主要来源
本文整理了Java中com.yahoo.memory.WritableMemory.getCapacity()方法的一些代码示例,展示了WritableMemory.getCapacity()的具体用
本文整理了Java中com.yahoo.memory.WritableMemory.getLong()方法的一些代码示例,展示了WritableMemory.getLong()的具体用法。这些代码示例
本文整理了Java中com.yahoo.memory.WritableMemory.putDouble()方法的一些代码示例,展示了WritableMemory.putDouble()的具体用法。这些
本文整理了Java中com.yahoo.memory.WritableMemory.putByteArray()方法的一些代码示例,展示了WritableMemory.putByteArray()的具
本文整理了Java中com.yahoo.memory.WritableMemory.getByteArray()方法的一些代码示例,展示了WritableMemory.getByteArray()的具
本文整理了Java中com.yahoo.memory.WritableMemory.putShort()方法的一些代码示例,展示了WritableMemory.putShort()的具体用法。这些代码
本文整理了Java中com.yahoo.memory.WritableMemory.getArray()方法的一些代码示例,展示了WritableMemory.getArray()的具体用法。这些代码
本文整理了Java中com.yahoo.memory.WritableMemory.getByte()方法的一些代码示例,展示了WritableMemory.getByte()的具体用法。这些代码示例
本文整理了Java中com.yahoo.memory.WritableMemory.allocateDirect()方法的一些代码示例,展示了WritableMemory.allocateDirect
本文整理了Java中com.yahoo.memory.WritableMemory.clearBits()方法的一些代码示例,展示了WritableMemory.clearBits()的具体用法。这些
本文整理了Java中com.yahoo.memory.WritableMemory.getInt()方法的一些代码示例,展示了WritableMemory.getInt()的具体用法。这些代码示例主要
本文整理了Java中com.yahoo.memory.WritableMemory.writableRegion()方法的一些代码示例,展示了WritableMemory.writableRegion
本文整理了Java中com.yahoo.memory.WritableMemory.wrap()方法的一些代码示例,展示了WritableMemory.wrap()的具体用法。这些代码示例主要来源于G
本文整理了Java中com.yahoo.memory.WritableMemory.map()方法的一些代码示例,展示了WritableMemory.map()的具体用法。这些代码示例主要来源于Git
本文整理了Java中com.yahoo.memory.WritableMemory.putLong()方法的一些代码示例,展示了WritableMemory.putLong()的具体用法。这些代码示例
本文整理了Java中com.yahoo.memory.WritableMemory.allocate()方法的一些代码示例,展示了WritableMemory.allocate()的具体用法。这些代码
我是一名优秀的程序员,十分优秀!