module igrad1 { # gradient in one dimension #% _lop( xx, yy) integer i do i= 1, size(xx)-1 { if( adj) { xx(i+1) = xx(i+1) + yy(i) # resembles equation (1.2) xx(i ) = xx(i ) - yy(i) } else yy(i) = yy(i) + xx(i+1) - xx(i) # resembles equation (1.1) } }