my_matrix.h

00001 
00002 /*----------------------------------------------------------------------------
00003    
00004    File name    :   matrix.h
00005    Author       :   Nicolas Devillard
00006    Created on   :   1994
00007    Description  :   basic 2d matrix handling routines
00008 
00009  ---------------------------------------------------------------------------*/
00010 /*
00011  $Id: matrix.h,v 1.7 2000/10/11 13:56:58 ndevilla Exp $
00012  $Author: ndevilla $
00013  $Date: 2000/10/11 13:56:58 $
00014  $Revision: 1.7 $
00015  */
00016 
00017 #ifndef _MATRIX_H_
00018 #define _MATRIX_H_
00019 
00020 
00021 /*---------------------------------------------------------------------------
00022                                 Includes
00023  ---------------------------------------------------------------------------*/
00024 
00025 #include <stdio.h>
00026 #include <stdlib.h>
00027 #include <math.h>
00028 
00029 
00030 /*---------------------------------------------------------------------------
00031                                 Defines
00032  ---------------------------------------------------------------------------*/
00033 
00034 #define _(b,i,j) (*((b)->m+(i)*(b)->nc+(j))) /* b(i,j)*/
00035 
00036 #define mx_get(M,i,j)   ((M)->m[(i)+(j)*(M)->nc])
00037 #define mx_set(M,i,j,v) (mx_get(M,i,j)=v)
00038 
00039 
00040 /*---------------------------------------------------------------------------
00041                                 New Types
00042  ---------------------------------------------------------------------------*/
00043 
00044 
00045 typedef struct _MATRIX_ {
00046     double  *   m;
00047     int         nr;
00048     int         nc;
00049 } matrix, *Matrix;
00050 
00051 
00052 
00053 /*---------------------------------------------------------------------------
00054                         Function ANSI C prototypes
00055  ---------------------------------------------------------------------------*/
00056 
00057 
00058 /*-------------------------------------------------------------------------*/
00069 /*--------------------------------------------------------------------------*/
00070 
00071 Matrix
00072 create_mx(int nr, int nc) ;
00073 
00074 
00075 /*-------------------------------------------------------------------------*/
00085 /*--------------------------------------------------------------------------*/
00086 
00087 Matrix
00088 copy_mx(Matrix a) ;
00089 
00090 
00091 /*-------------------------------------------------------------------------*/
00101 /*--------------------------------------------------------------------------*/
00102 void
00103 close_mx(Matrix a) ;
00104 
00105 
00106 /*-------------------------------------------------------------------------*/
00117 /*--------------------------------------------------------------------------*/
00118 
00119 Matrix
00120 mul_mx(Matrix a, Matrix b) ;
00121 
00122 
00123 /*-------------------------------------------------------------------------*/
00135 /*--------------------------------------------------------------------------*/
00136 Matrix
00137 invert_mx(Matrix aa) ;
00138 
00139 
00140 /*-------------------------------------------------------------------------*/
00150 /*--------------------------------------------------------------------------*/
00151 
00152 Matrix
00153 transp_mx(Matrix a) ;
00154 
00155 
00156 /*-------------------------------------------------------------------------*/
00175 /*--------------------------------------------------------------------------*/
00176 
00177 Matrix least_sq_mx(
00178     Matrix  A,
00179     Matrix  B
00180 ) ;
00181 
00182 
00183 /*-------------------------------------------------------------------------*/
00195 /*--------------------------------------------------------------------------*/
00196 
00197 void print_mx(
00198     Matrix  M,
00199     char *  name
00200 ) ;
00201 
00202 
00203 #endif

Generated on Wed Oct 26 13:08:53 2005 for SINFONI Pipeline Reference Manual by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001