From 52314a530d7090bb8b92903675d32e06d7dfb66f Mon Sep 17 00:00:00 2001 From: maximvassiliev Date: Tue, 13 Aug 2024 23:58:06 +0100 Subject: [PATCH] overload for OneElement matrices --- src/FillArrays.jl | 2 +- src/oneelement.jl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/FillArrays.jl b/src/FillArrays.jl index 4671053a..c38b9618 100644 --- a/src/FillArrays.jl +++ b/src/FillArrays.jl @@ -7,7 +7,7 @@ import Base: size, getindex, setindex!, IndexStyle, checkbounds, convert, any, all, axes, isone, iszero, iterate, unique, allunique, permutedims, inv, copy, vec, setindex!, count, ==, reshape, map, zero, show, view, in, mapreduce, one, reverse, promote_op, promote_rule, repeat, - parent, similar, issorted, add_sum, accumulate, OneTo + parent, similar, issorted, add_sum, accumulate, OneTo, permutedims import LinearAlgebra: rank, svdvals!, tril, triu, tril!, triu!, diag, transpose, adjoint, fill!, dot, norm2, norm1, normInf, normMinusInf, normp, lmul!, rmul!, diagzero, AdjointAbsVec, TransposeAbsVec, diff --git a/src/oneelement.jl b/src/oneelement.jl index ce13da86..5316d827 100644 --- a/src/oneelement.jl +++ b/src/oneelement.jl @@ -426,6 +426,10 @@ function Base.reshape(A::OneElement, shape::Tuple{Vararg{Int}}) OneElement(A.val, Tuple(newcartind), shape) end +#permute + +permutedims(o::OneElementMatrix) = OneElement(o.val, reverse(o.ind), o.axes) + # show _maybesize(t::Tuple{Base.OneTo{Int}, Vararg{Base.OneTo{Int}}}) = size.(t,1) _maybesize(t) = t