# Singular

### 5.1.90 minor

`Syntax:`
`minor (` matrix_expression M`,` int_expression mSize`,`
`[` ideal_expression I`],`
`[` int_expression k`],`
`[` string_expression algorithm`],`
`[` int_expression cachedP`],`
`[` int_expression cachedM`])`
`Type:`
ideal
`Purpose:`
returns the specified set of (mSize x mSize)-minors (= subdeterminants) of the given matrix M. These minors form the list of generators of the returned ideal.
If the optional ideal I is given, it is assumed to capture a standard basis. In this case, all computations will be performed modulo I.
If k is not given, all minors will be computed. Otherwise, if k > 0, the first k non-zero minors will be computed; for k < 0, the first |k| minors will be computed regardless whether they are zero or not. Here, "first k minors" is with respect to a fixed ordering among all minors. (To understand the ordering, run the below example, type `minor(m,2,i,18);` and inspect the ordering among the returned 18 minors. Note that this ordering is only enforced when some k <> 0 is provided. Otherwise, no ordering among the returned minors can be guaranteed. This is due to the fact that in this case, `minor` may call a specially tuned implementation of Bareiss's algorithm.)
If no algorithm is given, a heuristic will pick the best-suited algorithm among Bareiss's algorithm (which is only applicable over integral domains), Laplace's algorithm, and Laplace's algorithm combined with caching of subdeterminantes. In the heuristic setting, cacheP and cacheM must also be absent.
If the argument algorithm is present it must be one of `B/bareiss`, `L/laplace`, and `C/cache`. For, `B/bareiss` and `L/laplace` the optional arguments cacheP and cacheM must again be absent, whereas for `C/cache`, they may be provided: cachedP determines the maximum number of cached subdeterminantes (=polynomials), and cachedM the total number of cached monomials (counted over all cached polynomials). If, for algorithm = `C/cache` cachedP and cachedM are not provided by the user, the values 200 and 100000, respectively, will be used as defaults.
`Note:`
If `mSize` is larger than the given matrix, `minor` returns 0, if `mSize` is smaller than 1, `minor` returns 1.
`Example:`
 ``` ring r=0,(a,b,c,d,e,f,g,h,s,t,u,v),ds; matrix m=a,b,c,d,e,f,g,h,s,t,u,v; print(m); ==> a,b,c,d, ==> e,f,g,h, ==> s,t,u,v // let's compute all non-zero minors; // here we do not guarantee any ordering: minor(m,2); ==> _=-hu+gv ==> _=-ht+fv ==> _=-hs+ev ==> _=-du+cv ==> _=-dt+bv ==> _=-ds+av ==> _=gt-fu ==> _=gs-eu ==> _=ct-bu ==> _=cs-au ==> _=-fs+et ==> _=-bs+at ==> _=-dg+ch ==> _=-df+bh ==> _=-de+ah ==> _=cf-bg ==> _=ce-ag ==> _=-be+af ideal i=a,c; i=std(i); // here come the first 4 non-zero minors mod I; // this time, a fixed ordering is guaranteed: minor(m,2,i,4); ==> _=-be ==> _=bg ==> _=-de ==> _=-df+bh // and here the first 4 minors mod I (possibly zero) // using Laplace's algorithm, // again, the fixed ordering is guaranteed: minor(m,2,i,-4,"Laplace"); ==> _=-be ==> _=0 ==> _=bg ==> _=-de ```
See det.

### Misc 