Skip to content

Commit

Permalink
fix: range in rep_encode and rs_encode should be 0 to len(m)
Browse files Browse the repository at this point in the history
  • Loading branch information
wfnuser committed Dec 6, 2024
1 parent 2ae6265 commit 8dc579f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Basefold.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
"def rep_encode(m, k0, c):\n",
" assert len(m) % k0 == 0, \"len(m): %d is not a multiple of k0: %d\" % (len(m), k0)\n",
" code = []\n",
" for i in range(0, c*len(m), k0):\n",
" for i in range(0, len(m), k0):\n",
" for j in range(0, c):\n",
" code += m[i:i+k0]\n",
" return code"
Expand Down Expand Up @@ -314,7 +314,7 @@
" assert len(m) % k0 == 0, \"len(m): %d is not a multiple of k0: %d\" % (len(m), k0)\n",
" code = []\n",
" alpha = list(range(k0 * c)) # 这里默认 alpha = [0, 1, 2, ... , k0*c - 1]\n",
" for i in range(0, c*len(m), k0):\n",
" for i in range(0, len(m), k0):\n",
" code += rs_encode_single(m[i:i+k0], alpha, c)\n",
" return code"
]
Expand Down

0 comments on commit 8dc579f

Please sign in to comment.