min(2/eps,floor(flintmax))

That revision is only applicable for quarter precision.

I don’t know what totals the spam protection generates.

]]>I have revised the example with “lu” of my new version of MATLAB and thanks to your suggestion I have seen the answer: After the elimination of the second column, the last two entries in the third column are -1,-1. Due to finite precision arithmetic, the second one seems to be identified as greater and selected as pivot, which implies a second permutation: P34. Consequently, the permutation vector given by “lu” is now p=(1,4,2,3).

I see that, fortunately, there is no random interchange, only the effect of finite precision arithmetic (which, as we see, works a bit differently with the built-in function “lu” and with your teaching codes “lutx” and “lugui”).

I like these Pascal matrices very much for their interesting properties. For instance, when using Neville elimination (in exact arithmetic) all the entries revealed by elimination are equal to one. Using the expression of P. Koev, BD(A) = ones(n,n) if A is a Pascal matrix or order n.

Thank you again for your work. ]]>

A = [1 2; 1 1].

If A(1,1) is chosen as the first pivot, then

[1 0; 1 1]*[1 2; 0 -1] = A

But if A(2,1) is chosen as the first pivot, then

[1 0; 1 1]*[1 1; 0 1] = A([2 1],:)

Both are legitimate LU factorizations of A.

Different codes are free to make different choices.uu

Take a look at “lugui” from “Numerical Computing with MATLAB.

https://www.mathworks.com/matlabcentral/fileexchange/37976-numerical-computing-with-matlab

— Cleve ]]>

I would like to have your answer, which may be useful for many teachers/researchers. Thank you very much for your wonderful work. ]]>

Thanks for identifying yourself. I’m always happy to have an excuse to discuss floating point arithmetic.

— Cleve ]]>