Thread: reduced row-echelon form for Bigger Matrix Using C codes

  1. #1
    Registered User
    Join Date
    Mar 2017
    Posts
    52

    reduced row-echelon form for Bigger Matrix Using C codes

    Hi,

    My code is working for small matrix only. But actually i need codes to work for Bigger matrix

    For e.g.
    Code:
     msg[3] = {0,1,1};
    int H[3][6] = {1,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,0,1}; //WORKING
    H Matrix is: 
    
    1    1    0    0    1    0    
    1    0    0    1    0    1    
    1    1    1    0    0    1    
    
    H Matrix in systematic form is: 
    
    0    1    1    1    0    0    
    1    1    0    0    1    0    
    1    1    1    0    0    1    
    
    Generator Matrix  
    
    1    0    0    0    1    1    
    0    1    0    1    1    1    
    0    0    1    1    0    1    
    
    Code Word is: 
    
    0    1    1    0    1    0
    But for matrix H[48][98], its not working. Please anyone sort out the issues. It will be so grateful.

    Code:
    for matrix H[12][16] =   {0,0,1,0,0,0,0,1,0,1,0,0,1,0,0,0,
                          0,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,
                          0,1,0,0,1,0,1,0,0,1,0,0,0,0,0,0,
                          0,0,0,1,0,1,0,0,0,0,1,0,0,1,0,0,
                          0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,1,
                          1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,
                          0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,0,
                          0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,
                          1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,
                          0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,
                         0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,
                         1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0}; //NOT WORKING
    From H matrix i need to get Systematic matrix

    Systematic matrix, Hsys = [P/Identity]
    Generator Matrix =[Identity/PTranspose]
    Code:
      #include <stdio.h>
      #include <stdlib.h>
       int main()
      {
      //Assumptions, c >= n-k . And k = n/2  , ie half rate codes
    
       int i,j,sum=0,k,r2,j2,i2;
    
       int r,c,n;
       int temp=0;
      k = 3;
      r = 3;
      c = 6;
      n = 6;
      int msg[3] = {0,1,1};
      int H[3][6] = {1,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,0,1};
      printf("H Matrix is: \n\n");
      for(i=0;i<r;i++)
        {
           for(j=0;j<c;j++)
           printf("%d\t",H[i][j]);
           printf("\n");
       }
       for(i=0;i<n-k;i++)  
      {
         j=n-k+i;  
         if(H[i][j] != 1) 
            {
                for(i2=i+1;i2<r;i2++)
                {
                    if(H[i2][j] == 1) 
                    {
                        for(j2=0;j2<c;j2++)  
                        {
                            temp = H[i2][j2];
                            H[i2][j2] = H[i][j2];
                            H[i][j2] = temp;
                        }
                        break;
                    }
                    if(i2 == r-1)
                        printf("\nERROR..!! The whole of column %d has NO 1(at row %d)",j+1,i+1);
                }
            }
            for(i2 = 0;i2<r;i2++)  
            {
                if(i2 != i && H[i2][j] == 1) 
                    {
                        for(j2=0;j2<c;j2++)  
                        {
                            H[i2][j2] = abs(H[i][j2] - H[i2][j2]); 
                        }
                    }
            }
    }
           printf("\nH Matrix in different form is: \n\n");
          for(i=0;i<r;i++)
      {
            for(j=0;j<c;j++)
            printf("%d\t",H[i][j]);
            printf("\n");
      }
    
      printf("\n\nGenerator Matrix\n\n");
     int G[10][10] = {0};
      for (i=0;i<k;i++)
       for(j=0;j<k;j++)
            if(i == j)
            G[i][j] = 1;
    
         for(i=0;i<r;i++)
         for(j=0;j<k;j++)
            G[j][k+i] = H[i][j];
    
        for(i=0;i<r;i++)
       {
            for(j=0;j<c;j++)
            printf("%d\t",G[i][j]);
          printf("\n");
      }
    
      //Code word generation
       int C[10];
        int s = 0;
       for(j=0;j<n;j++)
        {
        for(i=0;i<k;i++)
        {
            s = s+msg[i]*G[i][j];
        }
        C[j] = s%2;
        s = 0;
       }
         printf("\n\nCode Word is: \n\n");
        for(i=0;i<n;i++)
        printf("%d\t",C[i]);
      }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,525
    Well you could try
    - learning how to indent code properly; you attract more bees with sugar than you do with vinegar.
    - posting the actual code which is broken like say

    This 3x3 works.
    Code:
    // code
    This NxM doesn't work.
    Code:
    // code
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Mar 2017
    Posts
    52
    Sorry, i have tried to indent code properly but its coming properly.

  4. #4
    Registered User
    Join Date
    Jun 2015
    Posts
    1,643
    Let me get this straight. You're asking us to stare at an insanely-indented piece of undocumented, unfactored code with terrible variable names and guess what you did wrong in moving from the small matrix to the large matrix?

    Pass.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,525
    My hair is still wet from the shower, what should I do?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Mar 2017
    Posts
    52
    LDPC Encoding Concept:

    I have a Parity check matrix H of size 48x96. H_Matrxi.txt. Let k=48 and N=96, M=48

    From the H matrix, i need to generate a Generator Matrix =[Identity/P]. where Identity size is k and P size is kxM, and need to generate a codeword length is 48. Refer Page :16 []SPM: 404 Page Not Found

    The above is working for only a small size matrix. It is not working for a size 48x96. So i seek help from a genius coding person.

  7. #7
    Registered User
    Join Date
    Jun 2015
    Posts
    1,643
    You've increased our workload by asking us to read an 83 page article first? And the horrible (and apparently irrelevant) code stands as is, right?

    Still pass.

    In order for someone to help you, you need to post the actual code you are having trouble with, indent it properly, and tell us exactly what is happening that causes you to think it isn't working.

    BTW, I doubt a "genius" is required. If so, you're out of luck.


    EDIT:
    If the input file you link to (H_Matrxi.txt) is the actual text file that you are trying to read into your program as a 48x96 matrix (48 rows, 96 columns), then that's a little tricky (especially if you're not allowed to hardcode the fact that it's 48x96, which would seem like cheating anyway). It's split into 6 48x15 chunks and a final 48x6 chunk, with a few interspersed lines that need to be ignored.

    But you seemed to suggest that if you hardcoded the following matrix, it also wouldn't "work".
    Code:
    int matrix H[12][16] ={0,0,1,0,0,0,0,1,0,1,0,0,1,0,0,0,
                           0,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,
                           0,1,0,0,1,0,1,0,0,1,0,0,0,0,0,0,
                           0,0,0,1,0,1,0,0,0,0,1,0,0,1,0,0,
                           0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,1,
                           1,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,
                           0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,0,
                           0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,
                           1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,
                           0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,
                           0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,
                           1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0};
    One possibility is that it isn't working at all. Have you tried a different 3x6 matrix?
    Last edited by algorism; 08-09-2017 at 10:26 AM.

  8. #8
    Registered User
    Join Date
    Mar 2017
    Posts
    52
    Sorry for uncertainty. Now i will explain you properly

    I have tried Matrix[3][6], ya it`s working fine.

    Now my requirement to move into Bigger matrix [48][96]. My code is not working for Bigger matrix.

    Matrix[3][6].. Output Consolereduced row-echelon form for Bigger Matrix Using C codes-tera-png

    Actual Source Code
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    int main()
    {
    
    int i,j,sum=0,k,r2,j2,i2;
    
    int r,c,n;
    int temp=0;
    
    k = 3;
    r = 3;
    c = 6;
    n = 6;
    int msg[3] = {0,1,1};
    int H[3][6] = {1,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,0,1};
    
    
    printf("H Matrix is: \n\n");
    for(i=0;i<r;i++)
    {
        for(j=0;j<c;j++)
            printf("%d\t",H[i][j]);
        printf("\n");
    }
    
    for(i=0;i<n-k;i++)  
    {
        j=n-k+i;  
            if(H[i][j] != 1) 
            {
                for(i2=i+1;i2<r;i2++)
                {
                    if(H[i2][j] == 1) 
                    {
                        for(j2=0;j2<c;j2++)  
                        {
                            temp = H[i2][j2];
                            H[i2][j2] = H[i][j2];
                            H[i][j2] = temp;
                        }
                        break;
                    }
                    if(i2 == r-1)
                        printf("\nERROR..!! The whole of column %d has NO 1(at row %d)",j+1,i+1);
                }
            }
            for(i2 = 0;i2<r;i2++)  
            {
                if(i2 != i && H[i2][j] == 1) 
                    {
                        for(j2=0;j2<c;j2++)  
                        {
                            H[i2][j2] = abs(H[i][j2] - H[i2][j2]); 
                        }
                    }
            }
    }
    printf("\nH Matrix in different form is: \n\n");
    for(i=0;i<r;i++)
    {
        for(j=0;j<c;j++)
            printf("%d\t",H[i][j]);
        printf("\n");
    }
    
    printf("\n\nGenerator Matrix\n\n");
    
    int G[10][10] = {0};
    for (i=0;i<k;i++)
        for(j=0;j<k;j++)
            if(i == j)
            G[i][j] = 1;
    
    for(i=0;i<r;i++)
        for(j=0;j<k;j++)
            G[j][k+i] = H[i][j];
    
    for(i=0;i<r;i++)
    {
        for(j=0;j<c;j++)
            printf("%d\t",G[i][j]);
        printf("\n");
    }
    
    int C[10];
    int s = 0;
    for(j=0;j<n;j++)
    {
        for(i=0;i<k;i++)
        {
            s = s+msg[i]*G[i][j];
        }
        C[j] = s%2;
        s = 0;
    }
    printf("\n\nCode Word is: \n\n");
    for(i=0;i<n;i++)
        printf("%d\t",C[i]);
    }
    Bigger matrix [48][96] Input
    Code:
    {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,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0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0
    0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0
    0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0}

  9. #9
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,525
    So which 3's 6's and other hard coded magic numbers do we have to change to support 48x96? You don't even tell us what the right answer should be!?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  10. #10
    Registered User
    Join Date
    Mar 2017
    Posts
    52
    Hi,

    The above H matrix is input matrix [48][96].. N=98, M=k=48

    I need to get OUTPUT
    1. Systematic matrix, Hsys = [A/I] from H matrix, where A is binary matrix of size KxM, and I is Identity of size N-K

    2. GENERATOR MATRIX, Generator Matrix =[I/A Transpose] from Systematic matrix , where A is Transpose and I is Identity.

  11. #11
    Registered User
    Join Date
    Jun 2015
    Posts
    1,643
    If this entity is not actually a troll, then it may as well be. I see no practical difference.

    Alternatively, it could be interpreted as a comedy routine. I hear the circus theme behind it, or maybe Benny Hill.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reduced Echelon form program
    By Heartprogrammer in forum C Programming
    Replies: 3
    Last Post: 11-20-2012, 10:40 AM
  2. Finding a sub-matrix in a bigger matrix
    By pashakhanloo in forum C++ Programming
    Replies: 1
    Last Post: 10-31-2012, 10:42 AM
  3. Replies: 1
    Last Post: 07-30-2008, 10:45 AM
  4. how to get a reduced form
    By silent_eyes in forum C++ Programming
    Replies: 3
    Last Post: 02-25-2005, 10:15 PM
  5. Row-echelon form of a matrix
    By Leeman_s in forum C++ Programming
    Replies: 7
    Last Post: 05-17-2003, 09:01 PM

Tags for this Thread