From 068fcb8c8b0d2cf56323a1a235a1f3ed9e49097e Mon Sep 17 00:00:00 2001 From: Andy Zhang <37402126+AnzhiZhang@users.noreply.github.com> Date: Fri, 9 Aug 2024 17:58:27 +0100 Subject: [PATCH] perf(matrices): update involutory --- src/matrices/involutory.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/matrices/involutory.jl b/src/matrices/involutory.jl index 94dd8dd..0abad47 100644 --- a/src/matrices/involutory.jl +++ b/src/matrices/involutory.jl @@ -13,10 +13,11 @@ An involutory matrix is a matrix that is its own inverse. """ struct Involutory{T<:Number} <: AbstractMatrix{T} n::Integer + M::AbstractMatrix{T} function Involutory{T}(n::Integer) where {T<:Number} n >= 0 || throw(ArgumentError("$n < 0")) - return new{T}(n) + return new{T}(n, Hilbert{T}(n)) end end @@ -36,7 +37,7 @@ size(A::Involutory) = (A.n, A.n) # size and hilbert element n = T(A.n) - element = Hilbert{T}(A.n)[i, j] + element = A.M[i, j] # compute element d = -n