\doxysection{logmath.\+h}
\label{logmath_8h_source}\index{include/sphinxbase/logmath.h@{include/sphinxbase/logmath.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*\ -\/*-\/\ c-\/basic-\/offset:\ 4;\ indent-\/tabs-\/mode:\ nil\ -\/*-\/\ */}}
\DoxyCodeLine{00002\ \textcolor{comment}{/*\ ====================================================================}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ Copyright\ (c)\ 2007\ Carnegie\ Mellon\ University.\ \ All\ rights}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ reserved.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ without}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ modification,\ are\ permitted\ provided\ that\ the\ following\ conditions}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ are\ met:}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ 1.\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer.\ }}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ 2.\ Redistributions\ in\ binary\ form\ must\ reproduce\ the\ above\ copyright}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer\ in}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ \ \ \ the\ documentation\ and/or\ other\ materials\ provided\ with\ the}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ \ \ \ distribution.}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *\ This\ work\ was\ supported\ in\ part\ by\ funding\ from\ the\ Defense\ Advanced\ }}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ Research\ Projects\ Agency\ and\ the\ National\ Science\ Foundation\ of\ the\ }}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ United\ States\ of\ America,\ and\ the\ CMU\ Sphinx\ Speech\ Consortium.}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ CARNEGIE\ MELLON\ UNIVERSITY\ \`{}\`{}AS\ IS''\ AND\ }}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ ANY\ EXPRESSED\ OR\ IMPLIED\ WARRANTIES,\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ }}
\DoxyCodeLine{00024\ \textcolor{comment}{\ *\ THE\ IMPLIED\ WARRANTIES\ OF\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ *\ PURPOSE\ ARE\ DISCLAIMED.\ \ IN\ NO\ EVENT\ SHALL\ CARNEGIE\ MELLON\ UNIVERSITY}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ *\ NOR\ ITS\ EMPLOYEES\ BE\ LIABLE\ FOR\ ANY\ DIRECT,\ INDIRECT,\ INCIDENTAL,}}
\DoxyCodeLine{00027\ \textcolor{comment}{\ *\ SPECIAL,\ EXEMPLARY,\ OR\ CONSEQUENTIAL\ DAMAGES\ (INCLUDING,\ BUT\ NOT\ }}
\DoxyCodeLine{00028\ \textcolor{comment}{\ *\ LIMITED\ TO,\ PROCUREMENT\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;\ LOSS\ OF\ USE,\ }}
\DoxyCodeLine{00029\ \textcolor{comment}{\ *\ DATA,\ OR\ PROFITS;\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND\ ON\ ANY\ }}
\DoxyCodeLine{00030\ \textcolor{comment}{\ *\ THEORY\ OF\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT\ }}
\DoxyCodeLine{00031\ \textcolor{comment}{\ *\ (INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ USE\ }}
\DoxyCodeLine{00032\ \textcolor{comment}{\ *\ OF\ THIS\ SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ DAMAGE.}}
\DoxyCodeLine{00033\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00034\ \textcolor{comment}{\ *\ ====================================================================}}
\DoxyCodeLine{00035\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00036\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00072\ \textcolor{preprocessor}{\#ifndef\ \_\_LOGMATH\_H\_\_}}
\DoxyCodeLine{00073\ \textcolor{preprocessor}{\#define\ \_\_LOGMATH\_H\_\_}}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00075\ \textcolor{preprocessor}{\#include\ <sphinxbase/sphinxbase\_export.h>}}
\DoxyCodeLine{00076\ \textcolor{preprocessor}{\#include\ <sphinxbase/prim\_type.h>}}
\DoxyCodeLine{00077\ \textcolor{preprocessor}{\#include\ <sphinxbase/cmd\_ln.h>}}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00081\ \textcolor{keyword}{extern}\ \textcolor{stringliteral}{"{}C"{}}\ \{}
\DoxyCodeLine{00082\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00083\ \textcolor{preprocessor}{\#if\ 0}}
\DoxyCodeLine{00084\ \textcolor{comment}{/*\ Fool\ Emacs.\ */}}
\DoxyCodeLine{00085\ \}}
\DoxyCodeLine{00086\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00087\ }
\DoxyCodeLine{00093\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }logadd\_s\ logadd\_t;}
\DoxyCodeLine{00094\ \textcolor{keyword}{struct\ }logadd\_s\ \{}
\DoxyCodeLine{00096\ \ \ \ \ \textcolor{keywordtype}{void}\ *table;}
\DoxyCodeLine{00098\ \ \ \ \ uint32\ table\_size;}
\DoxyCodeLine{00100\ \ \ \ \ uint8\ width;}
\DoxyCodeLine{00102\ \ \ \ \ int8\ shift;}
\DoxyCodeLine{00103\ \};}
\DoxyCodeLine{00104\ }
\DoxyCodeLine{00108\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }logmath\_s\ logmath\_t;}
\DoxyCodeLine{00109\ }
\DoxyCodeLine{00113\ \textcolor{preprocessor}{\#define\ LOGMATH\_TABLE(lm)\ ((logadd\_t\ *)lm)}}
\DoxyCodeLine{00114\ }
\DoxyCodeLine{00122\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00123\ logmath\_t\ *logmath\_init(float64\ base,\ \textcolor{keywordtype}{int}\ shift,\ \textcolor{keywordtype}{int}\ use\_table);}
\DoxyCodeLine{00124\ }
\DoxyCodeLine{00128\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00129\ logmath\_t\ *logmath\_read(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *filename);}
\DoxyCodeLine{00130\ }
\DoxyCodeLine{00134\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00135\ int32\ logmath\_write(logmath\_t\ *lmath,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *filename);}
\DoxyCodeLine{00136\ }
\DoxyCodeLine{00140\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00141\ int32\ logmath\_get\_table\_shape(logmath\_t\ *lmath,\ uint32\ *out\_size,}
\DoxyCodeLine{00142\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\ *out\_width,\ uint32\ *out\_shift);}
\DoxyCodeLine{00143\ }
\DoxyCodeLine{00147\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00148\ float64\ logmath\_get\_base(logmath\_t\ *lmath);}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00153\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00154\ \textcolor{keywordtype}{int}\ logmath\_get\_zero(logmath\_t\ *lmath);}
\DoxyCodeLine{00155\ }
\DoxyCodeLine{00159\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00160\ \textcolor{keywordtype}{int}\ logmath\_get\_width(logmath\_t\ *lmath);}
\DoxyCodeLine{00161\ }
\DoxyCodeLine{00165\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00166\ \textcolor{keywordtype}{int}\ logmath\_get\_shift(logmath\_t\ *lmath);}
\DoxyCodeLine{00167\ }
\DoxyCodeLine{00173\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00174\ logmath\_t\ *logmath\_retain(logmath\_t\ *lmath);}
\DoxyCodeLine{00175\ }
\DoxyCodeLine{00181\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00182\ \textcolor{keywordtype}{int}\ logmath\_free(logmath\_t\ *lmath);}
\DoxyCodeLine{00183\ }
\DoxyCodeLine{00187\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00188\ \textcolor{keywordtype}{int}\ logmath\_add\_exact(logmath\_t\ *lmath,\ \textcolor{keywordtype}{int}\ logb\_p,\ \textcolor{keywordtype}{int}\ logb\_q);}
\DoxyCodeLine{00189\ }
\DoxyCodeLine{00193\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00194\ \textcolor{keywordtype}{int}\ logmath\_add(logmath\_t\ *lmath,\ \textcolor{keywordtype}{int}\ logb\_p,\ \textcolor{keywordtype}{int}\ logb\_q);}
\DoxyCodeLine{00195\ }
\DoxyCodeLine{00199\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00200\ \textcolor{keywordtype}{int}\ logmath\_log(logmath\_t\ *lmath,\ float64\ p);}
\DoxyCodeLine{00201\ }
\DoxyCodeLine{00205\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00206\ float64\ logmath\_exp(logmath\_t\ *lmath,\ \textcolor{keywordtype}{int}\ logb\_p);}
\DoxyCodeLine{00207\ }
\DoxyCodeLine{00211\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00212\ \textcolor{keywordtype}{int}\ logmath\_ln\_to\_log(logmath\_t\ *lmath,\ float64\ log\_p);}
\DoxyCodeLine{00213\ }
\DoxyCodeLine{00217\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00218\ float64\ logmath\_log\_to\_ln(logmath\_t\ *lmath,\ \textcolor{keywordtype}{int}\ logb\_p);}
\DoxyCodeLine{00219\ }
\DoxyCodeLine{00223\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00224\ \textcolor{keywordtype}{int}\ logmath\_log10\_to\_log(logmath\_t\ *lmath,\ float64\ log\_p);}
\DoxyCodeLine{00225\ }
\DoxyCodeLine{00229\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00230\ float64\ logmath\_log\_to\_log10(logmath\_t\ *lmath,\ \textcolor{keywordtype}{int}\ logb\_p);}
\DoxyCodeLine{00231\ }
\DoxyCodeLine{00232\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00233\ \}}
\DoxyCodeLine{00234\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00235\ }
\DoxyCodeLine{00236\ }
\DoxyCodeLine{00237\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ \ \_\_LOGMATH\_H\_\_\ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
