From fda3cb8e14e8d93a0ff716a72df5aef10d9c2c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Wed, 14 Feb 2024 11:57:38 +0100 Subject: [PATCH] Nice up debug printing of ArcDiagBasis --- src/DeformationBases/ArcDiagDeformBasis.jl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/DeformationBases/ArcDiagDeformBasis.jl b/src/DeformationBases/ArcDiagDeformBasis.jl index c4863bd..2d37b91 100644 --- a/src/DeformationBases/ArcDiagDeformBasis.jl +++ b/src/DeformationBases/ArcDiagDeformBasis.jl @@ -41,10 +41,11 @@ 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)) @@ -52,6 +53,8 @@ struct ArcDiagDeformBasis{C <: RingElem} <: DeformBasis{C} continue end + case += 1 + proj_to_summand_l = compose(h, canonical_projection(V_nice, i_l)) proj_to_summand_r = compose(h, canonical_projection(V_nice, i_r)) @@ -65,7 +68,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*counter / len), 3))%, $(lpad(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 @@ -82,8 +85,8 @@ struct ArcDiagDeformBasis{C <: RingElem} <: DeformBasis{C} extra_data[basis_elem] = Set([diag]) end basis_elem - end for - diag in diag_iter if is_crossing_free(diag, part=:upper) && is_crossing_free(diag, part=:lower) + end for (counter, diag) in enumerate(diag_iter) if + is_crossing_free(diag, part=:upper) && is_crossing_free(diag, part=:lower) ) # push!(lens, len) # push!(iters, iter)