0 Members and 1 Guest are viewing this topic.
Prompt [A]dim([A])ListDIMListDIM(1)->O{O-1,O-1}->dim([B])ListDIM->dim([C])For(Y,1,O)For(X,1,O)1üM1üNFor(I,1,O)If I "is not equal to" R1->NFor(J,1,O)If J "is not equal to" C[b][A](I,J)->[B](M,N)[/b]N+1->NEndEndM+1->MEndEnddet([B])->[C](X,Y)EndEndDisp [C]
for(int j=0;j<order;j++) { for(int i=0;i<order;i++) { // get the co-factor (matrix) of A(j,i) GetMinor(A,minor,j,i,order); Y[i][j] = det*CalcDeterminant(minor,order-1); //Not including these 2 lines in the TI-BASIC version if( (i+j)%2 == 1) Y[i][j] = -Y[i][j]; } }
Code: [Select]{O-1,O-1}->dim([B])
{O-1,O-1}->dim([B])
ClrHomePrompt [A][A]→[C]dim([A]Ans(1→DFor(A,1,D[A]T ;T=transposeFor(B,A,D-1rowSwap(Ans,B,B+1EndAnsT→[B] ;The Ts here are transpose. [2nd][Matrix][right][2]For(C,1,D-1[B]For(B,C,D-1rowSwap(Ans,B,B+1EndAns→[D]{D-1,D-1→dim([D]det([D]→[C](C,AEndEndClrHome[C]
:ClrHome:Repeat A=B:Input "MATRIX=", [A]:dim([A]:Ans(1->A:dim([A]:Ans(2->B:If A=/=B:Disp "ERROR.CHECK DIM.:End:Disp "MATRIX DIM:", dim([A]:Repeat I>0 and I<=A:Input "I ROW=", I:ipart(I->I:If I<=0 and I>A:Disp "IMPOSSIBLE:End:Repeat J>0 or J<=A:Input "J COLUMN=", J:ipart(J->J:If J<=0 or J>A:Disp "IMPOSSIBLE:End*:[A]->[B]:Disp "WORKING...":If I =/= A:rowSwap([B],A,I->[B]:{A-1,A->dim([B]:For(B,I,A-2:rowSwap([B],B,B+1->[B]:End:[B]transpose(little T)->[B]:If J =/= A:rowSwap([B],A,J->[B]:{A-1,A-1->dim([B]:For(B,J,A-2:rowSwap([B],B,B+1->[B]:End:[B]transpose(little T)->[B]:ClrHome*:Disp "MATRIX", [A]*:Pause:Disp "MINOR MATRIX", [B]:Pause:Disp "DETERMINANT", det([B]
Prompt [A][A]→[B]min(dim(Ans→AFor(Y,1,AFor(X,1,A*row(0,[A],Y→[C]1-4fPart(.5(X+Y→[C](Y,Xdet([C]→[B](Y,XEndEndDelVar [C][B]
Prompt [A]min(dim([A]→Aidentity(AFor(B,2,A,2*row(⁻1,Ans,BEndAns([A]⁻¹Ans)ᵀdet([A]