RMOL Logo Get Revenue Management Optimisation Library at SourceForge.net. Fast, secure and Free Open Source software downloads

interleaver.cpp

Go to the documentation of this file.
00001 #include <itpp/itcomm.h>
00002 
00003 using namespace itpp;
00004 
00005 //These lines are needed for use of cout and endl
00006 using std::cout;
00007 using std::endl;
00008 
00009 int main()
00010 {
00011   //Declare scalars and vectors:
00012   int rows, cols;
00013   ivec input, output, deinterleaved;
00014 
00015   //Declare the interleaver. The interleaver classes are templated, and therefore we must specify 
00016   //the type of the data elements. In this example we are using integers:
00017   Block_Interleaver<int> my_interleaver;
00018 
00019   //Initialize the interleaver class. Note that this can be done already in the declaration by writing
00020   //Block_Interleaver<int> my_interleaver(rows,cols);
00021   rows = 4;
00022   cols = 5;
00023   my_interleaver.set_rows(rows);
00024   my_interleaver.set_cols(cols);
00025 
00026   //Define the input to the interleaver:
00027   input = "1:20";
00028 
00029   //Do the interleaving:
00030   output = my_interleaver.interleave(input);
00031 
00032   //Do the de-interleaving:
00033   deinterleaved = my_interleaver.deinterleave(output);
00034 
00035   //Print the results:
00036   cout << "input = " << input << endl;
00037   cout << "output = " << output << endl;
00038   cout << "deinterleaved = " << deinterleaved << endl;
00039 
00040   //Exit program:
00041   return 0;
00042 
00043 }
SourceForge Logo

Generated on Tue Sep 7 2010 18:38:31 for RMOL by Doxygen 1.7.1