Skip to contents

Linear functions returning single, double, or triple-symbol aaa objects.

Usage

linear1(x)
linear2(x)
linear3(x)

Arguments

x

A numeric vector

Details

These functions return an antiassociative algebra element with the specified coefficients. Given a numeric vector v with elements \(v_1,v_2,\ldots, v_n\) then

linear1(v) returns \(v_1\mathbf{a} + v_2\mathbf{b}+\cdots+ v_n\mathbf{L_n}\), where \(\mathbf{L_n}\) is the \(n^\mathrm{th}\) letter of the alphabet. Similarly, linear2(v) returns \(v_1\mathbf{a}\mathbf{a}+\cdots+ v_n\mathbf{L_n}\mathbf{L_n}\), and linear3(v) returns \(v_1(\mathbf{a}\mathbf{a})\mathbf{a}+\cdots+ v_n(\mathbf{L_n}\mathbf{L_n})\mathbf{L_n}\). They are linear in the sense that

$$ f(\alpha\mathbf{x}+\beta\mathbf{y})= \alpha f(\mathbf{x})+\beta f(\mathbf{y})$$

where \(\alpha,\beta\in\mathbb{R}\) and \(\mathbf{x},\mathbf{y}\in\mathbb{R}^n\).

Value

These functions return an object of class aaa.

Author

Robin K. S. Hankin

Examples


linear1(sample(8))
#> free antiassociative algebra element:
#> +5a +2b +6c +7d +8e +1f +3g +4h
linear2(sample(8))
#> free antiassociative algebra element:
#> +8a.a +3b.b +1c.c +2d.d +7e.e +5f.f +4g.g +6h.h
linear3(sample(8))
#> free antiassociative algebra element:
#> +5(a.a)a +2(b.b)b +3(c.c)c +6(d.d)d +4(e.e)e +1(f.f)f +7(g.g)g +8(h.h)h

a <- 3
b <- 7
x <- sample(9)
y <- sample(9)

linear1(a*x + b*y) == a*linear1(x) + b*linear1(y)
#> [1] TRUE
linear2(a*x + b*y) == a*linear2(x) + b*linear2(y)
#> [1] TRUE
linear3(a*x + b*y) == a*linear3(x) + b*linear3(y)
#> [1] TRUE