| #### D.10.2.5 encode Procedure from library `decodegb.lib` (see decodegb_lib). Usage: encode (x, g); x a row vector (message), and g a generator matrix Return: corresponding codeword Example:
    LIB "decodegb.lib";
    ring r=2,x,dp;
    matrix x[1][4]=1,0,1,0;
    matrix g[4][7]=1,0,0,0,0,1,1,
    0,1,0,0,1,0,1,
    0,0,1,0,1,1,1,
    0,0,0,1,1,1,0;
    //encode x with the generator matrix g
    print(encode(x,g));
    ==> 1,0,1,0,1,0,0

User manual for Singular version 4.4.1, 2025, generated by texi2html.