Package r.data.RArray

Examples of r.data.RArray.Names.sequence()


        public static RAny deleteElements(RList base, RLogical index, @SuppressWarnings("unused") ASTNode ast) {
            int bsize = base.size();
            int isize = index.size();

            Names names = base.names();
            RSymbol[] symbols = names == null ? null : names.sequence();
            if (isize == bsize) {
                int ntrue = RLogical.RLogicalUtils.truesInRange(index, 0, isize);
                int nsize = bsize - ntrue;
                RAny[] content = new RAny[nsize];
                RSymbol[] nsymbols = symbols == null ? null : new RSymbol[nsize];
View Full Code Here


                }
            }

            if (nremove == 0) { return base; }
            int nsize = bsize - nremove;
            RSymbol[] bsymbols = bnames.sequence();
            RSymbol[] nsymbols = new RSymbol[nsize];
            RAny[] content = new RAny[nsize];
            int j = 0;
            for (int i = 0; i < bsize; i++) {
                if (!remove[i]) { // shallow copy
View Full Code Here

                bsymbols = null;
            } else {
                assert Utils.check(Names.keepsMap()); // FIXME: re-visit this if we re-introduce names that don't carry hashmaps
                                                      // (probably should build a new one in such a case)
                nmap = new HashMap<>(bnames.getMap());
                bsymbols = bnames.sequence();
            }

            RSymbol[] addSymbols = new RSymbol[isize];
            int j = 0;
            // NOTE: targetOffsets is here to avoid double lookup via the hashmap
View Full Code Here

        }

        public static RAny executeIntVector(RInt indexArg, RArray base, ASTNode ast) {

            Names names = base.names();
            RSymbol[] symbols = (names == null) ? null : names.sequence();
            RSymbol[] newSymbols = null;
            int nzeros = 0;
            boolean hasNegative = false;
            boolean hasPositive = false;
            boolean hasNA = false;
View Full Code Here

        public static RAny executeLogicalVector(RLogical index, RArray base) {
            int isize = index.size();
            int bsize = base.size();
            Names names = base.names();
            if (isize == 0) { return Utils.createEmptyArray(base, names != null); }
            RSymbol[] symbols = (names == null) ? null : names.sequence();
            RSymbol[] newSymbols = null;

            if (isize >= bsize) {
                // no re-use of index, but index can be longer than base
                int nsize = 0;
View Full Code Here

                        selected[vi] = true;
                    }
                }
            }
            Names names = base.names();
            RSymbol[] symbols = names == null ? null : names.sequence();

            if (!hasNegative) {
                int nullsToAdd = 0;
                if (maxIndex > (bsize + 1)) {
                    // there were indexes "above" the base vector, but perhaps not all were mentioned
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.