Skip to content

Commit

Permalink
Update qhammingcode.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz authored Mar 3, 2024
1 parent 73b4c1d commit a1901f5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/ecc/codes/qhammingcode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ struct QHamming <:AbstractECC
r::Int
end

struct InvalidRError <: Exception end # Define a custom exception type

function parity_checks(c::QHamming)
if !(3 <= c.r < 15)
throw(InvalidRError()) # Throw the exception if r is out of bounds
if (3 <= c.r <= 15) || error("The r parameter in QHamming has to be between 3 and 15, in order to create a valid code of tractable size")
end
n = 2^c.r
k = 2^c.r - c.r - 2
Expand Down

0 comments on commit a1901f5

Please sign in to comment.