Package xerial.larray

Examples of xerial.larray.LIntArray.update()


    @Test
    public void constructor() {

        LIntArray l = LArrayJ.newLIntArray(5L);
        for (long i = 0; i < l.size(); ++i) l.update(i, (int) i * 2);
        _logger.debug(l.mkString(", "));
        for (long i = 0; i < l.size(); ++i) l.update(i, (int) (i * i));
        _logger.debug(l.mkString(", "));

        Assert.assertEquals(5L, l.size());
View Full Code Here


    public void constructor() {

        LIntArray l = LArrayJ.newLIntArray(5L);
        for (long i = 0; i < l.size(); ++i) l.update(i, (int) i * 2);
        _logger.debug(l.mkString(", "));
        for (long i = 0; i < l.size(); ++i) l.update(i, (int) (i * i));
        _logger.debug(l.mkString(", "));

        Assert.assertEquals(5L, l.size());

        l.free();
View Full Code Here

    public void testCompress() throws Exception {

        long N = 100000000L;
        LIntArray l = LArrayJ.newLIntArray(N);
        for (int i = 0; i < N; i++) {
            l.update(i, (int) (Math.toDegrees(Math.sin(i / 360))));
        }
        for (int iter = 0; iter < 10; iter++) {
            long sum = 0;
            long start = System.currentTimeMillis();
            for (int i = 0; i < l.length(); i++) {
View Full Code Here

        int e0 = l.apply(0);
        int e1 = l.apply(1);

        // Set elements
        for(int i=0; i<l.size(); ++i)
            l.update(i, i);

        // print the elements
        System.out.println(l.mkString(", "));

        // Traverse the elements
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.