]> git.unchartedbackwaters.co.uk Git - francis/ofc.git/commitdiff
Attempt to fix SPAM3 iteration.
authorFrancis Russell <francis@unchartedbackwaters.co.uk>
Sat, 19 May 2012 11:11:04 +0000 (12:11 +0100)
committerFrancis Russell <francis@unchartedbackwaters.co.uk>
Sat, 19 May 2012 11:11:04 +0000 (12:11 +0100)
src/ofc/generators/onetep/SPAM3.scala

index 064a0fcea966d6e3277514a2da9f11330a4b327b..2384f4bceb873244634523a5a20f91f0598cdb73 100644 (file)
@@ -39,22 +39,22 @@ class SPAM3(name : String, position: Seq[NamedIndex]) extends Scalar {
     context.addFooter(footer)
 
     val firstCol = new FunctionCall(OnetepFunctions.sparse_first_elem_on_node, 
-      Seq(OnetepVariables.pub_first_atom_on_node.at(OnetepVariables.pub_my_node_id),
+      Seq(OnetepVariables.pub_my_node_id,
           mat,
           new CharLiteral('C')))
 
     val lastCol = new FunctionCall(OnetepFunctions.sparse_first_elem_on_node, 
-      Seq(OnetepVariables.pub_first_atom_on_node.at((OnetepVariables.pub_my_node_id: Expression[IntType])+1),
+      Seq((OnetepVariables.pub_my_node_id: Expression[IntType])+1,
           mat,
           new CharLiteral('C'))) - 1
 
     val firstRow = new FunctionCall(OnetepFunctions.sparse_first_elem_on_node, 
-      Seq(OnetepVariables.pub_first_atom_on_node.at(OnetepVariables.pub_my_node_id),
+      Seq(OnetepVariables.pub_my_node_id,
           mat,
           new CharLiteral('R')))
 
     val lastRow = new FunctionCall(OnetepFunctions.sparse_first_elem_on_node, 
-      Seq(OnetepVariables.pub_first_atom_on_node.at((OnetepVariables.pub_my_node_id: Expression[IntType])+1),
+      Seq((OnetepVariables.pub_my_node_id: Expression[IntType])+1,
           mat,
           new CharLiteral('R'))) - 1
 
@@ -62,7 +62,7 @@ class SPAM3(name : String, position: Seq[NamedIndex]) extends Scalar {
     val colAtom = context.addExpression("col_atom", new FunctionCall(OnetepFunctions.sparse_atom_of_elem, 
       Seq(col, mat, new CharLiteral('C'))))
     val localColAtom = context.addExpression("local_col_atom", 
-      colAtom - OnetepVariables.pub_first_atom_on_node.at(OnetepVariables.pub_my_node_id))
+      colAtom - OnetepVariables.pub_first_atom_on_node.at(OnetepVariables.pub_my_node_id) + 1)
 
     val row = context.addIteration("row", firstRow, lastRow)
     val rowAtom = context.addExpression("row_atom", new FunctionCall(OnetepFunctions.sparse_atom_of_elem,