scalar: Lose attributes

Description Usage Arguments Details Author(s) See Also Examples

Description

Scalars: 0-forms and 0-tensors

Usage

1
2
3
4
5
6
7
scalar(s,lose=FALSE)
is.scalar(M)
`0form`(s,lose=FALSE)
## S3 method for class 'kform'
lose(M)
## S3 method for class 'ktensor'
lose(M)

Arguments

s

A scalar value; a number

M

Object of class ktensor or kform

lose

In function scalar(), Boolean with TRUE meaning to return a normal scalar, and default FALSE meaning to return a formal 0-form or 0-tensor

Details

A k-tensor (including k-forms) maps k vectors to a scalar. If k=0, then a 0-tensor maps no vectors to a scalar, that is, mapping nothing at all to a scalar, or what normal people would call a plain old scalar. Such forms are created by a couple of constructions in the package, specifically scalar(), kform_general(1,0) and contract(). These functions take a lose argument that behaves much like the drop argument in base extraction.

Function lose() takes an object of class ktensor or kform and, if of arity zero, returns the coefficient.

Note that function kform() always returns a kform object, it never loses attributes.

A 0-form is not the same thing as a zero tensor. A 0-form maps V^0 to the reals; a scalar. A zero tensor maps V^k to zero.

Author(s)

Robin K. S. Hankin

See Also

zeroform,lose

Examples

1
2
3
4
5
6

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