GNU Radio 3.4.2 C++ API
fsm.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2002 Free Software Foundation, Inc.
00004  *
00005  * This file is part of GNU Radio
00006  *
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  *
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef INCLUDED_TRELLIS_FSM_H
00024 #define INCLUDED_TRELLIS_FSM_H
00025 
00026 #include <vector>
00027 #include <iosfwd>
00028 
00029 /*!
00030  * \brief  FSM class
00031  */
00032 class fsm {
00033 private:
00034   int d_I;
00035   int d_S;
00036   int d_O;
00037   std::vector<int> d_NS;
00038   std::vector<int> d_OS;
00039   std::vector< std::vector<int> > d_PS;
00040   std::vector< std::vector<int> > d_PI;
00041   std::vector<int> d_TMi;
00042   std::vector<int> d_TMl;
00043   void generate_PS_PI ();
00044   void generate_TM ();
00045   bool find_es(int es);
00046 public:
00047   fsm();
00048   fsm(const fsm &FSM);
00049   fsm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS);
00050   fsm(const char *name);
00051   fsm(int k, int n, const std::vector<int> &G);
00052   fsm(int mod_size, int ch_length);
00053   fsm(int P, int M, int L);
00054   fsm(const fsm &FSM1, const fsm &FSM2);
00055   fsm(const fsm &FSM, int n);
00056   int I () const { return d_I; }
00057   int S () const { return d_S; }
00058   int O () const { return d_O; }
00059   const std::vector<int> & NS () const { return d_NS; }
00060   const std::vector<int> & OS () const { return d_OS; }
00061   const std::vector< std::vector<int> > & PS () const { return d_PS; }
00062   const std::vector< std::vector<int> > & PI () const { return d_PI; }
00063   const std::vector<int> & TMi () const { return d_TMi; }
00064   const std::vector<int> & TMl () const { return d_TMl; }
00065   void write_trellis_svg(std::string filename ,int number_stages);
00066   void write_fsm_txt(std::string filename);
00067 };
00068 
00069 #endif