function [out, Elist]=lm(W,Nit)
Input:
- W:
matrix containing initial guess for eigensolutions
- Nit: Number of iterations desired
Output:
- out: Result of Nit iterations of line minimization
- Elist: Nit
1 column vector containing result of getE() after each iteration
- DISPLAY: result of each getE(), ``linmin test'' (angle cosine between
previous search direction and current gradient)
Implement the line minimization algorithm discussed in lecture,
- Initialize
- Evaluate gradient:
- If not first iteration, do ``linmin test'': check the angle cosine
, where
is the previous search direction
- Set search direction:
- Evaluate gradient at trial step:
- Compute estimate of best step:
-
- Repeat (2-7)
with a function of the above prototype in the file ``lm.m''. You may
wish to experiment with the trial step size. You will find that the
algorithm is not very sensitive to this parameter. A trial
step size of
works well.
Hint:
Because of our trick of coding
gradients as complex matrices, we must evaluate the dot products
according to the formula
Subsections
Tomas Arias
2007-04-26