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 basisz
such thatz=x
ifv
is already aN
-linear combination of the elements ofx
. Otherwise,z
is the union ofv
with all elements fromx
that are not anN
-multiple ofv
. assert(v
.i>0
fori
in 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 vectorz
such that reducible?(z
,x
) isfalse
andv
-z
is aN
-linear combination of elements fromx
.
- reducible?: (Vector Integer , %) -> Boolean
reducible?(v, x)
returnstrue
if the vectorv
isN
-linear combination of elements inx
whereN
is the ring of natural numbers.
- sup: % -> Vector Integer
sup(x)
returns a minimal (w
.r
.t
reducibility) element that is reducible by every element ofx
. Ifx
is 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
).