/*---------------------------------------------------------------------------* * IT++ * *---------------------------------------------------------------------------* * Copyright (c) 1995-2001 by Tony Ottosson, Thomas Eriksson, Pål Frenger, * * Tobias Ringström, and Jonas Samuelsson. * * * * Permission to use, copy, modify, and distribute this software and its * * documentation under the terms of the GNU General Public License is hereby * * granted. No representations are made about the suitability of this * * software for any purpose. It is provided "as is" without expressed or * * implied warranty. See the GNU General Public License for more details. * *---------------------------------------------------------------------------*/ /*! \file \brief Implementation of some specific functions useful in communications. \author Tony Ottosson 1.3 2003/05/22 08:55:20 */ #include "comm/commfunc.h" #include "base/specmat.h" #include "base/matfunc.h" #include "base/binary.h" namespace itpp { bmat graycode(int m) { if (m == 1) { smat temp = "0;1"; return to_bmat(temp); } else { bvec temp(1<<(m-1)); bmat bb = graycode(m-1); bmat out(1<