M4RI 1.0.1
grayflex.h
Go to the documentation of this file.
00001 
00012 #ifndef GRAYFLEX_H
00013 #define GRAYFLEX_H
00014 
00015 /******************************************************************************
00016 *
00017 *                 M4RI: Linear Algebra over GF(2)
00018 *
00019 *    Copyright (C) 2007 Gregory Bard <gregory.bard@ieee.org> 
00020 *    Copyright (C) 2007 Martin Albrecht <malb@informatik.uni-bremen.de> 
00021 *
00022 *  Distributed under the terms of the GNU General Public License (GPL)
00023 *  version 2 or higher.
00024 *
00025 *    This code is distributed in the hope that it will be useful,
00026 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00027 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00028 *    General Public License for more details.
00029 *
00030 *  The full text of the GPL is available at:
00031 *
00032 *                  http://www.gnu.org/licenses/
00033 ******************************************************************************/
00034  
00035 #include "misc.h"
00036 
00041 #define MAXKAY 16
00042 
00067 typedef struct {
00071   int *ord;
00075   int *inc;
00076 } code;
00077 
00084 extern code **codebook;
00085 
00086 
00094 int m4ri_swap_bits(int v,int l);
00095 
00105 int m4ri_gray_code(int i, int l);
00106 
00119 void m4ri_build_code(int *ord, int *inc, int l);
00120 
00130 void m4ri_build_all_codes(void);
00131 
00141 void m4ri_destroy_all_codes(void);
00142 
00158 int m4ri_opt_k(int a,int b,int c);
00159 
00160 #endif //GRAYFLEX_H