summaryrefslogtreecommitdiff
path: root/gr-trellis/src/lib/interleaver.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-trellis/src/lib/interleaver.cc')
-rw-r--r--gr-trellis/src/lib/interleaver.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/gr-trellis/src/lib/interleaver.cc b/gr-trellis/src/lib/interleaver.cc
index 131dcb07b..740f33ab3 100644
--- a/gr-trellis/src/lib/interleaver.cc
+++ b/gr-trellis/src/lib/interleaver.cc
@@ -20,7 +20,7 @@
* Boston, MA 02110-1301, USA.
*/
-#include <cstdlib>
+#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <string>
@@ -52,7 +52,7 @@ interleaver::interleaver(int K, const std::vector<int> &INTER)
d_K=K;
d_INTER=INTER;
d_DEINTER.resize(d_K);
-
+
// generate DEINTER table
for(int i=0;i<d_K;i++) {
d_DEINTER[d_INTER[i]]=i;
@@ -67,14 +67,14 @@ interleaver::interleaver(int K, const std::vector<int> &INTER)
//# list of space separated K integers from 0 to K-1 in appropriate order
//# optional comments
//######################################################################
-interleaver::interleaver(const char *name)
+interleaver::interleaver(const char *name)
{
FILE *interleaverfile;
- if((interleaverfile=fopen(name,"r"))==NULL)
+ if((interleaverfile=fopen(name,"r"))==NULL)
throw std::runtime_error ("file open error in interleaver()");
//printf("file open error in interleaver()\n");
-
+
if(fscanf(interleaverfile,"%d\n",&d_K) == EOF) {
if(ferror(interleaverfile) != 0)
throw std::runtime_error ("interleaver::interleaver(const char *name): file read error\n");
@@ -89,7 +89,7 @@ interleaver::interleaver(const char *name)
throw std::runtime_error ("interleaver::interleaver(const char *name): file read error\n");
}
}
-
+
// generate DEINTER table
for(int i=0;i<d_K;i++) {
d_DEINTER[d_INTER[i]]=i;
@@ -105,11 +105,11 @@ interleaver::interleaver(int K, int seed)
d_INTER.resize(d_K);
d_DEINTER.resize(d_K);
- if(seed>=0) srand((unsigned int)seed);
+ if(seed>=0) srand((unsigned int)seed);
std::vector<int> tmp(d_K);
for(int i=0;i<d_K;i++) {
d_INTER[i]=i;
- tmp[i] = rand();
+ tmp[i] = rand();
}
quicksort_index <int> (tmp,d_INTER,0,d_K-1);