Logo Search packages:      
Sourcecode: apertium version File versions  Download package

void HMM::write_probabilities ( ostream &  os  ) 

It writes the probabilities (matrices a and b) to the stream received as a parameter

Parameters:
os the output stream

Definition at line 216 of file HMM.C.

                                    {
  int i, j, k;
  
  //Matrix A  
  for(i=0;i<N; i++)
    for(j=0; j<N; j++)
      EndianUtil<double>::write(os, a[i][j]);

  //Matrix B  (not the full matrix, only useful values)
  for(i=0; i<N; i++) {
    for(k=0; k<M; k++) {
      if(output[k].find(i)!=output[k].end()) {
        EndianUtil<int>::write(os, i);
        EndianUtil<int>::write(os, k);
        EndianUtil<double>::write(os, b[i][k]);
      }
    }
  }  
}  


Generated by  Doxygen 1.6.0   Back to index