~ubuntu-branches/ubuntu/precise/gnuradio/precise

« back to all changes in this revision

Viewing changes to gr-trellis/src/lib/trellis_viterbi_i.cc

  • Committer: Bazaar Package Importer
  • Author(s): Kamal Mostafa
  • Date: 2010-03-13 07:46:01 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100313074601-zjsa893a87bozyh7
Tags: 3.2.2.dfsg-1ubuntu1
* Fix build for Ubuntu lucid (LP: #260406)
  - add binary package dep for libusrp0, libusrp2-0: adduser
  - debian/rules clean: remove pre-built Qt moc files

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 * Boston, MA 02110-1301, USA.
21
21
 */
22
22
 
 
23
// WARNING: this file is machine generated.  Edits will be over written
 
24
 
23
25
#ifdef HAVE_CONFIG_H
24
26
#include "config.h"
25
27
#endif
77
79
void viterbi_algorithm(int I, int S, int O, 
78
80
             const std::vector<int> &NS,
79
81
             const std::vector<int> &OS,
80
 
             const std::vector<int> &PS,
81
 
             const std::vector<int> &PI,
 
82
             const std::vector< std::vector<int> > &PS,
 
83
             const std::vector< std::vector<int> > &PI,
82
84
             int K,
83
85
             int S0,int SK,
84
86
             const float *in, int *out)//,
106
108
      for(int j=0;j<S;j++) { // for each next state do ACS
107
109
          minm=INF;
108
110
          minmi=0;
109
 
          for(int i=0;i<I;i++) {
110
 
              int i0 = j*I+i;
111
 
              if((mm=alpha[alphai*S+PS[i0]]+in[k*O+OS[PS[i0]*I+PI[i0]]])<minm)
 
111
          for(unsigned int i=0;i<PS[j].size();i++) {
 
112
              //int i0 = j*I+i;
 
113
              if((mm=alpha[alphai*S+PS[j][i]]+in[k*O+OS[PS[j][i]*I+PI[j][i]]])<minm)
112
114
                  minm=mm,minmi=i;
113
115
          }
114
116
          trace[k*S+j]=minmi;
132
134
  }
133
135
 
134
136
  for(int k=K-1;k>=0;k--) { // traceback
135
 
      int i0=st*I+trace[k*S+st];
136
 
      out[k]= (int) PI[i0];
137
 
      st=PS[i0];
 
137
      int i0=trace[k*S+st];
 
138
      out[k]= (int) PI[st][i0];
 
139
      st=PS[st][i0];
138
140
  }
139
141
 
140
142
}