Skip to content

Commit

Permalink
show for NNLSWorkspace
Browse files Browse the repository at this point in the history
  • Loading branch information
jondeuce committed Sep 4, 2024
1 parent 7755b9f commit 8e57340
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/DECAES.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ using NIfTI: NIfTI
using NLopt: NLopt
using ParXRec: ParXRec
using Parameters: Parameters, @with_kw, @with_kw_noshow
# using PolynomialRoots: PolynomialRoots
using PrecompileTools: PrecompileTools, @compile_workload, @setup_workload
using ProgressMeter: ProgressMeter, Progress, BarGlyphs
# using Roots: Roots
# using SLEEFPirates: SLEEFPirates
# using SIMD: SIMD, FloatingTypes, Vec, shufflevector
using Scratch: Scratch, @get_scratch!, get_scratch!
using SpecialFunctions: SpecialFunctions, erfc, erfinv
using StaticArrays: StaticArrays, MVector, SA, SArray, SMatrix, SVector
Expand Down
18 changes: 18 additions & 0 deletions src/NNLS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,24 @@ end
@inline choleskyfactor(work::NNLSWorkspace, ::Val{:U}) = @views UpperTriangular(work.A[1:ncomponents(work), 1:ncomponents(work)])
@inline choleskyfactor(work::NNLSWorkspace, ::Val{:L}) = choleskyfactor(work, Val(:U))'

function Base.show(io::IO, ::MIME"text/plain", work::NNLSWorkspace)
(; A, b, x, w, zz, idx, invidx, diag, rnorm, mode, nsetp) = work
m, n = size(A)
println(io, "NNLSWorkspace(m = $m, n = $n)")
println(io, " A :: $(typeof(A)) size $(size(A))")
println(io, " b :: $(typeof(b)) size $(size(b))")
println(io, " x :: $(typeof(x)) size $(size(x))")
println(io, " w :: $(typeof(w)) size $(size(w))")
println(io, " zz :: $(typeof(zz)) size $(size(zz))")
println(io, " idx :: $(typeof(idx)) size $(size(idx))")
println(io, " invidx :: $(typeof(invidx)) size $(size(invidx))")
println(io, " diag :: $(typeof(diag)) size $(size(diag))")
println(io, " rnorm[] :: $(typeof(rnorm[])) = $(rnorm[])")
println(io, " mode[] :: $(typeof(mode[])) = $(mode[])")
println(io, " nsetp[] :: $(typeof(nsetp[])) = $(nsetp[])")
return nothing
end

function NNLSWorkspace(A::AbstractMatrix{T}, b::AbstractVector{T}) where {T}
m, n = size(A)
@assert size(b) == (m,)
Expand Down

0 comments on commit 8e57340

Please sign in to comment.