Next: Debugging
Up: Line minimization
Previous: Theory of line minimization
Using the value alphat=1e-5 for
, put code which implements
Eq. (1) at the location indicated in the code for this problem.
Hints:
- Eq. (1) requires
, the
value of the gradient evaluated for the vector
.
You may wish to define a pvector ut=u+alphat*dir, and then replicate
the code your wrote previously for computing N, D and the gradient,
calling the new result gradt instead of grad. - Dot products like
are equal to the real part of the ``dagger product'',
. So your code will have
fragments that look something like
``real(dir^gradt)-real(dir^grad)''.
Tomas Arias
Mon Apr 15 14:09:23 EDT 2002