trait IterationSpace {
def getAccessExpression(indexNames: NameManager) : String
- def getOperands() : List[IterationSpace]
- def getSpatialIndices() : List[SpatialIndex]
- def getDiscreteIndices() : List[DiscreteIndex]
+ def getOperands : List[IterationSpace]
+ def getSpatialIndices : List[SpatialIndex]
+ def getDiscreteIndices : List[DiscreteIndex]
}
trait DataSpace extends IterationSpace {
- def getOperands() = Nil
+ def getOperands = Nil
}
trait Matrix extends DataSpace
}
class Scalar(value: Double) extends IterationSpace {
- def getOperands() = Nil
- def getSpatialIndices() = Nil
- def getDiscreteIndices() = Nil
+ def getOperands = Nil
+ def getSpatialIndices = Nil
+ def getDiscreteIndices = Nil
def getAccessExpression(indexNames: NameManager) = throw new UnimplementedException("Access failed")
}
new DenseDiscreteIndex(this, index)
def getOperands = operands
- def getSpatialIndices() = spatialIndices
- def getDiscreteIndices() = discreteIndices
+ def getSpatialIndices = spatialIndices
+ def getDiscreteIndices = discreteIndices
def getAccessExpression(indexNames: NameManager) = throw new UnimplementedException("Access failed")
}
}
val spatialIndices = for (dimension <- 0 until op.getSpatialIndices.size) yield
- new BlockIndex(this, dimension, op.getSpatialIndices()(dimension))
+ new BlockIndex(this, dimension, op.getSpatialIndices(dimension))
def getOperands = List(op)
- def getSpatialIndices() = spatialIndices.toList
- def getDiscreteIndices() = op.getDiscreteIndices
+ def getSpatialIndices = spatialIndices.toList
+ def getDiscreteIndices = op.getDiscreteIndices
def getAccessExpression(indexNames: NameManager) = throw new UnimplementedException("Access failed")
}
class Laplacian(op: IterationSpace) extends IterationSpace {
- def getOperands() = List(op)
- def getSpatialIndices() = op.getSpatialIndices
- def getDiscreteIndices() = op.getDiscreteIndices
+ def getOperands = List(op)
+ def getSpatialIndices = op.getSpatialIndices
+ def getDiscreteIndices = op.getDiscreteIndices
def getAccessExpression(indexNames: NameManager) = throw new UnimplementedException("Access failed")
}
val spatialIndices = for (dimension <- 0 until op.getSpatialIndices.size) yield new RestrictedIndex(this, dimension)
- def getOperands() = List(op)
- def getSpatialIndices() = spatialIndices.toList
- def getDiscreteIndices() = op.getDiscreteIndices
+ def getOperands = List(op)
+ def getSpatialIndices = spatialIndices.toList
+ def getDiscreteIndices = op.getDiscreteIndices
def getAccessExpression(indexNames: NameManager) = throw new UnimplementedException("Access failed")
}
val rowIndex = new RowIndex(this)
val colIndex = new ColIndex(this)
- def getSpatialIndices() = Nil
- def getDiscreteIndices() = List(rowIndex, colIndex)
+ def getSpatialIndices = Nil
+ def getDiscreteIndices = List(rowIndex, colIndex)
def getAccessExpression(indexNames: NameManager) = throw new UnimplementedException("Access failed")
}
var denseIndexNames : List[String] = Nil
def getName = "ppd_index"
- def getDependencies = Set[Index](parent.getSphereIndex())
+ def getDependencies = Set[Index](parent.getSphereIndex)
def getDensePPDIndices = denseIndexNames
//TODO: def getDenseWidth = parent.getSphereIndex.getSphere + "%n_ppds_sphere"
val sphereIndex = new SphereIndex(this)
val spatialIndices = for (dimension <- 0 to 2) yield new IntraPPDIndex(this, dimension)
- def getPPDIndex() = ppdIndex
- def getSphereIndex() = sphereIndex
+ def getPPDIndex = ppdIndex
+ def getSphereIndex = sphereIndex
def getSphere(names: NameManager) = basis + "%spheres("+names(getSphereIndex)+")"
- def getSpatialIndices() = spatialIndices.toList
- def getDiscreteIndices() = List(getSphereIndex(), getPPDIndex())
+ def getSpatialIndices = spatialIndices.toList
+ def getDiscreteIndices = List(getSphereIndex)
def getAccessExpression(indexNames: NameManager) = {
val index = getSphere(indexNames)+"%offset + &\n" +