commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 12/17: gr-fec, LDPC: use mult_matrices_mod2


From: git
Subject: [Commit-gnuradio] [gnuradio] 12/17: gr-fec, LDPC: use mult_matrices_mod2 function
Date: Thu, 14 Apr 2016 20:43:05 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit 01556fdd8473d1617144d79bb6dd99606326d223
Author: tracierenea <address@hidden>
Date:   Thu Apr 7 13:23:09 2016 -0500

    gr-fec, LDPC: use mult_matrices_mod2 function
    
    Replace these lines using GSL to perform the matrix multiplication with a 
call to the mult_matrices_mod2 function, just to be concise.
---
 gr-fec/lib/fec_mtrx_impl.cc | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/gr-fec/lib/fec_mtrx_impl.cc b/gr-fec/lib/fec_mtrx_impl.cc
index 88027ff..d4b0ac0 100644
--- a/gr-fec/lib/fec_mtrx_impl.cc
+++ b/gr-fec/lib/fec_mtrx_impl.cc
@@ -465,22 +465,13 @@ namespace gr {
         // product of original_matrix and the inverse, which should
         // equal the identity matrix.
         gsl_matrix *test = gsl_matrix_alloc(n,n);
-        gsl_blas_dgemm (CblasNoTrans, CblasNoTrans, 1.0,
-                        original_matrix, matrix_inverse, 0.0, test);
-
-        // Have to take care of % 2 manually
-         for (row_index = 0; row_index < n; row_index++) {
-          for (col_index = 0; col_index < n; col_index++) {
-            int value = gsl_matrix_get(test, row_index, col_index);
-            int temp_value = value % 2;
-            gsl_matrix_set(test, row_index, col_index, temp_value);
-          }
-        }
+        mult_matrices_mod2(test, original_matrix, matrix_inverse);
 
         gsl_matrix *identity = gsl_matrix_alloc(n,n);
         gsl_matrix_set_identity(identity);
         //int test_if_equal = gsl_matrix_equal(identity,test);
         gsl_matrix_sub(identity, test); // should be null set if equal
+
         double test_if_not_equal = gsl_matrix_max(identity);
 
         if(test_if_not_equal > 0) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]