Skip to content

Commit

Permalink
Nice up debug printing of ArcDiagBasis
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Feb 22, 2024
1 parent d54c869 commit fda3cb8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/DeformationBases/ArcDiagDeformBasis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,20 @@ 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

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 +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
Expand All @@ -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)
Expand Down

0 comments on commit fda3cb8

Please sign in to comment.