Complex: Complex functionality for onions

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Functionality in the Complex group.

The norm Norm(O) of onion O is the product of O with its conjugate: |O|=OO^* but a more efficient numerical method is used (see dotprod()).

The Mod Mod(O) of onion O is the square root of its norm.

The sign of onion O is the onion with the same direction as O but with unit Norm: sign(O)=O/Mod(O).

Function Im() sets the real component of its argument to zero, and Conj() flips the sign of its argument's non-real components.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S4 method for signature 'onion'
Re(z)
## S4 method for signature 'onion'
Im(z)
Re(z) <- value
Im(x) <- value
## S4 method for signature 'onion'
Conj(z)
## S4 method for signature 'onion'
Mod(z)
onion_abs(x)
onion_conjugate(z)
## S4 method for signature 'onion'
sign(x)

Arguments

x,z

Object of class onion or glub

value

replacement value

Value

All functions documented here return a numeric vector or matrix of the same dimensions as their argument, apart from functions Im() and Conj(), which return an object of the same class as its argument.

Note

If x is a numeric vector and y an onion, one might expect typing x[1] <- y to result in x being a onion. This is impossible, according to John Chambers.

Extract and set methods for components such as i,j,k are documented at Extract.Rd

Author(s)

Robin K. S. Hankin

See Also

Extract

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
a <- rquat()
Re(a)
Re(a) <- j(a)

Im(a)

b <- romat()

A <- romat()
Im(A) <- Im(A)*10

onion documentation built on Feb. 11, 2021, 9:06 a.m.