Skip to content

Commit

Permalink
Nice up debug printing
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Feb 14, 2024
1 parent a187c4b commit 54194dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/DeformationBases/ArcDiagDeformBasis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,21 @@ struct ArcDiagDeformBasis{C <: RingElem} <: DeformBasis{C}
extra_data = Dict{DeformationMap{C}, Set{ArcDiagram}}()
normalize = no_normalize ? identity : normalize_default

n_cases = div(length(base_modules(V_nice)) * (length(base_modules(V_nice)) + 1), 2)
lens = []
iters = []
debug_counter = 0
for d in degs
case = 0
for (i_l, V_nice_summand_i_l) in enumerate(base_modules(V_nice)),
(i_r, V_nice_summand_i_r) in enumerate(base_modules(V_nice))

if i_l > i_r
continue
end

case += 1
debug_counter = 0

proj_to_summand_l = compose(h, canonical_projection(V_nice, i_l))
proj_to_summand_r = compose(h, canonical_projection(V_nice, i_r))

Expand All @@ -65,7 +69,7 @@ struct ArcDiagDeformBasis{C <: RingElem} <: DeformBasis{C}
len = length(diag_iter)
iter = (
begin
@vprintln :PBWDeformations 2 "Basis generation deg $(lpad(d, maximum(ndigits, degs))), $(lpad(floor(Int, 100*(debug_counter = (debug_counter % len) + 1) / len), 3))%, $(lpad(debug_counter, ndigits(len)))/$(len)"
@vprintln :PBWDeformations 2 "Basis generation deg $(lpad(d, maximum(ndigits, degs))), case $(lpad(case, ndigits(n_cases)))/$(n_cases), $(lpad(floor(Int, 100*(debug_counter = (debug_counter % len) + 1) / len), 3))%, $(lpad(debug_counter, ndigits(len)))/$(len)"
_basis_elem = arcdiag_to_deformationmap(T, diag, sp, W)
basis_elem = matrix(proj_to_summand_l) * _basis_elem * transpose(matrix(proj_to_summand_r))
if i_l != i_r
Expand Down

0 comments on commit 54194dc

Please sign in to comment.