|
Algorithm 2: Encoding a value with subroutine Y
|
-
Input:
Value to be encoded , vector size D
-
Ensure:
and
-
Output:
Array of vectors
-
1:
{Number of vectors}
-
2:
{Highest power of 2}
-
3:
{Current vector}
-
4:
whiledo {}
-
5:
if
then
-
6:
{Call Algorithm 1 as a subroutine}
-
7:
-
8:
-
9:
else if
then
-
10:
-
11:
-
12:
else
-
13:
-
14:
end if
-
15:
end while
-
16:
return
|