stat.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  * stat.h -- statistics of the searching process, including timers and counters.
39  *
40  * **********************************************
41  * CMU ARPA Speech Project
42  *
43  * Copyright (c) 1999 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.2 2006/02/22 20:01:06 arthchan2003
53  * Merged from branch SPHINX3_5_2_RCI_IRII_BRANCH: 1, Take care of the situation when the hmm_eval =0 (but ugly). 2, Add a free function for stat_t.
54  *
55  * Revision 1.1.4.2 2005/07/05 06:25:40 arthchan2003
56  * Fixed dox-doc.
57  *
58  * Revision 1.1.4.1 2005/07/03 22:56:51 arthchan2003
59  * Add stat_free.
60  *
61  * Revision 1.1 2005/06/21 20:58:09 arthchan2003
62  * Add a statistics inventory structure, it takes care of 1, counters, 2, timers. Interfaces are provided to allow convenient clearing and updating of structures
63  *
64  * Revision 1.6 2005/04/25 19:22:47 archan
65  * Refactor out the code of rescoring from lexical tree. Potentially we want to turn off the rescoring if we need.
66  *
67  * Revision 1.5 2005/04/20 03:44:10 archan
68  * Create functions for clear/update/report statistics. It wraps up code which was slightly spaghatti-like in the past
69  *
70  * Revision 1.4 2005/03/30 01:22:47 archan
71  * Fixed mistakes in last updates. Add
72  *
73  *
74  * 24-Mar-2004 Arthur Chan (archan@cs.cmu.edu) at Carnegie Mellon University
75  * start
76  */
77 
78 
79 #ifndef _S3_STAT_
80 #define _S3_STAT_
81 
82 #include <profile.h>
83 #include <s3types.h>
84 #include "sphinx3_export.h"
85 
90 #ifdef __cplusplus
91 extern "C" {
92 #endif
93 #if 0
94 } /* Fool Emacs into not indenting things. */
95 #endif
96 
101 typedef struct {
102  /* All structure that measure the time and stuffs we computed */
103  ptmr_t tm_sen;
104  ptmr_t tm_srch;
105  ptmr_t tm_ovrhd;
106  ptmr_t tm;
108  int32 utt_hmm_eval;
109  int32 utt_sen_eval;
110  int32 utt_gau_eval;
113  int32 utt_wd_exit;
115  int32 nfr;
117  float64 tot_sen_eval;
118  float64 tot_gau_eval;
119  float64 tot_ci_sen_eval;
120  float64 tot_ci_gau_eval;
121  float64 tot_hmm_eval;
122  float64 tot_wd_exit;
125  int32 tot_fr;
129 } stat_t ;
130 
134 stat_t* stat_init(void);
135 
138 void stat_free(stat_t* st
139  );
140 
142 void stat_clear_utt(
143  stat_t* st
144  );
145 
147 void stat_clear_corpus(
148  stat_t* st
149  );
150 
152 void stat_update_corpus(
153  stat_t* st
154  );
155 
157 void stat_report_utt(
158  stat_t* st,
159  char * uttid
160  );
161 
164 void stat_report_corpus(
165  stat_t * st
166  );
167 
168 
169 #if 0
170 { /* Stop indent from complaining */
171 #endif
172 #ifdef __cplusplus
173 }
174 #endif
175 
176 #endif
177 
ptmr_t tm_ovrhd
Definition: stat.h:105
float64 tot_gau_eval
Definition: stat.h:118
float64 tot_sen_eval
Definition: stat.h:117
void stat_report_utt(stat_t *st, char *uttid)
int32 utt_hmm_eval
Definition: stat.h:108
int32 utt_cisen_eval
Definition: stat.h:111
int32 utt_cigau_eval
Definition: stat.h:112
int32 utt_sen_eval
Definition: stat.h:109
void stat_clear_utt(stat_t *st)
int32 utt_gau_eval
Definition: stat.h:110
int32 nfr
Definition: stat.h:115
float64 tot_hmm_eval
Definition: stat.h:121
S3DECODER_EXPORT void stat_report_corpus(stat_t *st)
float64 tot_ci_sen_eval
Definition: stat.h:119
ptmr_t tm
Definition: stat.h:106
stat_t * stat_init(void)
Structure to hold all statistics in Sphinx 3.x.
Definition: stat.h:101
Size definition of semantically units. Common for both s3 and s3.X decoder.
#define S3DECODER_EXPORT
Definition: sphinx3_export.h:15
void stat_free(stat_t *st)
int32 utt_wd_exit
Definition: stat.h:113
ptmr_t tm_srch
Definition: stat.h:104
int32 tot_fr
Definition: stat.h:125
void stat_update_corpus(stat_t *st)
ptmr_t tm_sen
Definition: stat.h:103
void stat_clear_corpus(stat_t *st)
float64 tot_wd_exit
Definition: stat.h:122
float64 tot_ci_gau_eval
Definition: stat.h:120