The function Ops.freealg()
passes binary arithmetic operators
(“+
”, “-
”, “*
”,
“^
”, and “==
”) to the appropriate
specialist function.
The caret, as in a^n
, denotes arithmetic exponentiation, as in
x^3==x*x*x
. As an experimental feature, this is (sort of)
vectorised: if n
is a vector, then a^n
returns the sum
of a
raised to the power of each element of n
. For example,
a^c(n1,n2,n3)
is a^n1 + a^n2 + a^n3
. Internally,
n
is tabulated in the interests of efficiency, so
a^c(0,2,5,5,5,) = 1 + a^2 + 3a^5
is evaluated with only a
single fifth power. Similar functionality is implemented in the
mvp package.
The only comparison operators are equality and inequality; x==y
is defined as is.zero(x-y)
.
Functions lowlevel_foo()
are low-level functions that interface
directly with the C
routines in the src/
directory and
are not intended for the end-user.
Function inv()
is defined only for freealg objects with a
single term. If x
has a single term we have
inv(x)*x=x*inv(x)=1
. There is no corresponding division in the
package because a/b
may be either a*inv(b)
or
inv(b)*a
.