mirror of
https://github.com/tgorordo/WignerSymbols.jl.git
synced 2026-06-05 15:42:15 -07:00
remove extraneous commented binomial implementation
This commit is contained in:
parent
85c7cd2026
commit
8e3d78114e
1 changed files with 0 additions and 20 deletions
|
|
@ -385,26 +385,6 @@ function sumlist!(list::Vector{<:PrimeFactorization}, ind = 1:length(list))
|
||||||
return MPZ.mul!(s, _convert!(i, g))
|
return MPZ.mul!(s, _convert!(i, g))
|
||||||
end
|
end
|
||||||
|
|
||||||
#=
|
|
||||||
# A cached binomial implementation.
|
|
||||||
bcache = LRU{Tuple{BigInt, BigInt}, PrimeFactorization}(; maxsize=10^6)
|
|
||||||
function primebinomial(n::BigInt, k::BigInt)
|
|
||||||
T = PrimeFactorization{eltype(eltype(factorialtable))}
|
|
||||||
if k == 0
|
|
||||||
return one(T)
|
|
||||||
end # guard
|
|
||||||
if haskey(bcache, (n, k))
|
|
||||||
return bcache[(n, k)]
|
|
||||||
else
|
|
||||||
den = primefactor(k)
|
|
||||||
num = mul!(copy(primefactor(n + 1 - k)), primebinomial(n, k - 1))
|
|
||||||
res = divexact!(num, den)
|
|
||||||
bcache[(n, k)] = res
|
|
||||||
return res
|
|
||||||
end
|
|
||||||
end
|
|
||||||
=#
|
|
||||||
|
|
||||||
function primebinomial(n::BigInt, k::BigInt)
|
function primebinomial(n::BigInt, k::BigInt)
|
||||||
num = copy(primefactorial(n))
|
num = copy(primefactorial(n))
|
||||||
divexact!(num, primefactorial(k))
|
divexact!(num, primefactorial(k))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue