Tensor Inversion
Inversion of 2nd and 4th order tensors are supported.
Base.inv
— Functioninv(::AbstractSecondOrderTensor)
inv(::AbstractSymmetricSecondOrderTensor)
inv(::AbstractFourthOrderTensor)
inv(::AbstractSymmetricFourthOrderTensor)
Compute the inverse of a tensor.
Examples
julia> x = rand(SecondOrderTensor{3})
3×3 Tensor{Tuple{3, 3}, Float64, 2, 9}:
0.325977 0.894245 0.953125
0.549051 0.353112 0.795547
0.218587 0.394255 0.49425
julia> inv(x)
3×3 Tensor{Tuple{3, 3}, Float64, 2, 9}:
-587.685 -279.668 1583.46
-411.743 -199.494 1115.12
588.35 282.819 -1587.79
julia> x ⋅ inv(x) ≈ one(I)
true
Tensorial.adj
— Functionadj(::AbstractSecondOrderTensor)
adj(::AbstractSymmetricSecondOrderTensor)
Compute the adjugate matrix.
Examples
julia> x = rand(Mat{3,3});
julia> Tensorial.adj(x) / det(x) ≈ inv(x)
true