From 37f727ac0746fd85504aa46c1f023c09b3eff33a Mon Sep 17 00:00:00 2001 From: hibby Date: Fri, 16 Feb 2018 15:17:14 +0000 Subject: New upstream version 1.8.0+repack --- lib/ldpc/mod2convert-test.c | 80 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 lib/ldpc/mod2convert-test.c (limited to 'lib/ldpc/mod2convert-test.c') diff --git a/lib/ldpc/mod2convert-test.c b/lib/ldpc/mod2convert-test.c new file mode 100755 index 00000000..eac257ff --- /dev/null +++ b/lib/ldpc/mod2convert-test.c @@ -0,0 +1,80 @@ +/* MOD2CONVERT-TEST. C - Program to test mod2convert module. */ + +/* Copyright (c) 1995-2012 by Radford M. Neal. + * + * Permission is granted for anyone to copy, use, modify, and distribute + * these programs and accompanying documents for any purpose, provided + * this copyright notice is retained and prominently displayed, and note + * is made of any changes made to these programs. These programs and + * documents are distributed without any warranty, express or implied. + * As the programs were written for research purposes only, they have not + * been tested to the degree that would be advisable in any important + * application. All use of these programs is entirely at the user's own + * risk. + */ + + +/* Correct output for this program is saved in the file mod2convert-test-out */ + + +#include +#include +#include + +#include "mod2dense.h" +#include "mod2sparse.h" +#include "mod2convert.h" +#include "rand.h" + +#define Rows 40 /* Dimensions of matrix to use in test */ +#define Cols 13 + +#define N 100 /* Number of bits to set in test matrix (some may be + duplicates, leading to fewer 1's in matrix */ + +main(void) +{ + mod2sparse *sm1, *sm2; + mod2dense *dm1, *dm2; + int i; + + sm1 = mod2sparse_allocate(Rows,Cols); + sm2 = mod2sparse_allocate(Rows,Cols); + + dm1 = mod2dense_allocate(Rows,Cols); + dm2 = mod2dense_allocate(Rows,Cols); + + printf("\nCreating sparse matrix.\n"); + fflush(stdout); + + for (i = 0; i