Learn R Programming

clifford (version 1.0-2)

getcoeffs: Get coefficients of a Clifford object

Description

Access specific coefficents of a Clifford object using a list of terms.

Usage

getcoeffs(C, B)
const(C,drop=TRUE)
# S3 method for clifford
const(x) <- value

Arguments

C,x

Clifford object

B

List of terms

value

Replacement value

drop

Boolean, with default TRUE meaning to return the constant coerced to numeric, and FALSE meaning to return a (constant) Clifford object

Details

Extractor method for specific terms. Function const() returns the constant element of a Clifford object. Note that const(C) returns the same as grade(C,0), but is faster.

The slightly awkward R idiom in const<-() is to ensure numerical accuracy; see examples.

See Also

clifford

Examples

Run this code
# NOT RUN {
X <- clifford(list(1,1:2,1:3,3:5),6:9)

getcoeffs(X,1:2)

X <- X+1e300

const(X) # should be 1e300

const(X) <- 0.6
const(X) # should be 0.6, no numerical error

# }

Run the code above in your browser using DataLab