SphinxBase 0.6
include/sphinxbase/matrix.h
Go to the documentation of this file.
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/sphinxbase_export.h>
00070 #include <sphinxbase/prim_type.h>
00071 
00072 
00080 SPHINXBASE_EXPORT void norm_3d(float32 ***arr, uint32 d1, uint32 d2, uint32 d3);
00081 
00090 SPHINXBASE_EXPORT void
00091 accum_3d(float32 ***out, float32 ***in, uint32 d1, uint32 d2, uint32 d3);
00092 
00098 SPHINXBASE_EXPORT void band_nz_1d(float32 *v, uint32 d1, float32 band);
00099 
00108 SPHINXBASE_EXPORT void floor_nz_3d(float32 ***m, uint32 d1, uint32 d2, uint32 d3, float32 floor);
00109 
00116 SPHINXBASE_EXPORT void floor_nz_1d(float32 *v, uint32 d1, float32 floor);
00117 
00130 SPHINXBASE_EXPORT
00131 float64 determinant(float32 **a, int32 len);
00132 
00143 SPHINXBASE_EXPORT
00144 int32 invert(float32 **out_ainv, float32 **a, int32 len);
00145 
00157 SPHINXBASE_EXPORT
00158 int32 solve(float32 **a, float32 *b,
00159             float32 *out_x, int32 n);
00160 
00169 SPHINXBASE_EXPORT
00170 void outerproduct(float32 **out_a, float32 *x, float32 *y, int32 len);
00171 
00179 SPHINXBASE_EXPORT
00180 void matrixmultiply(float32 **out_c, /* = */
00181                     float32 **a, /* * */ float32 **b,
00182                     int32 n);
00183 
00190 SPHINXBASE_EXPORT
00191 void scalarmultiply(float32 **inout_a, float32 x, int32 n);
00192 
00199 SPHINXBASE_EXPORT
00200 void matrixadd(float32 **inout_a, float32 **b, int32 n);
00201 
00202 #if 0
00203 { /* Fool indent. */
00204 #endif
00205 #ifdef __cplusplus
00206 }
00207 #endif
00208 
00209 #endif /* MATRIX_H */ 
00210 
00211 
00212 /*
00213  * Log record.  Maintained by RCS.
00214  *
00215  * $Log$
00216  * Revision 1.4  2004/07/21  17:46:09  egouvea
00217  * Changed the license terms to make it the same as sphinx2 and sphinx3.
00218  * 
00219  * Revision 1.3  2001/04/05 20:02:30  awb
00220  * *** empty log message ***
00221  *
00222  * Revision 1.2  2000/09/29 22:35:12  awb
00223  * *** empty log message ***
00224  *
00225  * Revision 1.1  2000/09/24 21:38:30  awb
00226  * *** empty log message ***
00227  *
00228  * Revision 1.1  97/07/16  11:39:10  eht
00229  * Initial revision
00230  * 
00231  *
00232  */