Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Escalonando Matrizes em APL: Código
RIDENTITY N
R(N N)(1,N0)
REXTENDBOTTOM MAT
R(((MAT)1),0)\[1]MAT
REXTENDRIGHT MAT
R(((2MAT)1),0)\MAT
RN PIVOT MAT;LST;IDX
LSTN[1]MAT
IDX(0LST)1
(IDX>LST)/0
RIDXLST
RA GCD B
(B=0)/END
(A B)(B (|B | A))
1
END: RA
RSIMPVEC VEC;SIMPL
SIMPLVEC÷GCD/|VEC[|VEC]
(×+/0<SIMPL-SIMPL)/DONTSIMPL
RSIMPL
0
DONTSIMPL:RVEC
RL GAUSSELIM A;ZEROLNS
(0=+/|A[L;])/END
A[L;](×L PIVOT A)×SIMPVEC A[L;]
ZEROLNS(~L=ZEROLNS)/ZEROLNSA
R{A[;]((L PIVOT A)×A[;])-(A[;L]×A[L;])}¨ZEROLNS
END:RA
RGAUSSJORDAN MAT
R{MAT GAUSSELIM MAT}¨MAT
R{MAT[;]SIMPVEC MAT[;]}¨MAT
RMAT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.