DDM(rows, shape, domain) is a dense matrix over a polynomial domain
(SymPy's sympy.polys.matrices.ddm.DDM), SDM(elemsdict, shape, domain) a sparse one (sympy.polys.matrices.sdm.SDM) given as a nested
list list(i = list(j = element)) with 0-based names, or as a list of
list(i, list(list(j, element), ...)) pairs. They are the internal
representations of DomainMatrix() (A$rep), with the same methods as
in SymPy, called with $: M$rref(), M$det(), M$matmul(N), ...
Indices passed to methods are 0-based as in SymPy.
Usage
DDM(rows, shape, domain)
# S3 method for class 'DDM'
x$name
# S3 method for class 'DDM'
format(x, ...)
# S3 method for class 'DDM'
print(x, ...)
# S3 method for class 'DDM'
Ops(e1, e2)
SDM(elemsdict, shape, domain)
# S3 method for class 'SDM'
x$name
# S3 method for class 'SDM'
format(x, ...)
# S3 method for class 'SDM'
print(x, ...)
# S3 method for class 'SDM'
Ops(e1, e2)Examples
A <- DDM(list(list(ZZ(1), ZZ(2)), list(ZZ(3), ZZ(4))), c(2, 2), ZZ)
A$det()
#> Big Integer ('bigz') :
#> [1] -2
A$charpoly()
#> [[1]]
#> Big Integer ('bigz') :
#> [1] 1
#>
#> [[2]]
#> Big Integer ('bigz') :
#> [1] -5
#>
#> [[3]]
#> Big Integer ('bigz') :
#> [1] -2
#>
B <- SDM(list(`0` = list(`1` = ZZ(2))), c(2, 2), ZZ)
B$to_ddm()
#> DDM([[0, 2], [0, 0]], (2, 2), ZZ)