Package cc.redberry.core.tensor.iterator

Examples of cc.redberry.core.tensor.iterator.TreeTraverseIterator.result()


                if (simpleTensor instanceof TensorField)
                    iterator.set(Tensors.setIndicesToField((TensorField) simpleTensor, newIndices));
                else
                    iterator.set(Tensors.setIndicesToSimpleTensor(simpleTensor, newIndices));
        }
        return iterator.result();
    }

    public final static class IndexMapper implements IndexMapping {

        private final int[] from, to;
View Full Code Here


                continue;
            c = iterator.current();
            if (TensorUtils.isZeroDueToSymmetry(c))
                iterator.set(Complex.ZERO);
        }
        return iterator.result();
    }
}
View Full Code Here

                iterator.set(expandProductOfSums(current, indicator, transformations));
            else if (current instanceof Power && current.get(0) instanceof Sum
                    && TensorUtils.isNatural(current.get(1)) && indicator.is(current))
                iterator.set(expandPower((Sum) current.get(0), ((Complex) current.get(1)).getReal().intValue(), transformations));
        }
        return iterator.result();
    }

    private static Tensor expandProductOfSums(Tensor current, Indicator<Tensor> indicator, Transformation[] transformations) {

        // g_mn  {_m->^a, _n->_b}  => g^a_b  <=> d^a_b |           Tensors.isMetric(g_ab )  d_a^b
View Full Code Here

                if (simpleTensor instanceof TensorField)
                    iterator.set(Tensors.setIndicesToField((TensorField) simpleTensor, newIndices));
                else
                    iterator.set(Tensors.setIndicesToSimpleTensor(simpleTensor, newIndices));
        }
        return iterator.result();
    }

    private static final class IndexMapper implements IndexMapping {

        private final IndexGenerator generator;
View Full Code Here

            while (iterator.next() != null)
                if (TensorUtils.equalsExactly(iterator.current(), pT))
                    iterator.set(M8);
                else if (TensorUtils.equalsExactly(iterator.current(), s))
                    iterator.set(AllToM);
            iterator.result();
        }
    }

    public static void main(String[] args) {
        burnJVM();
View Full Code Here

        for (i = 0; i < 100; ++i) {
            iterator = new TreeTraverseIterator(target);
            while (iterator.next() != null)
                if (TensorUtils.equalsExactly(iterator.current(), pT))
                    iterator.set(M);
            ptM = iterator.result();
        }
        stop = System.currentTimeMillis();
        status = TensorUtils.equalsExactly(ptM, pTToM);
        System.out.println("pT -> M : " + status + ". Time: " + (stop - start) + " ms");
View Full Code Here

        for (i = 0; i < 100; ++i) {
            iterator = new TreeTraverseIterator(target);
            while (iterator.next() != null)
                if (TensorUtils.equalsExactly(iterator.current(), s))
                    iterator.set(M2);
            sM = iterator.result();
        }
        status = TensorUtils.equalsExactly(sM, sToM);
        stop = System.currentTimeMillis();
        System.out.println("s -> M^2 : " + status + ". Time: " + (stop - start) + " ms");
View Full Code Here

            while (iterator.next() != null)
                if (TensorUtils.equalsExactly(iterator.current(), pT))
                    iterator.set(M);
                else if (TensorUtils.equalsExactly(iterator.current(), s))
                    iterator.set(M2);
            allM = iterator.result();
        }
        status = TensorUtils.equalsExactly(allM, AllToM);
        stop = System.currentTimeMillis();
        System.out.println("pT-> M and s -> M^2 : " + status + ". Time: " + (stop - start) + " ms");
    }
View Full Code Here

            for (Transformation transformation : transformations)
                newTensor = transformation.transform(newTensor);
            if (currentTensor != newTensor)
                iterator.set(newTensor);
        }
        return iterator.result();
    }
}
View Full Code Here

            while (iterator.next() != null)
                if (TensorUtils.equalsExactly(iterator.current(), pT))
                    iterator.set(M8);
                else if (TensorUtils.equalsExactly(iterator.current(), s))
                    iterator.set(AllToM);
            iterator.result();
        }
    }

    public static void main(String[] args) {
        burnJVM();
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.