#ifndef PFOR_PFOR_ALGORITHM_H #define PFOR_PFOR_ALGORITHM_H #include "index/properties.h" #include "expression/expression.h" namespace pfor { /** */ template struct SubstituteVariableInLinIndexSlopeImpl { using type = I; }; template struct SubstituteVariableInLinIndexSlopeImpl>> { using type = index::LinearIndex, index::linearSlope*b + index::linearOffset>; }; template using SubstituteVariableInLinIndexSlope = typename SubstituteVariableInLinIndexSlopeImpl::type; /** */ template struct SubstituteVariableInExpressionImpl; template struct SubstituteVariableInExpressionImpl, a, b> { using type = expr::Expression::type...>; }; template struct SubstituteVariableInExpressionImpl, a, b> { using type = expr::Expression>; }; template struct SubstituteVariableInExpressionImpl, Id, Index>, a, b> { using type = expr::Expression, Id, SubstituteVariableInLinIndexSlope>; }; template struct SubstituteVariableInExpressionImpl, a, b> { using type = expr::Constant; }; template using SubstituteVariableInExpression = typename SubstituteVariableInExpressionImpl::type; template struct GenSubstituteVariableInExpression { template using type = SubstituteVariableInExpression; }; } #endif