CLOSED BOOK CLASS QUIZ GP211	January 9, 2009

your name______________________________________________

Answer on this sheet.  Duration 4 minutes.
The module below computes a difference approximation to
the first derivative operator.  Enter the adjoint code.



module igrad1 {	                                   # gradient in one dimension
#%  _lop( xx,  yy)
integer i
do i= 1, size(xx)-1 {
        if( adj) {

		****************  WHAT GOES IN HERE ? ***********************
		*                                                           *
		*                                                           *
		*                                                           *
		*                                                           *
		*                                                           *
		*                                                           *
		*                                                           *
		*                                                           *
		*                                                           *
		*                                                           *
		*                                                           *
		*                                                           *
		*************************************************************

		}
	else
                yy(i) = yy(i) + xx(i+1) - xx(i)
	}
}