Package cc.redberry.core.indexmapping

Examples of cc.redberry.core.indexmapping.IndexMappingBufferRecord


        if (buffer == null)
            throw new NullPointerException("Buffer is null.");
        Map<Integer, IndexMappingBufferRecord> map = buffer.getMap();
        int[] from = new int[map.size()], to = new int[map.size()];
        int count = 0;
        IndexMappingBufferRecord record;
        for (Map.Entry<Integer, IndexMappingBufferRecord> entry : map.entrySet()) {
            from[count] = entry.getKey();
            record = entry.getValue();
            to[count++] = record.getIndexName() ^ (record.diffStatesInitialized() ? 0x80000000 : 0);
        }

        final int[] freeIndices = tensor.getIndices().getFree().getAllIndices().copy();
        for (int i = 0; i < freeIndices.length; ++i)
            freeIndices[i] = IndicesUtils.getNameWithType(freeIndices[i]);
View Full Code Here


        IndexGenerator ig = new IndexGenerator(TensorUtils.getAllIndices(target));

        List<SimpleTensor> metrics = new ArrayList<>();

        for (Map.Entry<Integer, IndexMappingBufferRecord> entry : indexMappingBuffer.getMap().entrySet()) {
            IndexMappingBufferRecord record = entry.getValue();

            //diff states mapping detected
            if (record.diffStatesInitialized() && !record.isContracted()) {
                fromIndex = entry.getKey().intValue();
                toIndex = ig.generate(IndicesUtils.getType(fromIndex));
                preprocess.add(fromIndex, toIndex);

                byte states = record.getStates();
                if ((states & 1) == 1)
                    metrics.add(CC.createMetric(fromIndex, toIndex));
                else
                    metrics.add(CC.createMetric(0x80000000 | fromIndex, 0x80000000 | toIndex));
            }
View Full Code Here

            return tensor;

        Map<Integer, IndexMappingBufferRecord> map = buffer.getMap();
        int[] from = new int[map.size()], to = new int[map.size()];
        int count = 0;
        IndexMappingBufferRecord record;
        for (Map.Entry<Integer, IndexMappingBufferRecord> entry : map.entrySet()) {
            from[count] = entry.getKey();
            record = entry.getValue();
            to[count++] = record.getIndexName() ^ (record.diffStatesInitialized() ? 0x80000000 : 0);
        }

        final int[] freeIndices = getIndicesNames(tensor.getIndices().getFree());
        Arrays.sort(freeIndices);
        int[] _from = from.clone();
View Full Code Here

        if (buffer == null)
            throw new NullPointerException("Buffer is null.");
        Map<Integer, IndexMappingBufferRecord> map = buffer.getMap();
        int[] from = new int[map.size()], to = new int[map.size()];
        int count = 0;
        IndexMappingBufferRecord record;
        for (Map.Entry<Integer, IndexMappingBufferRecord> entry : map.entrySet()) {
            from[count] = entry.getKey();
            record = entry.getValue();
            to[count++] = record.getIndexName() ^ (record.diffStatesInitialized() ? 0x80000000 : 0);
        }

        final int[] freeIndices = tensor.getIndices().getFreeIndices().getAllIndices().copy();
        for (int i = 0; i < freeIndices.length; ++i)
            freeIndices[i] = IndicesUtils.getNameWithType(freeIndices[i]);
View Full Code Here

TOP

Related Classes of cc.redberry.core.indexmapping.IndexMappingBufferRecord

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.