Package cc.redberry.core.utils

Examples of cc.redberry.core.utils.IntArrayList.toArray()


                if ((data[i] ^ data[j]) == 0x80000000) {
                    dataList.add(data[i] & 0x7FFFFFFF);
                    break;
                }
            }
        return dataList.toArray();
    }

    @Override
    public SimpleIndices getOfType(IndexType type) {
        int type_ = type.getType() << 24;
View Full Code Here


                seen.set(start);
                ++counter;
                cycle.add(start);
                start = newIndexOf(start);
            }
            cycles.add(cycle.toArray());
        }
        return cycles.toArray(new int[cycles.size()][]);
    }

View Full Code Here

                                if (oldArgIndices.size(IndexType.getType(j)) != 0)
                                    throw new IllegalArgumentException("Error in field arg indices.");
                                newArgIndices.addAll(newIndices.getOfType(IndexType.getType(j)).getAllIndices());
                            }
                        }
                        pntf.argumentsIndices[i] = IndicesFactory.createSimple(null, newArgIndices.toArray());
                    }
                }
        }
        if (pn.tokenType == TokenType.Power || pn.tokenType == TokenType.ScalarFunction) {
            for (int i = 0; i < pn.content.length; ++i)
View Full Code Here

        IntArrayList contracted = new IntArrayList();
        for (int i = 0; i < freeIndices1.length; ++i)
            for (int j = 0; j < freeIndices2.length; ++j)
                if (freeIndices2[j] == inverseIndexState(freeIndices1[i]))
                    contracted.add(getNameWithType(freeIndices2[j]));
        return contracted.toArray();
    }

    /**
     * Returns an array of contracted indices between specified indices.
     *
 
View Full Code Here

        }
        if (level != 0)
            throw new BracketsError();
        if (beginIndex != endIndex)
            parse(expression.substring(beginIndex + 1, endIndex), indices, state);
        return indices.toArray();
    }

    /**
     * A bit of regex
     */
 
View Full Code Here

                for (int j = 0; j < metricInds.length; ++j)
                    if (temp[j] == 0xFFFFFFFF)
                        temp[j] = createIndex(counter++, getType(metricInds[j]), false);//lower index
                IntArrayList _result = nonMetricIndices.clone();
                _result.addAll(temp);
                Tensor renamed = ApplyIndexMapping.applyIndexMapping(st, new Mapping(indicesArray, _result.toArray()));
                //todo bottleneck
                for (Tensor existing : combinationArray)
                    if (TensorUtils.compare1(existing, renamed) != null)
                        continue combinations;
                combinationArray.add(renamed);
View Full Code Here

                --iUpper;
            }
        }
        list.add(data, iUpper, firstLower - iUpper);
        list.add(data, iLower, data.length - iLower);
        return IndicesFactory.create(list.toArray());
    }

    @Override
    public int[] getNamesOfDummies() {
        IntArrayList list = new IntArrayList();
View Full Code Here

            else if (l < u)
                --iUpper;
            else
                list.add(l);
        }
        return list.toArray();
    }

    @Override
    public Indices getOfType(IndexType type) {
        int type_ = type.getType();
View Full Code Here

                    if (remainder instanceof Sum)
                        remainder = ((Sum) remainder).remove(i);
                    else remainder = Complex.ZERO;
                }
            }
            Tensor symbolicPart = ((Sum) c).select(symbolicPositions.toArray());
            symbolicPart = factorSymbolicTerm(symbolicPart);
            if (remainder instanceof Sum) {
                SumBuilder sb = new SumBuilder(remainder.size());
                for (Tensor tt : remainder)
                    sb.put(factorSymbolicTerms(tt));
View Full Code Here

        IntArrayList contracted = new IntArrayList();
        for (int i = 0; i < freeIndices1.length; ++i)
            for (int j = 0; j < freeIndices2.length; ++j)
                if (freeIndices2[j] == inverseIndexState(freeIndices1[i]))
                    contracted.add(getNameWithType(freeIndices2[j]));
        return contracted.toArray();
    }

    /**
     * Returns an array of contracted indices between specified indices.
     *
 
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.