/** Writes doubles from the given double array to the current position and increases the position by the number of doubles * written. * <p> * Calling this method has the same effect as {@code put(src, 0, src.length)}. * </p> * * @param src the source double array. * @return this buffer. * @exception BufferOverflowException if {@code remaining()} is less than {@code src.length}. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public final DoubleBuffer put (double[] src) { return put(src, 0, src.length); }
/** Writes doubles from the given double array to the current position and increases the position by the number of doubles * written. * <p> * Calling this method has the same effect as {@code put(src, 0, src.length)}. * </p> * * @param src the source double array. * @return this buffer. * @exception BufferOverflowException if {@code remaining()} is less than {@code src.length}. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public final DoubleBuffer put (double[] src) { return put(src, 0, src.length); }
@Override public DoubleIndexer put(long i, long j, double[] d, int offset, int length) { for (int n = 0; n < length; n++) { buffer.put((int)i * (int)strides[0] + (int)j * (int)strides[1] + n, d[offset + n]); } return this; } @Override public DoubleIndexer put(long i, long j, long k, double d) {
@Override public DoubleIndexer put(long i, double d) { buffer.put((int)i, d); return this; } @Override public DoubleIndexer put(long i, double[] d, int offset, int length) {
@Override public DoubleIndexer put(long i, double[] d, int offset, int length) { for (int n = 0; n < length; n++) { buffer.put((int)i * (int)strides[0] + n, d[offset + n]); } return this; } @Override public DoubleIndexer put(long i, long j, double d) {
@Override public DoubleIndexer put(long i, long j, long k, double d) { buffer.put((int)i * (int)strides[0] + (int)j * (int)strides[1] + (int)k, d); return this; } @Override public DoubleIndexer put(long[] indices, double d) {
@Override public DoubleIndexer put(long i, long j, double d) { buffer.put((int)i * (int)strides[0] + (int)j, d); return this; } @Override public DoubleIndexer put(long i, long j, double[] d, int offset, int length) {
/** * Writes doubles from the given double array to the current position and * increases the position by the number of doubles written. * <p> * Calling this method has the same effect as * {@code put(src, 0, src.length)}. * * @param src * the source double array. * @return this buffer. * @exception BufferOverflowException * if {@code remaining()} is less than {@code src.length}. * @exception ReadOnlyBufferException * if no changes may be made to the contents of this buffer. */ public final DoubleBuffer put(double[] src) { return put(src, 0, src.length); }
@Override public DoubleIndexer put(long[] indices, double[] d, int offset, int length) { for (int n = 0; n < length; n++) { buffer.put((int)index(indices) + n, d[offset + n]); } return this; }
@Override public DoubleIndexer put(long[] indices, double d) { buffer.put((int)index(indices), d); return this; } @Override public DoubleIndexer put(long[] indices, double[] d, int offset, int length) {
/** * Copies {@code count} doubles from {@code src} starting at offset {@code offset} * to the memory pointed to by this {@link DoublePtr}. * * @param src the source. * @param offset the offset within the source array to start copying from. * @param count the number of elements to copy. */ public void set(double[] src, int offset, int count) { asDoubleBuffer(count).put(src, offset, count); } }
/** Writes doubles from the given double array, starting from the specified offset, to the current position and increases the * position by the number of doubles written. * * @param src the source double array. * @param off the offset of double array, must not be negative and not greater than {@code src.length}. * @param len the number of doubles to write, must be no less than zero and not greater than {@code src.length - off}. * @return this buffer. * @exception BufferOverflowException if {@code remaining()} is less than {@code len}. * @exception IndexOutOfBoundsException if either {@code off} or {@code len} is invalid. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public DoubleBuffer put (double[] src, int off, int len) { int length = src.length; if (off < 0 || len < 0 || (long)off + (long)len > length) { throw new IndexOutOfBoundsException(); } if (len > remaining()) { throw new BufferOverflowException(); } for (int i = off; i < off + len; i++) { put(src[i]); } return this; }
/** Writes doubles from the given double array, starting from the specified offset, to the current position and increases the * position by the number of doubles written. * * @param src the source double array. * @param off the offset of double array, must not be negative and not greater than {@code src.length}. * @param len the number of doubles to write, must be no less than zero and not greater than {@code src.length - off}. * @return this buffer. * @exception BufferOverflowException if {@code remaining()} is less than {@code len}. * @exception IndexOutOfBoundsException if either {@code off} or {@code len} is invalid. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public DoubleBuffer put (double[] src, int off, int len) { int length = src.length; if (off < 0 || len < 0 || (long)off + (long)len > length) { throw new IndexOutOfBoundsException(); } if (len > remaining()) { throw new BufferOverflowException(); } for (int i = off; i < off + len; i++) { put(src[i]); } return this; }
/** Writes all the remaining doubles of the {@code src} double buffer to this buffer's current position, and increases both * buffers' position by the number of doubles copied. * * @param src the source double buffer. * @return this buffer. * @exception BufferOverflowException if {@code src.remaining()} is greater than this buffer's {@code remaining()}. * @exception IllegalArgumentException if {@code src} is this buffer. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public DoubleBuffer put (DoubleBuffer src) { if (src == this) { throw new IllegalArgumentException(); } if (src.remaining() > remaining()) { throw new BufferOverflowException(); } double[] doubles = new double[src.remaining()]; src.get(doubles); put(doubles); return this; }
/** Writes all the remaining doubles of the {@code src} double buffer to this buffer's current position, and increases both * buffers' position by the number of doubles copied. * * @param src the source double buffer. * @return this buffer. * @exception BufferOverflowException if {@code src.remaining()} is greater than this buffer's {@code remaining()}. * @exception IllegalArgumentException if {@code src} is this buffer. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public DoubleBuffer put (DoubleBuffer src) { if (src == this) { throw new IllegalArgumentException(); } if (src.remaining() > remaining()) { throw new BufferOverflowException(); } double[] doubles = new double[src.remaining()]; src.get(doubles); put(doubles); return this; }
public void setJoints(SkeletonJoint[] joints) { if(joints == null) return; mJoints = joints; if (mBoneMatrices == null) { mBoneMatrices = ByteBuffer .allocateDirect(joints.length * DOUBLE_SIZE_BYTES * 16) .order(ByteOrder.nativeOrder()).asDoubleBuffer(); } else mBoneMatrices.clear(); mBoneMatrices.put(uBoneMatrix); mBoneMatrices.position(0); mBoneMatricesBufferInfo.buffer = mBoneMatrices; mGeometry.addBuffer(mBoneMatricesBufferInfo, BufferType.FLOAT_BUFFER, GLES20.GL_ARRAY_BUFFER); }
public AutoBuffer putA8d( double[] ary ) { _arys++; if( ary == null ) return putInt(-1); putInt(ary.length); int sofar = 0; while( sofar < ary.length ) { DoubleBuffer sb = _bb.asDoubleBuffer(); int len = Math.min(ary.length - sofar, sb.remaining()); sb.put(ary, sofar, len); sofar += len; _bb.position(_bb.position() + sb.position()*8); if( sofar < ary.length ) sendPartial(); } return this; }
@Override public void setArg(int index, double d) { DoubleBuffer buf = Utils.tempBuffers[0].b16d; buf.position(0); buf.limit(1); buf.put(0, d); int ret = cl.clSetKernelArg(kernel, index, 8, buf); Utils.checkError(ret, "clSetKernelArg"); }
@Override public void setArg(int index, double d) { DoubleBuffer buf = Utils.tempBuffers[0].b16d; buf.position(0); buf.limit(1); buf.put(0, d); int ret = CL10.clSetKernelArg(kernel, index, buf); Utils.checkError(ret, "clSetKernelArg"); }