|
@@ -48,7 +48,7 @@ public class Combine {
|
|
|
if( graph.parent() == null )
|
|
|
graph.setColor( null, null );
|
|
|
});
|
|
|
- return null;
|
|
|
+ return new ControlFlow( ControlFlow.STEP_OVER );
|
|
|
}
|
|
|
}));
|
|
|
PseudoCodeNode firstLoop = new PseudoCodeNode( "foreach l in ['DOWN_RIGHT', 'DOWN_LEFT', 'UP_RIGHT', 'UP_LEFT'] do", vars, tree, new ForEachLoop<String>( "l" ) {
|
|
@@ -89,7 +89,7 @@ public class Combine {
|
|
|
@Override
|
|
|
public ControlFlow runForward(Memory m) {
|
|
|
String layout = m.read( "l", MemoryType.LOCAL );
|
|
|
- m.declare( "height[" + layout + "]", m.<Integer>read( "max[" + layout + "]", MemoryType.LOCAL ) - m.<Integer>read( "min[" + layout + "]", MemoryType.LOCAL ), MemoryType.GLOBAL );
|
|
|
+ m.declare( "width[" + layout + "]", m.<Integer>read( "max[" + layout + "]", MemoryType.GLOBAL ) - m.<Integer>read( "min[" + layout + "]", MemoryType.GLOBAL ), MemoryType.GLOBAL );
|
|
|
actions.add( (Memory mem) -> {
|
|
|
mem.undeclare( "width[" + layout + "]", MemoryType.GLOBAL );
|
|
|
});
|
|
@@ -130,9 +130,9 @@ public class Combine {
|
|
|
String layout = m.read( "l", MemoryType.LOCAL );
|
|
|
String lMin = m.read( "l_min", MemoryType.LOCAL );
|
|
|
if( layout.contains( "RIGHT" ) )
|
|
|
- m.declare( "shift[" + layout + "]", m.<Integer>read( "min[" + lMin + "]", MemoryType.LOCAL ) - m.<Integer>read( "min[" + layout + "]", MemoryType.LOCAL ), MemoryType.GLOBAL );
|
|
|
+ m.declare( "shift[" + layout + "]", m.<Integer>read( "min[" + lMin + "]", MemoryType.GLOBAL ) - m.<Integer>read( "min[" + layout + "]", MemoryType.GLOBAL ), MemoryType.GLOBAL );
|
|
|
else
|
|
|
- m.declare( "shift[" + layout + "]", m.<Integer>read( "max[" + lMin + "]", MemoryType.LOCAL ) - m.<Integer>read( "max[" + layout + "]", MemoryType.LOCAL ), MemoryType.GLOBAL );
|
|
|
+ m.declare( "shift[" + layout + "]", m.<Integer>read( "max[" + lMin + "]", MemoryType.GLOBAL ) - m.<Integer>read( "max[" + layout + "]", MemoryType.GLOBAL ), MemoryType.GLOBAL );
|
|
|
actions.add( (Memory mem) -> {
|
|
|
mem.undeclare( "shift[" + layout + "]", MemoryType.GLOBAL );
|
|
|
});
|