Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: greg701 on May 09, 2011, 02:09:28 pm
-
Hi all I have a TI-Nspire (Non CAS)
I was wondering how (or whether) it would be possible to create a program which can find the adjacency matrix of a given matrix.
I have no idea even how to start this so any help in the right direction would be great.
Thanks
Greg
-
An adjacency matrix is a matrix representation of a graph...How do you intend to find an adjacency matrix of matrix?
-
Lol, typed the wrong thing... I mean I want to find the adjugate of the matrix.
Sorry it's been a long day x
-
Well, the easy way is
adjugate(a) = det(a)a-1
but this only works if a is invertible. If not, I guess you could just manually compute each cofactor:
Define adjugate(a)=
Func
Local adj,c,i,j,k,n
n:=rowDim(a)
adj:=newMat(n,n)
For i,1,n
For j,1,n
c:=a
For k,1,n
c[j,k]:=0
c[k,i]:=0
EndFor
c[j,i]:=1
adj[i,j]:=det(c)
EndFor
EndFor
Return adj
EndFunc