Skip to content

Commit

Permalink
Added L2*Array
Browse files Browse the repository at this point in the history
  • Loading branch information
albop committed Jan 28, 2025
1 parent d118cbd commit d2c9806
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/dev_L2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ end
function *(L::LL, x0)

# BUG: with deepcopy, doesn' t work
# TODO: why do we even copy here?
r = duplicate(x0) ###### BUG: this doesn't wokr on the GPU
Tf = getprecision(x0)
r.data .*= convert(Tf, 0.0)
Expand All @@ -102,7 +103,17 @@ function *(L::LL, x0)

end

function *(L::LL, v::AbstractArray{T}) where T<:Union{Float32, Float64}

# BUG: with deepcopy, doesn' t work
r_ = copy(v) ###### BUG: this doesn't wokr on the GPU
r_[:] .*= convert(T, 0.0)
r = unravel(L.grid, r_)
x = unravel(L.grid, v)
mul!(r, L, x)
r

end


function ldiv!(J, L::Dolo.LL)
Expand Down

0 comments on commit d2c9806

Please sign in to comment.