home *** CD-ROM | disk | FTP | other *** search
/ El Mac 9 / El Mac 9.iso / Shareware / Applications / MathPad 2.4 / Examples / incl / matrix ops < prev    next >
Encoding:
Text File  |  1994-05-30  |  573 b   |  20 lines  |  [TEXT/MPad]

  1. ---------- matrix operations ------------
  2. multiply(A,B)[i,j] = sum(A[i,k]*B[k,j],k,
  3.          1,count(B)) dim[count(A),count(B[1])]
  4.  
  5. transpose(A)[i,j] = A[j,i] dim
  6.                         [count(A[1]),count(A)]
  7.  
  8. invert(A) = adjoint(A)/det(A)
  9.  
  10. adjoint(A) = transpose(cofactor(A))
  11.  
  12. cofactor(A)[i,j] = (-1)^(i+j)*
  13.                    det(submatrix(A,i,j))
  14.  
  15. submatrix(A,k,l)[i,j] = A[i,j] when i<k and j<l,
  16.             A[i+1,j] when i≥k and j<l,
  17.             A[i+1,j+1] when i≥k and j≥l,
  18.             A[i,  j+1] when i<k and j≥l dim
  19.                         [count(A)-1,count(A)-1]
  20.