Package com.opendatagroup.NumpySubset

Examples of com.opendatagroup.NumpySubset.ArrayBoolean1d


        }
        return out;
    }

    public static ArrayBoolean1d zerosBoolean(int length) {
        ArrayBoolean1d out = new ArrayBoolean1d(length);
        for (int i = 0;  i < length;  i++) {
            out.set(i, false);
        }
        return out;
    }
View Full Code Here


            out.set(i, false);
        }
        return out;
    }
    public static ArrayBoolean1d onesBoolean(int length) {
        ArrayBoolean1d out = new ArrayBoolean1d(length);
        for (int i = 0;  i < length;  i++) {
            out.set(i, 1);
        }
        return out;
    }
View Full Code Here

        int length = max - min;
        if (length < 0) { length = 0; }
        length = (int)Math.ceil((double)length / (double)step);

        ArrayBoolean1d out = new ArrayBoolean1d(length);
        int j = 0;
        for (int i = min;  i < max;  i += step) {
            out.set(j, array.get(i));
            j += 1;
        }
        return out;
    }
View Full Code Here

        int count = 0;
        for (int i = 0;  i < selection.len();  i++) {
            if (selection.get(i)) { count += 1; }
        }

        ArrayBoolean1d out = new ArrayBoolean1d(count);
        int j = 0;
        for (int i = 0;  i < selection.len();  i++) {
            if (selection.get(i)) {
                out.set(j, array.get(i));
                j += 1;
            }
        }
        return out;
    }
View Full Code Here

        }
        return out;
    }

    public static ArrayBoolean1d getfancy(ArrayBoolean1d array, ArrayInteger1d selection) {
        ArrayBoolean1d out = new ArrayBoolean1d(selection.len());
        for (int i = 0;  i < selection.len();  i++) {
            int index = selection.get(i);
            if (index < 0) {
                index = array.len() + index;
            }
            out.set(i, array.get(index));
        }
        return out;
    }
View Full Code Here

    }

    // trunc(x[, out])  Return the truncated value of the input, element-wise.

    public static ArrayBoolean1d concatenate(ArrayBoolean1d x, ArrayBoolean1d y) {
        ArrayBoolean1d out = new ArrayBoolean1d(x.len() + y.len());
        for (int i = 0;  i < x.len();  i++) {
            out.set(i, x.get(i));
        }
        for (int i = 0;  i < y.len();  i++) {
            out.set(i, y.get(i));
        }
        return out;
    }
View Full Code Here

        }
        return out;
    }

    public static ArrayBoolean1d copy(ArrayBoolean1d array) {
        ArrayBoolean1d out = new ArrayBoolean1d(array.len());
        for (int i = 0;  i < out.len();  i++) {
            out.set(i, array.get(i));
        }
        return out;
    }
View Full Code Here

TOP

Related Classes of com.opendatagroup.NumpySubset.ArrayBoolean1d

Copyright © 2018 www.massapicom. 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.