tmat.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 1999-2004 Carnegie Mellon University. All rights
4  * reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * This work was supported in part by funding from the Defense Advanced
19  * Research Projects Agency and the National Science Foundation of the
20  * United States of America, and the CMU Sphinx Speech Consortium.
21  *
22  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
23  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
26  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  * ====================================================================
35  *
36  */
37 /*
38  * tmat.h
39  *
40  * **********************************************
41  * CMU ARPA Speech Project
42  *
43  * Copyright (c) 1997 Carnegie Mellon University.
44  * ALL RIGHTS RESERVED.
45  * **********************************************
46  *
47  * HISTORY
48  * $Log$
49  * Revision 1.1 2006/04/05 20:27:30 dhdfu
50  * A Great Reorganzation of header files and executables
51  *
52  * Revision 1.10 2006/02/22 17:46:26 arthchan2003
53  * Merged from SPHINX3_5_2_RCI_IRII_BRANCH:
54  * 1, Used new log function in logs3
55  * 2, Fixed dox-doc.
56  *
57  * Revision 1.9.4.1 2005/07/05 05:47:59 arthchan2003
58  * Fixed dox-doc. struct level of documentation are included.
59  *
60  * Revision 1.9 2005/06/21 19:23:35 arthchan2003
61  * 1, Fixed doxygen documentation. 2, Added $ keyword.
62  *
63  * Revision 1.6 2005/06/13 04:02:56 archan
64  * Fixed most doxygen-style documentation under libs3decoder.
65  *
66  * Revision 1.5 2005/05/03 04:09:09 archan
67  * Implemented the heart of word copy search. For every ci-phone, every word end, a tree will be allocated to preserve its pathscore. This is different from 3.5 or below, only the best score for a particular ci-phone, regardless of the word-ends will be preserved at every frame. The graph propagation will not collect unused word tree at this point. srch_WST_propagate_wd_lv2 is also as the most stupid in the century. But well, after all, everything needs a start. I will then really get the results from the search and see how it looks.
68  *
69  * Revision 1.4 2005/04/21 23:50:26 archan
70  * Some more refactoring on the how reporting of structures inside kbcore_t is done, it is now 50% nice. Also added class-based LM test case into test-decode.sh.in. At this moment, everything in search mode 5 is already done. It is time to test the idea whether the search can really be used.
71  *
72  * Revision 1.3 2005/03/30 01:22:47 archan
73  * Fixed mistakes in last updates. Add
74  *
75  *
76  * 20.Apr.2001 RAH (rhoughton@mediasite.com, ricky.houghton@cs.cmu.edu)
77  * Added tmat_free to free allocated memory
78  *
79  * 29-Feb-2000 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University.
80  * Added tmat_chk_1skip(), and made tmat_chk_uppertri() public.
81  *
82  * 10-Dec-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University.
83  * Added tmat_dump().
84  *
85  * 11-Mar-97 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University.
86  * Started based on original S3 implementation.
87  */
88 
89 
90 #ifndef _S3_TMAT_H_
91 #define _S3_TMAT_H_
92 
93 #include <stdio.h>
94 
95 #include <s3types.h>
96 #include <logmath.h>
97 
101 #ifdef __cplusplus
102 extern "C" {
103 #endif
104 #if 0
105 } /* Fool Emacs into not indenting things. */
106 #endif
107 
113 typedef struct {
114  logmath_t *logmath;
115  int32 ***tp;
117  int32 n_tmat;
118  int32 n_state;
120 } tmat_t;
121 
122 
125 tmat_t *tmat_init (const char *tmatfile,
126  float64 tpfloor,
127  int32 breport,
128  logmath_t *logmath
129  );
130 
131 
132 
135 void tmat_dump (tmat_t *tmat,
136  FILE *fp
137  );
138 
139 
144 int32 tmat_chk_uppertri (tmat_t *tmat
145  );
146 
147 
154 int32 tmat_chk_1skip (tmat_t *tmat
155  );
156 
161 void tmat_free (tmat_t *t
162  );
163 
167 void tmat_report(tmat_t *t
168  );
169 
170 #if 0
171 { /* Stop indent from complaining */
172 #endif
173 #ifdef __cplusplus
174 }
175 #endif
176 
177 #endif
int32 n_tmat
Definition: tmat.h:117
int32 tmat_chk_uppertri(tmat_t *tmat)
int32 tmat_chk_1skip(tmat_t *tmat)
void tmat_free(tmat_t *t)
Size definition of semantically units. Common for both s3 and s3.X decoder.
logmath_t * logmath
Definition: tmat.h:114
void tmat_dump(tmat_t *tmat, FILE *fp)
Transition matrix data structure. All phone HMMs are assumed to have the same topology.
Definition: tmat.h:113
void tmat_report(tmat_t *t)
tmat_t * tmat_init(const char *tmatfile, float64 tpfloor, int32 breport, logmath_t *logmath)
int32 n_state
Definition: tmat.h:118
int32 *** tp
Definition: tmat.h:115