From 48d06162b36e233ee39d99907469231983d74060 Mon Sep 17 00:00:00 2001 From: Geoffroy Leconte Date: Wed, 3 Jan 2024 12:52:23 -0500 Subject: [PATCH] Adjoint opEye --- src/special-operators.jl | 4 ++++ test/test_linop.jl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/special-operators.jl b/src/special-operators.jl index 4f658d6a..c58e857a 100644 --- a/src/special-operators.jl +++ b/src/special-operators.jl @@ -25,6 +25,10 @@ struct opEye <: AbstractLinearOperator{Any} end *(T::AbstractLinearOperator, ::opEye) = T *(::opEye, T::opEye) = T +adjoint(A::opEye) = A +transpose(A::opEye) = A +conj(A::opEye) = A + function show(io::IO, op::opEye) println(io, "Identity operator") end diff --git a/test/test_linop.jl b/test/test_linop.jl index f65f1bcd..64b666c6 100644 --- a/test/test_linop.jl +++ b/test/test_linop.jl @@ -269,6 +269,10 @@ function test_linop() op2 = opEye() @test op === op2 @test op === op * op2 === op2 * op + + @test norm(transpose(op) * v - v) <= ϵ * norm(v) + @test norm(adjoint(op) * v - v) <= ϵ * norm(v) + @test norm(conj(op) * v - v) <= ϵ * norm(v) end @testset "Ones" begin