*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
*/
+// WARNING: this file is machine generated. Edits will be over written
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
void viterbi_algorithm(int I, int S, int O,
const std::vector<int> &NS,
const std::vector<int> &OS,
- const std::vector<int> &PS,
- const std::vector<int> &PI,
+ const std::vector< std::vector<int> > &PS,
+ const std::vector< std::vector<int> > &PI,
int K,
int S0,int SK,
const float *in, int *out)//,
for(int j=0;j<S;j++) { // for each next state do ACS
minm=INF;
minmi=0;
- for(int i=0;i<I;i++) {
- int i0 = j*I+i;
- if((mm=alpha[alphai*S+PS[i0]]+in[k*O+OS[PS[i0]*I+PI[i0]]])<minm)
+ for(unsigned int i=0;i<PS[j].size();i++) {
+ //int i0 = j*I+i;
+ if((mm=alpha[alphai*S+PS[j][i]]+in[k*O+OS[PS[j][i]*I+PI[j][i]]])<minm)
minm=mm,minmi=i;
}
trace[k*S+j]=minmi;
}
for(int k=K-1;k>=0;k--) { // traceback
- int i0=st*I+trace[k*S+st];
- out[k]= (int) PI[i0];
- st=PS[i0];
+ int i0=trace[k*S+st];
+ out[k]= (int) PI[st][i0];
+ st=PS[st][i0];
}
}