📄 ghmm_gmlemission.cpp
字号:
/* * created: 21 Feb 2002 by Peter Pipenbacher * authors: Peter Pipenbacher (pipenb@zpr.uni-koeln.de) * file : $Source: /cvsroot/ghmm/ghmm/ghmm++/GHMM_GMLEmission.cpp,v $ * $Id: GHMM_GMLEmission.cpp,v 1.2 2003/09/18 10:04:49 cic99 Exp $ * * Copyright (C) 1998-2001, ZAIK/ZPR, Universit鋞 zu K鰈n * * This program 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 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */#include <xmlio/XMLIO_Document.h>#include "ghmm++/GHMM_Emission.h"#include "ghmm++/GHMM_Alphabet.h"#include "ghmm++/GHMM_ContinuousModel.h"#include "ghmm++/GHMM_DiscreteModelT.hh"#ifdef HAVE_NAMESPACESusing namespace std;#endifGHMM_GMLEmission::~GHMM_GMLEmission() {}const int GHMM_GMLEmission::XMLIO_writeContent(XMLIO_Document& writer) { int result = 0; int i; writer.changeIndent(2); /* continuous model */ /******* if (state->c_sstate) { result = writer.writef("1 <"); switch (density) { case normal: result += writer.write("gauss"); break; case normal_pos: result += writer.write("gauss-positive"); break; case normal_approx: result += writer.write("gauss-approximated"); break; default: break; } result += writer.writef(" mue=\"%f\" variance=\"%f\">",mue[0],variance[0]); } else **********/ { /* discrete model */ GHMM_Alphabet* alphabet = state->getModel()->getAlphabet(); GHMM_DiscreteModelT*model = (GHMM_DiscreteModelT*)(state->getModel()); result += writer.writeEndl(); for (i = 0; i < model->c_model->M; ++i) { result += writer.writef("%s%.2f",writer.indent,state->getEmissionFrom(i)); // c_state->b[i] if (alphabet) result += writer.writef(" <!-- %s -->",alphabet->getSymbol(i).c_str()); result += writer.writeEndl(); } } return result;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -