Takes the symmetric tensor part of a tensor x
with respect to the
specified indices ...
.
An error is thrown if the specified indices do not exist.
Arguments
- x
A labeled tensor object, created by %_%
or tensor()
.
- ...
Any number of index expressions. The indices need to occur
in x
.
Value
A modified tensor object.
Examples
a <- array(1:4, dim = c(2, 2))
a %_% .(i, j) |> sym(i, j)
#> <Labeled Array> [2x2] .(-i, -j)
#> [,1] [,2]
#> [1,] 1.0 2.5
#> [2,] 2.5 4.0