Examples of slice()


Examples of mikera.arrayz.INDArray.slice()

  @Test
  public void testBroadCast() {
    Vector2 v=Vector2.of(1,2);
   
    INDArray a=v.broadcast(1,3,2);
    assertEquals(v,a.slice(0).slice(1));
  }
 
  @Test
  public void testPrimitiveMatricSlices() {
    Matrix22 m2=new Matrix22(1,2,3,4);
View Full Code Here

Examples of mikera.arrayz.NDArray.slice()

  public static void main(String[] args) {
    // create a new 3x3x3 array
    NDArray a1=NDArray.newArray(3,3,3);
   
    // fill a slice on dimension 1 with zeros
    a1.slice(1,1).fill(2.0);
   
    // add 1.0 to the first slice (on dimension 0 by default)
    a1.slice(0).add(1);
   
    System.out.println(a1);
View Full Code Here

Examples of mondrian.calc.TupleList.slice()

        tupleReader.addLevelMembers(level, this, null);
        final TupleList tupleList =
            tupleReader.readMembers(dataSource, null, null);

        assert tupleList.getArity() == 1;
        return Util.cast(tupleList.slice(0));
    }

    public MemberCache getMemberCache() {
        return cache;
    }
View Full Code Here

Examples of net.gleamynode.netty.buffer.ChannelBuffer.slice()

        }
        this.delimiters = new ChannelBuffer[delimiters.length];
        for (int i = 0; i < delimiters.length; i ++) {
            ChannelBuffer d = delimiters[i];
            validateDelimiter(d);
            this.delimiters[i] = d.slice(d.readerIndex(), d.readableBytes());
        }
        this.maxFrameLength = maxFrameLength;
    }

    @Override
View Full Code Here

Examples of net.openhft.lang.io.ByteBufferBytes.slice()

            final BytesDataLocator<E, ByteBufferBytes> bytesDataLocator = new BytesDataLocator<E, ByteBufferBytes>(
                    clazz,
                    capacity,
                    maxSize,
                    byteBufferBytes.slice(),
                    byteBufferBytes.slice());

            if (type == Type.REMOTE_PRODUCER) {
                final Producer producer = new Producer<E, ByteBufferBytes>(new LocalRingIndex(), bytesDataLocator, bytesDataLocator, new ServerSocketChannelProvider(port), bytesDataLocator, buffer);
                ringIndex = producer;
View Full Code Here

Examples of net.sf.cindy.Buffer.slice()

            assertEquals(b2.get(), buffer.get());

        buffer.clear();
        buffer.limit(random.nextInt(buffer.capacity()));
        buffer.position(random.nextInt(buffer.limit()));
        buffer = buffer.slice();
        ByteBuffer b3 = buffer.asByteBuffer();
        assertEquals(buffer.position(), b3.position());
        assertEquals(buffer.limit(), b3.limit());
        assertEquals(buffer.capacity(), b3.capacity());
        while (b3.hasRemaining())
View Full Code Here

Examples of org.activeio.Packet.slice()

            return false;
        }
       
        // Set limit to create a slice of the payload.
        dup.limit(dup.position()+payloadLength);
        this.payload = dup.slice();       
      if( isChecksumingEnabled() ) {
          checksum(new DataInputStream(new PacketInputStream(payload)));
      }
     
      // restore the limit and seek to the footer.
View Full Code Here

Examples of org.apache.activeio.packet.Packet.slice()

            return false;
        }
       
        // Set limit to create a slice of the payload.
        dup.limit(dup.position()+payloadLength);
        this.payload = dup.slice();       
      if( isChecksumingEnabled() ) {
          checksum(new DataInputStream(new PacketToInputStream(payload)));
      }
     
      // restore the limit and seek to the footer.
View Full Code Here

Examples of org.apache.cassandra.db.composites.CellName.slice()

        public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException
        {
            // delete + add
            CellName name = cf.getComparator().create(prefix, column);
            cf.addAtom(params.makeTombstoneForOverwrite(name.slice()));
            Adder.doAdd(t, cf, prefix, column, params);
        }
    }

    public static class Adder extends Operation
View Full Code Here

Examples of org.apache.hama.commons.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
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.