File: matfun.mac

package info (click to toggle)
maxima-sage 5.45.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 113,788 kB
  • sloc: lisp: 440,833; fortran: 14,665; perl: 14,369; tcl: 10,997; sh: 4,475; makefile: 2,520; ansic: 447; python: 262; xml: 59; awk: 37; sed: 17
file content (8 lines) | stat: -rw-r--r-- 324 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8

/* Assorted matrix functions written for ELIZC by JPG */
/* Examples: Let M be a 4x4 matrix.
ROWS(M,[1,3]); gives MATRIX([M11,M12,M13,M14],[M31,M32,M33,M34]).
COLS(M,[1,3]); gives MATRIX([M11,M13],[M21,M23],[M31,M33],[M41,M43]). */

rows(m,r):=apply('matrix,makelist(m[i],i,r))$
cols(m,c):=transpose(rows(transpose(m),c))$