Hi,
I am working with KINTEX board for LDPC encoding and decoding.Through Vivado HLS, I need to transform a parity-check matrix H (that only consists of ones and zeros) from a non-standard to a standard form through C/C++ programming language. Here below you may find samples of non-standard parity check matrices in which Gauss-Jordan elimination (over GF(2)) can be applied.

Initially, i need C/C++ programming logic please help me if you do have any idea about LDPC. I would need a method that works out with matrices of any dimension.

this is, express it as

Hsys = [I| P]

This is my H matrix

H=[1 1 0 0 1 0;
1 0 0 1 0 1;
1 1 1 0 0 1 ];

Expected Systematic H matrix

Hsys=[1 0 0 1 0 1;
0 1 0 1 1 1;
0 0 1 0 1 1 ];

Code:
#include<stdio.h>
int main()
{
    // encoding
    int i,j;
    int message;
    int H_Matrix[3][6]={{1,1,0,0,1,0},{1,0,0,1,0,1},{1,1,1,0,0,1}};
    int temp[3][6]={0};
for(j=0;j<6;j++)
    {
        temp[1][j]=(H_Matrix[1][j]^H_Matrix[0][j]);
        H_Matrix[1][j] = temp[1][j];
        temp[2][j]=(H_Matrix[2][j]^H_Matrix[0][j]);
        H_Matrix[2][j] = temp[2][j];
        temp[0][j]=(H_Matrix[0][j]^H_Matrix[1][j]);
        H_Matrix[0][j] = temp[0][j];
    }
  
for(i=0;i<3;i++)
{
    for(j=0;j<6;j++)
    {
        printf("%d\t ",H_Matrix[i][j]);
    }
    printf("\n");
}
}
Logic
n=6 k=3 q=2
Start [0,0] = 1
Pivot [0,0] = 1
r_2 --> r_2 - r_1
r_3 --> r_3 - r_1
1 1 0 0 1 0
0 1 0 1 1 1
0 0 1 0 1 1
--
Start [1,1] = 1
Pivot [1,1] = 1
r_1 --> r_1 - r_2
1 0 0 1 0 1
0 1 0 1 1 1
0 0 1 0 1 1
--
Start [2,2] = 1
Pivot [2,2] = 1
1 0 0 1 0 1
0 1 0 1 1 1
0 0 1 0 1 1