consolidate.Rdconsolidate(S)
kill_trivial_rows(S)
include_perms(S)
kform_to_ktensor(S)Low-level helper functions, used in Alt() and kform().
Function consolidate() takes a spray object, and
combines any rows that are identical up to a permutation, respecting
the sign of the permutation.
Function kill_trivial_rows() takes a spray object and
deletes any rows with a repeated entry (which have \(k\)-forms
identically zero)
Function include_perms() replaces each row of a
spray object with all its permutations, respecting the sign
of the permutation
Function ktensor_to_kform() coerces a \(k\)-form
to a \(k\)-tensor
The functions documented here all return a spray object.
(S <- spray(matrix(c(1,1,2,2,1,3,3,1,3,5),ncol=2,byrow=TRUE),5:1))
#> val
#> 3 5 = 1
#> 3 1 = 2
#> 1 3 = 3
#> 2 2 = 4
#> 1 1 = 5
kill_trivial_rows(S) # (rows "1 1; 5" and and "2 2; 4" killed - identically zero)
#> val
#> 1 3 = 3
#> 3 1 = 2
#> 3 5 = 1
consolidate(S) # (merges rows "1 3; 3" and "3 1; 2")
#> val
#> 1 1 = 5
#> 2 2 = 4
#> 1 3 = 1
#> 3 5 = 1
include_perms(S) # returns a spray object, not an alternating tensor.
#> val
#> 5 3 = -1
#> 3 5 = 1
#> 3 1 = -1
#> 1 3 = 1
include_perms(spray(t(matrix(1:4))))
#> val
#> 4 3 2 1 = 1
#> 4 3 1 2 = -1
#> 4 1 3 2 = 1
#> 4 1 2 3 = -1
#> 3 4 2 1 = -1
#> 3 4 1 2 = 1
#> 3 1 4 2 = -1
#> 4 2 1 3 = 1
#> 1 2 3 4 = 1
#> 3 1 2 4 = 1
#> 1 2 4 3 = -1
#> 1 3 2 4 = -1
#> 1 3 4 2 = 1
#> 2 1 3 4 = -1
#> 4 2 3 1 = -1
#> 1 4 2 3 = 1
#> 2 4 1 3 = -1
#> 2 4 3 1 = 1
#> 3 2 4 1 = 1
#> 3 2 1 4 = -1
#> 1 4 3 2 = -1
#> 2 3 1 4 = 1
#> 2 1 4 3 = 1
#> 2 3 4 1 = -1