NModuleBasis nΒΆ
NModuleBasis(n) represents the generators of an N-submodule of N^n.
- empty: () -> %
empty()represents the empty module basis.
- insert: (Vector Integer , %) -> %
insert(v, x)returns a new basiszsuch thatz=xifvis already aN-linear combination of the elements ofx. Otherwise,zis the union ofvwith all elements fromxthat are not anN-multiple ofv. assert(v.i>0foriin 1..n)
- members: % -> List Vector Integer
members(x)returns a basis of the (sub-)module such that no element is aN-linear combination of the other elements.
- reduce: (Vector Integer , %) -> Vector Integer
reduce(v, x)returns a vectorzsuch that reducible?(z,x) isfalseandv-zis aN-linear combination of elements fromx.
- reducible?: (Vector Integer , %) -> Boolean
reducible?(v, x)returnstrueif the vectorvisN-linear combination of elements inxwhereNis the ring of natural numbers.
- sup: % -> Vector Integer
sup(x)returns a minimal (w.r.treducibility) element that is reducible by every element ofx. Ifxis empty, it returns the zero vector. sup(x) is the supremum (w.r.t. reducibility) of all elements inx.
- supSum: % -> Integer
supSum(x)returns the sum of the entries of sup(x).