Reduced row echelon form: Difference between revisions
Content added Content deleted
m (→{{header|Maxima}}: was wrong) |
|||
Line 1,857: | Line 1,857: | ||
=={{header|Maxima}}== |
=={{header|Maxima}}== |
||
<lang maxima>rref(a):=block([p,q,k],[p,q]:matrix_size(a),a:echelon(a), |
<lang maxima>rref(a):=block([p,q,k],[p,q]:matrix_size(a),a:echelon(a), |
||
k:min(p,q), |
|||
for i:p thru 2 step -1 do ( |
|||
if |
for i thru min(p,q) do (if a[i,i]=0 then (k:i-1,return())), |
||
for i:k thru 2 step -1 do (for j from i-1 thru 1 step -1 do a:rowop(a,j,i,a[j,i])), |
|||
for j from i-1 thru 1 step -1 do a:rowop(a,j,i,a[j,k])), |
|||
a)$ |
a)$ |
||
a: matrix([12,-27,36,44,59], |
|||
[26,41,-54,24,23], |
|||
⚫ | |||
[33,70,59,15,-68], |
|||
⚫ | |||
[43,16,29,-52,-61], |
|||
[-43,20,71,88,11])$ |
|||
⚫ | |||
⚫ | |||
=={{header|Objeck}}== |
=={{header|Objeck}}== |