summaryrefslogtreecommitdiff
path: root/gr-fec
diff options
context:
space:
mode:
authortracierenea <tracie.perez@mavs.uta.edu>2016-04-07 13:23:09 -0500
committertracierenea <tracie.perez@mavs.uta.edu>2016-04-07 13:23:09 -0500
commit01556fdd8473d1617144d79bb6dd99606326d223 (patch)
tree95da467f9fd77e76c6d538c6d1dedce5722a07f7 /gr-fec
parent48730536db3ebcfd8c7a4f1cc54ac8bd8a866140 (diff)
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.
Diffstat (limited to 'gr-fec')
-rw-r--r--gr-fec/lib/fec_mtrx_impl.cc13
1 files changed, 2 insertions, 11 deletions
diff --git a/gr-fec/lib/fec_mtrx_impl.cc b/gr-fec/lib/fec_mtrx_impl.cc
index 88027ff79e..d4b0ac07b5 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) {