Exemplo n.º 1
0
/**
 * Создает полностью детерминированную зависимость
 * Все недетерминированные выражения в индексах заменяются на 
 * диапазон 0..размерность
 */
stringSet createActual(const stringSet &arg)
{
    stringSet result;
    stringSet::const_iterator beg = arg.begin();
    stringSet::const_iterator end = arg.end();

    while (beg != end)
    {
        TParam cur = *--end;
        if (!cur. isArrayElement())
        {
            result. push_back(cur); // fixme - remember arrayScalar
            continue;
        }
        // index case
        int dim = cur. getDimension();
        TIndex *indexes = cur. getIndexes();
        TDimensionList list = cur. getTypeInfo(). second;
        TDimensionList::iterator beg = list. begin();
        for (int i = dim - 1; i >= 0; i--, beg++)
        {
            if (indexes[i]. isAtom())
            {
                indexes[i] = TIndex(TRange(0, (*beg - 1)));
                continue;
            }
        }
        // этот элемент будет прозрачный в силу изначальной недетерминированности его индекса
        TParam res(cur. getName(), indexes, dim, cur.getTypeInfo(), true);
        //cout<<"Create Actual :"<<res<<endl;
        concat(result, toLocalMemoryUse(res));
        delete[] indexes;
    }
    packUnifySet(result);
    return result;
}