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 00031 class fsm { 00032 private: 00033 int d_I; 00034 int d_S; 00035 int d_O; 00036 std::vector<int> d_NS; 00037 std::vector<int> d_OS; 00038 std::vector<int> d_PS; 00039 std::vector<int> d_PI; 00040 std::vector<int> d_TMi; 00041 std::vector<int> d_TMl; 00042 void generate_PS_PI (); 00043 void generate_TM (); 00044 bool find_es(int es); 00045 public: 00046 fsm(); 00047 fsm(const fsm &FSM); 00048 fsm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS); 00049 fsm(const char *name); 00050 fsm(int k, int n, const std::vector<int> &G); 00051 fsm(int mod_size, int ch_length); 00052 int I () const { return d_I; } 00053 int S () const { return d_S; } 00054 int O () const { return d_O; } 00055 const std::vector<int> & NS () const { return d_NS; } 00056 const std::vector<int> & OS () const { return d_OS; } 00057 const std::vector<int> & PS () const { return d_PS; } 00058 const std::vector<int> & PI () const { return d_PI; } 00059 const std::vector<int> & TMi () const { return d_TMi; } 00060 const std::vector<int> & TMl () const { return d_TMl; } 00061 }; 00062 00063 #endif