PocketSphinx  5prealpha
tmat.h
Go to the documentation of this file.
1 /* ====================================================================
2  * Copyright (c) 1999-2004 Carnegie Mellon University. All rights
3  * reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  *
17  * This work was supported in part by funding from the Defense Advanced
18  * Research Projects Agency and the National Science Foundation of the
19  * United States of America, and the CMU Sphinx Speech Consortium.
20  *
21  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
22  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
25  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * ====================================================================
34  *
35  */
36 
37 #ifndef _S3_TMAT_H_
38 #define _S3_TMAT_H_
39 
40 #include <stdio.h>
41 #include <sphinxbase/logmath.h>
42 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
55 typedef struct {
56  uint8 ***tp;
58  int16 n_tmat;
59  int16 n_state;
61 } tmat_t;
62 
63 
66 tmat_t *tmat_init (char const *tmatfile,
67  logmath_t *lmath,
68  float64 tpfloor,
69  int32 breport
70  );
71 
72 
73 
76 void tmat_dump (tmat_t *tmat,
77  FILE *fp
78  );
79 
80 
85 void tmat_free (tmat_t *t
86  );
87 
91 void tmat_report(tmat_t *t
92  );
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif
uint8 *** tp
The transition matrices; kept in the same scale as acoustic scores; tp[tmatid][from-state][to-state]...
Definition: tmat.h:56
int16 n_tmat
Number matrices.
Definition: tmat.h:58
void tmat_free(tmat_t *t)
RAH, add code to remove memory allocated by tmat_init.
Definition: tmat.c:275
tmat_t * tmat_init(char const *tmatfile, logmath_t *lmath, float64 tpfloor, int32 breport)
Initialize transition matrix.
Definition: tmat.c:134
int16 n_state
Number source states in matrix (only the emitting states); Number destination states = n_state+1...
Definition: tmat.h:59
void tmat_dump(tmat_t *tmat, FILE *fp)
Dumping the transition matrix for debugging.
Definition: tmat.c:72
Transition matrix data structure.
Definition: tmat.h:55
void tmat_report(tmat_t *t)
Report the detail of the transition matrix structure.
Definition: tmat.c:262