Learn R Programming

stokes (version 1.1-1)

zero: Zero tensors and zero forms

Description

Correct idiom for generating zero k-tensors and k-forms

Usage

zeroform(n)
zerotensor(n)

Arguments

n

Arity of the k-form or k-tensor

Value

Returns an object of class kform or ktensor.

See Also

scalar

Examples

Run this code
# NOT RUN {
as.ktensor(1+diag(5)) + zerotensor(5)
as.kform(matrix(1:6,2,3)) + zeroform(3)

## Following idiom is plausible but fails because as.ktensor(coeffs=0)
## and as.kform(coeffs=0) do not retain arity:

# }
# NOT RUN {
as.ktensor(1+diag(5)) +  as.ktensor(rep(1,5),0)   # fails
as.kform(matrix(1:6,2,3)) + as.kform(1:3,0)   # also fails
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab