📄 read_cxml.c
字号:
/********************************************************************************* This file is part of the General Hidden Markov Model Library,* GHMM version 0.8_beta1, see http://ghmm.org** Filename: read_cxml.c* Authors: Wasinee Rungsarityotin, Benjamin Georgi** Copyright (C) 1998-2004 Alexander Schliep* Copyright (C) 1998-2001 ZAIK/ZPR, Universitaet zu Koeln* Copyright (C) 2002-2004 Max-Planck-Institut fuer Molekulare Genetik,* Berlin** Contact: schliep@ghmm.org** This library is free software; you can redistribute it and/or* modify it under the terms of the GNU Library General Public* License as published by the Free Software Foundation; either* version 2 of the License, or (at your option) any later version.** This library 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* Library General Public License for more details.** You should have received a copy of the GNU Library General Public* License along with this library; if not, write to the Free* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*** This file is version $Revision: 1451 $* from $Date: 2005-10-18 12:21:55 +0200 (Tue, 18 Oct 2005) $* last change by $Author: grunau $.********************************************************************************//* XXX FIXME: breaks out of tree build of ghmmwrapper */#include "../config.h"#include <stdio.h>#include <stdlib.h>#include <ghmm/rng.h>#include <ghmm/sequence.h>#include <ghmm/sdmodel.h>#include <ghmm++/GHMM_convertXMLtoC.h>#include "sdclass_change.h"/*int cp_class_change(int *seq, int len) { int sum = 0; int i; for(i=0;i<=len;i++){ sum += seq[i]; } //printf("sum = %d\n",sum); if (sum >= 6) { //printf("\n++++++++++++++++++++++++++++++++Switching class .... "); return 1; } else { return 0; } } void setSwitchingFunction( ghmm_dsmodel *smd ) { smd->get_class = cp_class_change;} *//*========================================================================*//* the actual pointer to C struct ghmm_dmodel */void mat_2d_print(double **mat, int rows, int cols) { int i,j; printf("double ** Rows = %d, Cols = %d\n", rows, cols); for(i=0; i < rows; i++) { printf("\t"); for(j=0; j < cols; j++) { printf("%g ", mat[i][j]); } printf("\n"); }}int __seq_d_class(const double *O, int index, double *osum) { return 0; }ghmm_dsmodel *graphmlTosdModel(char *filename){ model_t *mymodel; ghmm_dsmodel *cmodel; int nsilents=0; mymodel = graphmldoc_cwrapper(filename); if (mymodel != NULL) { if (mymodel->model_id == DISCRETE) { cmodel = (ghmm_dsmodel*)(mymodel->model_pt); /* the actual pointer to C struct ghmm_dmodel */ nsilents = ghmm_ds_init_silent_states (cmodel); fprintf(stderr, "In Main: # Silent States %d\n", nsilents); if ( cmodel->cos > 1 ) { fprintf(stderr, "Warning: I set the function pointer sdmodel->get_class\n"); /* cmodel->get_class = __seq_d_class; */ cmodel->get_class = cp_class_change; } else { /* cmodel->get_class = __seq_d_class; */ cmodel->get_class = cp_class_change; } fprintf(stderr, "In read_cxml.c\n"); ghmm_ds_topo_order (cmodel); free((void*) mymodel); return cmodel; } else { fprintf(stderr, "graphmlToModel: I need a DISCRETE model\n"); free((void*) mymodel); return NULL; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -