Package xerial.larray

Examples of xerial.larray.LIntArray.apply()


        }
        for (int iter = 0; iter < 10; iter++) {
            long sum = 0;
            long start = System.currentTimeMillis();
            for (int i = 0; i < l.length(); i++) {
                sum += l.apply(i);
            }
            long end = System.currentTimeMillis();
            _logger.debug("time:" + (end - start) + " sum:" + sum);
        }
        _logger.debug("compressing the data");
View Full Code Here


        _logger.debug("Summing decompressed array");
        for (int iter = 0; iter < 10; iter++) {
            long sum = 0;
            long start = System.currentTimeMillis();
            for (int i = 0; i < decompressed.length(); i++) {
                sum += decompressed.apply(i);
            }
            long end = System.currentTimeMillis();
            _logger.debug("time:" + (end - start) + " sum:" + sum);
        }
    }
View Full Code Here

    public static void main(String[] args) {
        // Create a new LArray of Int type
        LIntArray l = LArrayJ.newLIntArray(5);

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

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

        // Create a new LArray of Int type
        LIntArray l = LArrayJ.newLIntArray(5);

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

        // Set elements
        for(int i=0; i<l.size(); ++i)
            l.update(i, i);
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.