Imported Upstream version 3.2.2
[debian/gnuradio] / gr-trellis / src / lib / fsm.i
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2002 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 class fsm {
24 private:
25   int d_I;
26   int d_S;
27   int d_O;
28   std::vector<int> d_NS;
29   std::vector<int> d_OS;
30   std::vector< std::vector<int> > d_PS;
31   std::vector< std::vector<int> > d_PI;
32   std::vector<int> d_TMi;
33   std::vector<int> d_TMl;
34   void generate_PS_PI ();
35   void generate_TM ();
36 public:
37   fsm();
38   fsm(const fsm &FSM);
39   fsm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS);
40   fsm(const char *name);
41   fsm(int k, int n, const std::vector<int> &G);
42   fsm(int mod_size, int ch_length);
43   fsm(int P, int M, int L);
44   fsm(const fsm &FSM1, const fsm &FSM2);
45   fsm(const fsm &FSM, int n);
46   int I () const { return d_I; }
47   int S () const { return d_S; }
48   int O () const { return d_O; }
49   const std::vector<int> & NS () const { return d_NS; }
50   const std::vector<int> & OS () const { return d_OS; }
51   // disable these accessors until we find out how to swig them
52   //const std::vector< std::vector<int> > & PS () const { return d_PS; }
53   //const std::vector< std::vector<int> > & PI () const { return d_PI; }
54   const std::vector<int> & TMi () const { return d_TMi; }
55   const std::vector<int> & TMl () const { return d_TMl; }
56   void fsm::write_trellis_svg(std::string filename ,int number_stages);
57   void fsm::write_fsm_txt(std::string filename);
58 };
59