matrix 2-norm and associated matrix condition number



Barton Willis wrote:
> No, Maxima doesn't have an alternative to your function. Suggestions:
>
> (1) replace transpose(A).A  with transpose(conjugate(A).A.
>
> (2) replace sort with lmax.  The sort function sorts explicit numbers
> (things like 1.3 and 2/3) from least to greatest (I think), but it
> doesn't sort things like sqrt(3), %pi, 42... from least to greatest.
> So your sort function may return the wrong eigenvalue.
In my practice I need to find several the greatest real eigenvalues.
I use
realGr(L1,L2):=(if realpart(L1) >= realpart(L2) then true else false);
and then after calling lapack's dgeev on some matrix MT (with some parameters)
lamb:(dgeev(float(subst([P0=P00,ca=.0,cw=.5],MT)),true))$

sort it  with
sort(flatten((col(lamb,1))[1]),realGr);

V