Skip to content

Commit

Permalink
Merge pull request #4 from JuliaImageRecon/Fix-adjoint-gradient-bug
Browse files Browse the repository at this point in the history
Circumvent a bug in LinearOperators
  • Loading branch information
tknopp authored Dec 8, 2023
2 parents 0f6ba62 + 15f59c3 commit 7d57dad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/GradientOp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ function GradientOpImpl(T::Type, shape::NTuple{N,Int64}, dim::Integer) where N
nrow = div( (shape[dim]-1)*prod(shape), shape[dim] )
ncol = prod(shape)
return LinearOperator{T}(nrow, ncol, false, false,
(res,x) -> (grad!(res,x,shape,dim) ),
(res,x) -> (grad_t!(res,x,shape,dim) ),
nothing )
(res,x) -> (grad!(res,x,shape,dim)),
(res,x) -> (grad_t!(res,x,shape,dim)),
(res,x) -> (grad_t!(res,x,shape,dim))
)
end

# directional gradients
Expand Down

0 comments on commit 7d57dad

Please sign in to comment.