logs3.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  * logs3.h -- log(base-S3) module.
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.11 2006/03/03 19:45:01 egouvea
53  * Clean up the log handling. In logs3.c, removed unnecessary variables
54  * (e.g. "f", exactly the same as "F") and functions (e.g. "logs3_10base()").
55  *
56  * In confidence.c, replace (logs3_to_log10(r_lscr) * logs3_10base())
57  * with r_lscr, since the only difference is that one is a double, the
58  * other an int (and as such, they differ on the order of 1e-12).
59  *
60  * In future cleanups.... replace the "int" declaration with "int32",
61  * used in the rest of the code.
62  *
63  * Revision 1.10 2006/02/22 20:31:53 arthchan2003
64  * Add clarification comment on logs3.h
65  *
66  * Revision 1.9.4.1 2006/01/16 19:51:19 arthchan2003
67  * Added a function to convert Sphinx 3 log to log 10.
68  *
69  * Revision 1.9 2005/06/21 20:46:54 arthchan2003
70  * 1, Added a report flag in logs3_init, 2, Fixed doxygen documentation, 3, Add the $ keyword.
71  *
72  * Revision 1.6 2005/06/13 04:02:57 archan
73  * Fixed most doxygen-style documentation under libs3decoder.
74  *
75  * Revision 1.5 2005/05/27 01:15:44 archan
76  * 1, Changing the function prototypes of logs3_init to have another argument which specify whether an add table should be used. Corresponding changes have made in all executables and test programs. 2, Synchronzie how align, allphone, decode_anytopo, dag sets the default value of logbase.
77  *
78  * Revision 1.4 2005/04/21 23:50:26 archan
79  * 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.
80  *
81  * Revision 1.3 2005/03/30 01:22:47 archan
82  * Fixed mistakes in last updates. Add
83  *
84  *
85  * 28-Apr-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University.
86  * Added log_to_logs3_factor(), and logs3_to_p().
87  *
88  * 05-Nov-95 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University.
89  * Created.
90  */
91 
92 
93 #ifndef _S3_LOGS3_H_
94 #define _S3_LOGS3_H_
95 
96 #include <s3types.h>
97 #include <logmath.h>
98 
110 #ifdef __cplusplus
111 extern "C" {
112 #endif
113 #if 0
114 } /* Fool Emacs into not indenting things. */
115 #endif
116 
117 
118 #define LOGS3_SUCCESS 1
119 #define LOGS3_FAILURE 0
120 
123 logmath_t* logs3_init (float64 base,
124  int32 bReport,
125  int32 bLogTable
126  );
127 
130 int32 logs3 (logmath_t* logmath,
131  float64 p
132  );
133 
135 void logs3_report(logmath_t* logmath);
136 
137 #if 0
138 { /* Stop indent from complaining */
139 #endif
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 
145 #endif
void logs3_report(logmath_t *logmath)
S3DECODER_EXPORT logmath_t * logs3_init(float64 base, int32 bReport, int32 bLogTable)
Size definition of semantically units. Common for both s3 and s3.X decoder.
#define S3DECODER_EXPORT
Definition: sphinx3_export.h:15
S3DECODER_EXPORT int32 logs3(logmath_t *logmath, float64 p)