Package cc.redberry.core.indices

Examples of cc.redberry.core.indices.InconsistentIndicesException


        for (Tensor t : elements)
            ibs.append(t);
        try {
            indices = ibs.getIndices();
        } catch (InconsistentIndicesException exception) {
            throw new InconsistentIndicesException(exception.getIndex());
        }

        return new Product(indices, complex,
                           indexlessData.toArray(new Tensor[indexlessData.size()]),
                           elements.toArray(new Tensor[elements.size()]));
View Full Code Here


            for (i = dataContainer.list.size() - 1; i >= 0; --i)
                builder.append(dataContainer.list.get(i));
            try {
                indices = builder.getIndices();
            } catch (InconsistentIndicesException exception) {
                throw new InconsistentIndicesException(exception.getIndex());
            }
        }

        //Processing indexless data
        Tensor[] indexless;
View Full Code Here

    public boolean tryMap(int from, int to) {
        if (IndicesUtils.getNameWithType(to) != toName)
            return false;
        if ((IndicesUtils.getStateInt(from) != IndicesUtils.getStateInt(to)) != ((states & 0x4) == 0x4))
            throw new InconsistentIndicesException(from);
        if ((states & (1 << IndicesUtils.getStateInt(to))) != 0)
            throw new InconsistentIndicesException(to);
        states |= 1 << IndicesUtils.getStateInt(to);
        return true;
    }
View Full Code Here

            for (i = dataContainer.list.size() - 1; i >= 0; --i)
                builder.append(dataContainer.list.get(i));
            try {
                indices = builder.getIndices();
            } catch (InconsistentIndicesException exception) {
                throw new InconsistentIndicesException(exception.getIndex());
            }
        }

        //Processing indexless data
        Tensor[] indexless;
View Full Code Here

    public boolean tryMap(int from, int to) {
        if (IndicesUtils.getNameWithType(to) != toName)
            return false;
        if ((IndicesUtils.getStateInt(from) != IndicesUtils.getStateInt(to)) != ((states & 0x4) == 0x4))
            throw new InconsistentIndicesException(from);
        if ((states & (1 << IndicesUtils.getStateInt(to))) != 0)
            throw new InconsistentIndicesException(to);
        states |= 1 << IndicesUtils.getStateInt(to);
        return true;
    }
View Full Code Here

    private static void assertIndicesConsistency(Tensor t, TIntHashSet indices) {
        if (t instanceof SimpleTensor) {
            Indices ind = t.getIndices();
            for (int i = ind.size() - 1; i >= 0; --i)
                if (indices.contains(ind.get(i)))
                    throw new AssertionError(new InconsistentIndicesException(ind.get(i)));
                else
                    indices.add(ind.get(i));
        }
        if (t instanceof Product)
            for (int i = t.size() - 1; i >= 0; --i)
View Full Code Here

            for (i = dataContainer.list.size() - 1; i >= 0; --i)
                builder.append(dataContainer.list.get(i));
            try {
                indices = builder.getIndices();
            } catch (InconsistentIndicesException exception) {
                throw new InconsistentIndicesException(exception.getIndex());
            }
        }

        //Processing indexless data
        Tensor[] indexless;
View Full Code Here

    public boolean tryMap(int from, int to) {
        if (IndicesUtils.getNameWithType(to) != toName)
            return false;
        if ((IndicesUtils.getStateInt(from) != IndicesUtils.getStateInt(to)) != ((states & 0x4) == 0x4))
            if (CC.getRegim() == Context.Regim.NORMAL)
                throw new InconsistentIndicesException(from);
        if ((states & (1 << IndicesUtils.getStateInt(to))) != 0)
            if (CC.getRegim() == Context.Regim.NORMAL)
                throw new InconsistentIndicesException(to);
        states |= 1 << IndicesUtils.getStateInt(to);
        return true;
    }
View Full Code Here

    private void testConsistent() {
        try {
            indices.testConsistentWithException();
        } catch (InconsistentIndicesException ex) {
            //Adding information about source tensor
            throw new InconsistentIndicesException(ex, this);
        }
    }
View Full Code Here

            ib.append(t.getIndices());
        try {
            indices = ib.getIndices();
        } catch (InconsistentIndicesException ex) {
            //Adding information about source tensor
            throw new InconsistentIndicesException(ex, this);
        }
    }
View Full Code Here

TOP

Related Classes of cc.redberry.core.indices.InconsistentIndicesException

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.