Skip to main content
. 2021 Mar 12;21(6):2024. doi: 10.3390/s21062024
Algorithm4 Comparison of two values encoded in two input vectors
  • Input:

    Encoded VX as [x0,L,x0,G,x1,L,x1,G,,xD3,L,xD3,G], encoded VY as [y0,y1,,yD3],     vector size D

  • Ensure:

    D3

  • Output:

    1 if VXVY; 0 otherwise.

  • 1:

    ND2 {Number of vectors}

  • 2:

    n0

  • 3:

    whilen<Ndo {0n<N}

  • 4:

    rxn,L,yn

  • 5:

    if r=0 then

  • 6:

      return 1

  • 7:

    end if

  • 8:

    rxn,G,yn

  • 9:

    if r=0 then

  • 10:

      return 0

  • 11:

    end if

  • 12:

    nn+1

  • 13:

    end while

  • 14:

    return 1