## dx_1 ^ dx_2 + 6dx_5 ^ dx_6:
as.kform(1) ^ as.kform(2) + 6*as.kform(5) ^ as.kform(6)
k1 <- kform_general(4,2,rnorm(6))
k2 <- kform_general(4,2,rnorm(6))
E <- matrix(rnorm(8),4,2)
as.function(k1+k2)(E)
## verify linearity, here 2*k1 + 3*k2:
as.function(2*k1+3*k2)(E)-(2*as.function(k1)(E) + 3*as.function(k2)(E))
## should be small
Run the code above in your browser using DataLab