1
I'm making a program to find the matrix of minors ([wikipedia]http://en.wikipedia.org/wiki/Minor_(linear_algebra[/wikipedia])), and I keep getting a DIM error at [A](I,J)->(M,N). This is my code:
I don't see why I would get this error. Also, I'm basing this code on http://chi3x10.wordpress.com/2008/05/28/calculate-matrix-inversion-in-c/ inside this code block:
Code: [Select]
Prompt [A]
dim([A])ListDIM
ListDIM(1)->O
{O-1,O-1}->dim([B])
ListDIM->dim([C])
For(Y,1,O)
For(X,1,O)
1üM
1üN
For(I,1,O)
If I "is not equal to" R
1->N
For(J,1,O)
If J "is not equal to" C
[b][A](I,J)->[B](M,N)[/b]
N+1->N
End
End
M+1->M
End
End
det([B])->[C](X,Y)
End
End
Disp [C]
I don't see why I would get this error. Also, I'm basing this code on http://chi3x10.wordpress.com/2008/05/28/calculate-matrix-inversion-in-c/ inside this code block:
Code: [Select]
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];
}
}