Examples of slice()


Examples of org.apache.hama.commons.math.DoubleVector.slice()

    double relativeError = 0;
    for (int i = 0; i < instances.length; ++i) {
      DoubleVector test = new DenseDoubleVector(instances[i]);
      double expected = test.get(test.getDimension() - 1);
      test = test.slice(test.getDimension() - 1);
      double actual = regression.getOutput(test).get(0);
      relativeError += Math.abs((expected - actual) / expected);
    }

    relativeError /= instances.length;
View Full Code Here

Examples of org.apache.hama.ml.math.DenseDoubleVector.slice()

    double relativeError = 0;
    for (int i = 0; i < instances.length; ++i) {
      DoubleVector test = new DenseDoubleVector(instances[i]);
      double expected = test.get(test.getDimension() - 1);
      test = test.slice(test.getDimension() - 1);
      double actual = regression.getOutput(test).get(0);
      relativeError += Math.abs((expected - actual) / expected);
    }

    relativeError /= instances.length;
View Full Code Here

Examples of org.apache.hama.ml.math.DoubleVector.slice()

    double relativeError = 0;
    for (int i = 0; i < instances.length; ++i) {
      DoubleVector test = new DenseDoubleVector(instances[i]);
      double expected = test.get(test.getDimension() - 1);
      test = test.slice(test.getDimension() - 1);
      double actual = regression.getOutput(test).get(0);
      relativeError += Math.abs((expected - actual) / expected);
    }

    relativeError /= instances.length;
View Full Code Here

Examples of org.asteriskjava.iax.util.ByteBuffer.slice()

            throw new IllegalArgumentException("Not a miniframe, but fullframe.");
        } else {
            _fullBit = false;
        }
        setTimestampVal(buf.getChar());
        _data = buf.slice();
        _call = call;
    }


    /**
 
View Full Code Here

Examples of org.glassfish.grizzly.Buffer.slice()

                    posBufferPosition, limitBufferPosition);
        } else {
            final Buffer[] newList = new Buffer[limitBufferIndex - posBufferIndex + 1];

            final Buffer posBuffer = buffers[posBufferIndex];
            newList[0] = posBuffer.slice(posBufferPosition, posBuffer.limit());

            int index = 1;
            for (int i = posBufferIndex + 1; i < limitBufferIndex; i++) {
                newList[index++] = buffers[i].slice();
            }
View Full Code Here

Examples of org.iq80.leveldb.util.DynamicSliceOutput.slice()

    {
        DynamicSliceOutput dynamicSliceOutput = new DynamicSliceOutput(4096);
        for (VersionEditTag versionEditTag : VersionEditTag.values()) {
            versionEditTag.writeValue(dynamicSliceOutput, this);
        }
        return dynamicSliceOutput.slice();
    }

    @Override
    public String toString()
    {
View Full Code Here

Examples of org.iq80.leveldb.util.Slice.slice()

    public static Slice writeBlockHandle(BlockHandle blockHandle)
    {
        Slice slice = Slices.allocate(MAX_ENCODED_LENGTH);
        SliceOutput sliceOutput = slice.output();
        writeBlockHandleTo(blockHandle, sliceOutput);
        return slice.slice();
    }
    public static void writeBlockHandleTo(BlockHandle blockHandle, SliceOutput sliceOutput)
    {
        VariableLengthQuantity.writeVariableLengthLong(blockHandle.offset, sliceOutput);
        VariableLengthQuantity.writeVariableLengthLong(blockHandle.dataSize, sliceOutput);
View Full Code Here

Examples of org.iq80.leveldb.util.SliceOutput.slice()

        header.writeInt(crc);
        header.writeByte((byte) (length & 0xff));
        header.writeByte((byte) (length >>> 8));
        header.writeByte((byte) (type.getPersistentId()));

        return header.slice();
    }
}
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.slice()

                encoded.writeByte(127);
                encoded.writeInt(length);
            }

            encoded.writeBytes(data, data.readerIndex(), data.readableBytes());
            encoded = encoded.slice(0, encoded.writerIndex());
            return encoded;
        }
        return msg;
    }
}
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.slice()

  public ChannelBuffer getMessage(MessageEvent e)
  {
    if (checkMessage(e))
    {
      ChannelBuffer m = (ChannelBuffer) e.getMessage();
      return m.slice(id.length, m.readableBytes()-id.length);
    }
    return null;
  }
 
  public String getStringMessage(MessageEvent e)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.