for (dim <- 0 to 2) yield new Max[IntType](leftOrigin(dim), rightOrigin(dim))
val bottomRight : Seq[Expression[IntType]] =
- for (dim <- 0 to 2) yield new Min[IntType](leftOrigin(dim) + leftSize(dim), rightOrigin(dim) + rightSize(dim))
+ for (dim <- 0 to 2) yield new Min[IntType](leftOrigin(dim) + leftSize(dim), rightOrigin(dim) + rightSize(dim)) - 1
val indices = for(dim <- 0 to 2) yield {
val index = new DeclaredVarSymbol[IntType]("i"+(dim+1))
context += new AssignStatement(result, new FloatLiteral(0.0))
context += loops(2)
- val leftIndex = for (dim <- 0 to 2) yield indices(dim) - leftOrigin(dim)
- val rightIndex = for (dim <- 0 to 2) yield indices(dim) - rightOrigin(dim)
+ val leftIndex = for (dim <- 0 to 2) yield indices(dim) - leftOrigin(dim) + 1
+ val rightIndex = for (dim <- 0 to 2) yield indices(dim) - rightOrigin(dim) + 1
loops(0) += new AssignStatement(result, (result : Expression[FloatType]) +
leftDense.getBuffer.at(leftIndex: _*) *