Ops: Arithmetic Ops Group Methods for 'kform' and 'ktensor'...

Description Usage Arguments Details Examples

Description

Allows arithmetic operators to be used for k-forms and k-tensors such as addition, multiplication, etc, where defined.

Usage

1
2
3
4
## S3 method for class 'kform'
Ops(e1, e2 = NULL)
## S3 method for class 'ktensor'
Ops(e1, e2 = NULL)

Arguments

e1,e2

Objects of class kform or ktensor

Details

The functions Ops.kform() and Ops.ktensor() pass unary and binary arithmetic operators (“+”, “-”, “*”, and “/”) to the appropriate specialist function by coercing to spray objects.

For wedge products of k-forms, use wedge() or %^%; and for cross products of k-tensors, use cross() or %X%.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)


as.function(2*k1+3*k2)(E)-(2*as.function(k1)(E) + 3*as.function(k1)(E))
## should be small

wedge documentation built on Sept. 4, 2019, 9:02 a.m.