Skip to content

Commit

Permalink
perf(matrices): update involutory
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzhiZhang committed Aug 9, 2024
1 parent dbf809f commit 068fcb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/matrices/involutory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 068fcb8

Please sign in to comment.