Examples of ArrayDouble1d


Examples of com.opendatagroup.NumpySubset.ArrayDouble1d

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

        ArrayDouble1d out = new ArrayDouble1d(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

Examples of com.opendatagroup.NumpySubset.ArrayDouble1d

        }
        return out;
    }

    public static ArrayDouble1d getfancy(ArrayDouble1d array, ArrayInteger1d selection) {
        ArrayDouble1d out = new ArrayDouble1d(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

Examples of com.opendatagroup.NumpySubset.ArrayDouble1d

            out.set(i, y.get(i));
        }
        return out;
    }
    public static ArrayDouble1d concatenate(ArrayDouble1d x, ArrayDouble1d y) {
        ArrayDouble1d out = new ArrayDouble1d(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

Examples of com.opendatagroup.NumpySubset.ArrayDouble1d

        }
        return out;
    }

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

Examples of com.opendatagroup.NumpySubset.ArrayDouble1d

            sum += array.get(i);
        }
        return out;
    }
    public static ArrayDouble1d cumsum(ArrayDouble1d array) {
        ArrayDouble1d out = new ArrayDouble1d(array.len());
        double sum = 0.0;
        for (int i = 0;  i < array.len();  i++) {
            out.set(i, sum);
            sum += array.get(i);
        }
        return out;
    }
View Full Code Here

Examples of com.opendatagroup.NumpySubset.ArrayDouble1d

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

Examples of com.opendatagroup.NumpySubset.ArrayDouble1d

            out.set(i, 0.0);
        }
        return out;
    }
    public static ArrayDouble1d onesDouble(int length) {
        ArrayDouble1d out = new ArrayDouble1d(length);
        for (int i = 0;  i < length;  i++) {
            out.set(i, 1.0);
        }
        return out;
    }
View Full Code Here

Examples of com.opendatagroup.NumpySubset.ArrayDouble1d

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

        ArrayDouble1d out = new ArrayDouble1d(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
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.