File: det-doc.m2

package info (click to toggle)
macaulay2 1.17.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 68,376 kB
  • sloc: cpp: 102,995; ansic: 10,040; javascript: 6,019; sh: 3,506; makefile: 3,426; lisp: 727; yacc: 590; perl: 369; xml: 177; python: 141; lex: 65; awk: 3
file content (48 lines) | stat: -rw-r--r-- 1,886 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--- status: Draft
--- author(s): Gregory G. Smith
--- notes: 

document { 
     Key => {det,(det,Matrix),(determinant,MutableMatrix)},
     Headline => "determinant of a matrix",     
     Usage => "det M",
     Inputs => {
	  "M" => {"a square ", TO2("Matrix","matrix")}
	  },
     Outputs => {
	  RingElement => {"which is the determinant of ", TT "M"} 
	  },
     EXAMPLE {
	  "R = QQ[vars(0..8)]",
	  "M = genericMatrix(R,2,2)",
	  "det M",
	  "N = genericMatrix(R,3,3)",
	  "det N"
	  },
     SeeAlso => {exteriorPower, minors, permanents, pfaffians}     
     }
scan({det,minors,exteriorPower}, fn -> document { 
     Key => [fn, Strategy],
     Headline => "choose between Bareiss and Cofactor algorithms",     
     Usage => toString fn | "(M, Strategy => s)",     
     Inputs => {
	  "M" => Matrix,
	  "s" => Symbol => {"either ", TT "Bareiss", " or ", TT "Cofactor"}	  
	  },
     Consequences => {
	  { "If ", TT "s", " is ", TO "Bareiss", ", then the Bareiss algorithm is used; if ",
	       TT "s", " is ", TO "Cofactor", ", then cofactor expansion is used."}},     
     "The ", TO2("Ring","ring"), " of ", TT "M", " determines the default strategy.  If the ring is a ", 
     TO2("PolynomialRing","polynomial ring"), " or a field (as identified by ", TO "isField",  
     ") then the ", TO "Bareiss", " algorithm is used.  If the ring is a ", 
     TO2("QuotientRing", "quotient ring"), " (which has not been declared a field by ", TO "toField", 
     "), then the ", TO "Cofactor", " algorithm is used.",
     PARA{},     
     Caveat => {
	  {"The ", TO "Bareiss", " algorithm returns a ring element that may differ from the actual 
	       determinant by a zero divisor in the ring.  Thus, an ", EM "incorrect", 
	       " answer may be computed if the ring contains zero divisors."}
	  },
     SeeAlso => select({det, exteriorPower, minors}, g -> g =!= fn)
     })