COOPY » Guide  version 0.6.5
/home/paulfitz/cvs/coopy_scm/coopy/src/testing/test_viterbi.cpp
Go to the documentation of this file.
00001 #include <coopy/Viterbi.h>
00002 
00003 using namespace coopy::store;
00004 using namespace coopy::cmp;
00005 
00006 int main(int argc, char *argv[]) {
00007   Viterbi v;
00008   v.setSize(10,100);
00009   v.beginTransitions();
00010   v.addTransition(0,0,1);
00011   v.endTransitions();
00012   for (int i=0; i<20; i++) {
00013     v.beginTransitions();
00014     v.addTransition(0,1,1);
00015     v.addTransition(1,0,1);
00016     v.endTransitions();
00017   }
00018   int out = 0;
00019   for (int i=0; i<20; i++) {
00020     if (v(i)!=i%2) {
00021       out++;
00022     }
00023   }
00024   v.showPath();
00025   if (out!=0) {
00026     printf("Path is incorrect\n");
00027   }
00028   return (out==0)?0:1;
00029 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines