00001 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */ 00002 /* ==================================================================== 00003 * Copyright (c) 1997-2000 Carnegie Mellon University. All rights 00004 * reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions 00008 * are met: 00009 * 00010 * 1. Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * 00013 * 2. Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in 00015 * the documentation and/or other materials provided with the 00016 * distribution. 00017 * 00018 * This work was supported in part by funding from the Defense Advanced 00019 * Research Projects Agency and the National Science Foundation of the 00020 * United States of America, and the CMU Sphinx Speech Consortium. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 00023 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00024 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00025 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY 00026 * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00027 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00028 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00029 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00030 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00031 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00032 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 * 00034 * ==================================================================== 00035 * 00036 */ 00037 /********************************************************************* 00038 * 00039 * File: matrix.h 00040 * 00041 * Description: Matrix and linear algebra functions 00042 * 00043 * Author: 00044 * 00045 *********************************************************************/ 00046 00047 #ifndef MATRIX_H 00048 #define MATRIX_H 00049 00060 #ifdef __cplusplus 00061 extern "C" { 00062 #endif 00063 #if 0 00064 /* Fool Emacs. */ 00065 } 00066 #endif 00067 00068 /* Win32/WinCE DLL gunk */ 00069 #include <sphinxbase_export.h> 00070 #include <prim_type.h> 00071 00084 SPHINXBASE_EXPORT 00085 float64 determinant(float32 **a, int32 len); 00086 00097 SPHINXBASE_EXPORT 00098 int32 invert(float32 **out_ainv, float32 **a, int32 len); 00099 00111 SPHINXBASE_EXPORT 00112 int32 solve(float32 **a, float32 *b, 00113 float32 *out_x, int32 n); 00114 00123 SPHINXBASE_EXPORT 00124 void outerproduct(float32 **out_a, float32 *x, float32 *y, int32 len); 00125 00133 SPHINXBASE_EXPORT 00134 void matrixmultiply(float32 **out_c, /* = */ 00135 float32 **a, /* * */ float32 **b, 00136 int32 n); 00137 00144 SPHINXBASE_EXPORT 00145 void scalarmultiply(float32 **inout_a, float32 x, int32 n); 00146 00153 SPHINXBASE_EXPORT 00154 void matrixadd(float32 **inout_a, float32 **b, int32 n); 00155 00156 #if 0 00157 { /* Fool indent. */ 00158 #endif 00159 #ifdef __cplusplus 00160 } 00161 #endif 00162 00163 #endif /* MATRIX_H */ 00164 00165 00166 /* 00167 * Log record. Maintained by RCS. 00168 * 00169 * $Log$ 00170 * Revision 1.4 2004/07/21 17:46:09 egouvea 00171 * Changed the license terms to make it the same as sphinx2 and sphinx3. 00172 * 00173 * Revision 1.3 2001/04/05 20:02:30 awb 00174 * *** empty log message *** 00175 * 00176 * Revision 1.2 2000/09/29 22:35:12 awb 00177 * *** empty log message *** 00178 * 00179 * Revision 1.1 2000/09/24 21:38:30 awb 00180 * *** empty log message *** 00181 * 00182 * Revision 1.1 97/07/16 11:39:10 eht 00183 * Initial revision 00184 * 00185 * 00186 */