flames_newmatrix.h

00001 /*
00002  * This file is part of the ESO UVES Pipeline
00003  * Copyright (C) 2004,2005 European Southern Observatory
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
00018  */
00019 
00020 /*
00021  * $Author: jtaylor $
00022  * $Date: 2012/11/19 09:16:16 $
00023  * $Revision: 1.9 $
00024  * $Name: HEAD $
00025  * $Log: flames_newmatrix.h,v $
00026  * Revision 1.9  2012/11/19 09:16:16  jtaylor
00027  * replace all (u)long ints with (u)int32_t in flames
00028  *
00029  * except the fitsio arguments in load_frame() from uves/flames_midas_def.c
00030  * the rest of uves is unchanged
00031  * (uves/uves_deque.c must not be changed for compatibility with cpl)
00032  *
00033  * required for 64 bit compatibility
00034  * the midas fits io does not support 8 byte long integers.
00035  * longs are 4 byte on 32 bit and 8 byte on 64 bit so the simplest fix is
00036  * to replace them all with the size which is known to work.
00037  * An alternative would be to check and fix all io related functions
00038  * this would require adding a 4 byte integer tensor
00039  *
00040  * Revision 1.8  2010/09/24 09:32:02  amodigli
00041  * put back QFITS dependency to fix problem spot by NRI on FIBER mode (with MIDAS calibs) data
00042  *
00043  * Revision 1.6  2009/04/14 07:01:07  amodigli
00044  * added to CVS (moded from flames tree)
00045  *
00046  * Revision 1.8  2007/06/06 08:17:33  amodigli
00047  * replace tab with 4 spaces
00048  *
00049  * Revision 1.7  2007/06/06 07:22:20  jmlarsen
00050  * Changed return type of nrerror()
00051  *
00052  * Revision 1.6  2007/05/07 06:52:17  amodigli
00053  * fixed compilation warnings
00054  *
00055  * Revision 1.5  2007/01/10 11:08:34  jmlarsen
00056  * Don't define DRS_USE_ORDEF
00057  *
00058  * Revision 1.4  2006/10/17 12:33:42  jmlarsen
00059  * Moved FLAMES source to flames directory
00060  *
00061  * Revision 1.4  2006/10/12 11:59:23  jmlarsen
00062  * Conform to source code template
00063  *
00064  * Revision 1.4  2006/08/17 13:56:52  jmlarsen
00065  * Reduced max line length
00066  *
00067  * Revision 1.3  2006/02/28 09:15:22  jmlarsen
00068  * Minor update
00069  *
00070  * Revision 1.2  2005/12/19 16:17:56  jmlarsen
00071  * Replaced bool -> int
00072  *
00073  */
00074 #ifndef FLAMES_NEWMATRIX_H
00075 #define FLAMES_NEWMATRIX_H
00076 
00077 #include <flames_uves.h>
00078 
00079 void nrerror(const char* error_text);
00080 float *vector(int32_t nl, int32_t nh);
00081 int *ivector(int32_t nl, int32_t nh);
00082 unsigned int *uivector(int32_t nl, int32_t nh);
00083 char *cvector(int32_t nl, int32_t nh);
00084 unsigned char *ucvector(int32_t nl, int32_t nh);
00085 int32_t *lvector(int32_t nl, int32_t nh);
00086 uint32_t *ulvector(int32_t nl, int32_t nh);
00087 double *dvector(int32_t nl, int32_t nh);
00088 frame_data *fdvector(int32_t nl, int32_t nh);
00089 frame_mask *fmvector(int32_t nl, int32_t nh);
00090 float **matrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00091 char **cmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00092 double **dmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00093 int **imatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00094 uint32_t **ulmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00095 int32_t **lmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00096 frame_data **fdmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00097 frame_mask **fmmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00098 float **submatrix(float **a, int32_t oldrl, int32_t oldrh, int32_t oldcl,
00099     int32_t newrl, int32_t newcl);
00100 float **convert_matrix(float *a, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00101 float ***f3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl, int32_t ndh);
00102 double ***d3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl, int32_t ndh);
00103 frame_data ***fd3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl, 
00104             int32_t ndh);
00105 frame_mask ***fm3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl, 
00106             int32_t ndh);
00107 uint32_t ***ul3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, 
00108                    int32_t ndl, int32_t ndh);
00109 int32_t ***l3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl, 
00110              int32_t ndh);
00111 int32_t ****l4tensor(int32_t nal, int32_t nah, int32_t nrl, int32_t nrh, int32_t ncl, 
00112               int32_t nch, int32_t ndl, int32_t ndh);
00113 void free_vector(float *v, int32_t nl, int32_t nh);
00114 void free_ivector(int *v, int32_t nl, int32_t nh);
00115 void free_uivector(unsigned int *v, int32_t nl, int32_t nh);
00116 void free_cvector(char *v, int32_t nl, int32_t nh);
00117 void free_ucvector(unsigned char *v, int32_t nl, int32_t nh);
00118 void free_lvector(int32_t *v, int32_t nl, int32_t nh);
00119 void free_ulvector(uint32_t *v, int32_t nl, int32_t nh);
00120 void free_dvector(double *v, int32_t nl, int32_t nh);
00121 void free_fdvector(frame_data *v, int32_t nl, int32_t nh);
00122 void free_fmvector(frame_mask *v, int32_t nl, int32_t nh);
00123 void free_matrix(float **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00124 void free_cmatrix(char **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00125 void free_dmatrix(double **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00126 void free_imatrix(int **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00127 void free_ulmatrix(uint32_t **m, int32_t nrl, int32_t nrh, int32_t ncl, 
00128            int32_t nch);
00129 void free_lmatrix(int32_t **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00130 void free_fdmatrix(frame_data **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00131 void free_fmmatrix(frame_mask **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00132 void free_submatrix(float **b, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00133 void free_convert_matrix(float **b, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
00134 void free_f3tensor(float ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
00135     int32_t ndl, int32_t ndh);
00136 void free_d3tensor(double ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
00137     int32_t ndl, int32_t ndh);
00138 void free_fd3tensor(frame_data ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
00139     int32_t ndl, int32_t ndh);
00140 void free_fm3tensor(frame_mask ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
00141     int32_t ndl, int32_t ndh);
00142 void free_ul3tensor(uint32_t ***t, int32_t nrl, int32_t nrh, int32_t ncl, 
00143             int32_t nch,
00144     int32_t ndl, int32_t ndh);
00145 void free_l3tensor(int32_t ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
00146     int32_t ndl, int32_t ndh);
00147 void free_l4tensor(int32_t ****t, int32_t nal, int32_t nah, int32_t nrl, int32_t nrh, 
00148            int32_t ncl, int32_t nch, int32_t ndl, int32_t ndh);
00149 void matrix_product(double **, double **, double **, int , int , int );
00150 void matrix_sum(double **, double **, int , int );
00151 
00152 
00153 #endif

Generated on 3 Mar 2013 for UVES Pipeline Reference Manual by  doxygen 1.6.1