UVES Pipeline Reference Manual  5.4.0
flames_newmatrix.h
1 /*
2  * This file is part of the ESO UVES Pipeline
3  * Copyright (C) 2004,2005 European Southern Observatory
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
18  */
19 
20 /*
21  * $Author: jtaylor $
22  * $Date: 2012-11-19 09:16:16 $
23  * $Revision: 1.9 $
24  * $Name: not supported by cvs2svn $
25  * $Log: not supported by cvs2svn $
26  * Revision 1.8 2010/09/24 09:32:02 amodigli
27  * put back QFITS dependency to fix problem spot by NRI on FIBER mode (with MIDAS calibs) data
28  *
29  * Revision 1.6 2009/04/14 07:01:07 amodigli
30  * added to CVS (moded from flames tree)
31  *
32  * Revision 1.8 2007/06/06 08:17:33 amodigli
33  * replace tab with 4 spaces
34  *
35  * Revision 1.7 2007/06/06 07:22:20 jmlarsen
36  * Changed return type of nrerror()
37  *
38  * Revision 1.6 2007/05/07 06:52:17 amodigli
39  * fixed compilation warnings
40  *
41  * Revision 1.5 2007/01/10 11:08:34 jmlarsen
42  * Don't define DRS_USE_ORDEF
43  *
44  * Revision 1.4 2006/10/17 12:33:42 jmlarsen
45  * Moved FLAMES source to flames directory
46  *
47  * Revision 1.4 2006/10/12 11:59:23 jmlarsen
48  * Conform to source code template
49  *
50  * Revision 1.4 2006/08/17 13:56:52 jmlarsen
51  * Reduced max line length
52  *
53  * Revision 1.3 2006/02/28 09:15:22 jmlarsen
54  * Minor update
55  *
56  * Revision 1.2 2005/12/19 16:17:56 jmlarsen
57  * Replaced bool -> int
58  *
59  */
60 #ifndef FLAMES_NEWMATRIX_H
61 #define FLAMES_NEWMATRIX_H
62 
63 #include <flames_uves.h>
64 
65 void nrerror(const char* error_text);
66 float *vector(int32_t nl, int32_t nh);
67 int *ivector(int32_t nl, int32_t nh);
68 unsigned int *uivector(int32_t nl, int32_t nh);
69 char *cvector(int32_t nl, int32_t nh);
70 unsigned char *ucvector(int32_t nl, int32_t nh);
71 int32_t *lvector(int32_t nl, int32_t nh);
72 uint32_t *ulvector(int32_t nl, int32_t nh);
73 double *dvector(int32_t nl, int32_t nh);
74 frame_data *fdvector(int32_t nl, int32_t nh);
75 frame_mask *fmvector(int32_t nl, int32_t nh);
76 float **matrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
77 char **cmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
78 double **dmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
79 int **imatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
80 uint32_t **ulmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
81 int32_t **lmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
82 frame_data **fdmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
83 frame_mask **fmmatrix(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
84 float **submatrix(float **a, int32_t oldrl, int32_t oldrh, int32_t oldcl,
85  int32_t newrl, int32_t newcl);
86 float **convert_matrix(float *a, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
87 float ***f3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl, int32_t ndh);
88 double ***d3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl, int32_t ndh);
89 frame_data ***fd3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl,
90  int32_t ndh);
91 frame_mask ***fm3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl,
92  int32_t ndh);
93 uint32_t ***ul3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
94  int32_t ndl, int32_t ndh);
95 int32_t ***l3tensor(int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch, int32_t ndl,
96  int32_t ndh);
97 int32_t ****l4tensor(int32_t nal, int32_t nah, int32_t nrl, int32_t nrh, int32_t ncl,
98  int32_t nch, int32_t ndl, int32_t ndh);
99 void free_vector(float *v, int32_t nl, int32_t nh);
100 void free_ivector(int *v, int32_t nl, int32_t nh);
101 void free_uivector(unsigned int *v, int32_t nl, int32_t nh);
102 void free_cvector(char *v, int32_t nl, int32_t nh);
103 void free_ucvector(unsigned char *v, int32_t nl, int32_t nh);
104 void free_lvector(int32_t *v, int32_t nl, int32_t nh);
105 void free_ulvector(uint32_t *v, int32_t nl, int32_t nh);
106 void free_dvector(double *v, int32_t nl, int32_t nh);
107 void free_fdvector(frame_data *v, int32_t nl, int32_t nh);
108 void free_fmvector(frame_mask *v, int32_t nl, int32_t nh);
109 void free_matrix(float **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
110 void free_cmatrix(char **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
111 void free_dmatrix(double **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
112 void free_imatrix(int **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
113 void free_ulmatrix(uint32_t **m, int32_t nrl, int32_t nrh, int32_t ncl,
114  int32_t nch);
115 void free_lmatrix(int32_t **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
116 void free_fdmatrix(frame_data **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
117 void free_fmmatrix(frame_mask **m, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
118 void free_submatrix(float **b, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
119 void free_convert_matrix(float **b, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch);
120 void free_f3tensor(float ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
121  int32_t ndl, int32_t ndh);
122 void free_d3tensor(double ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
123  int32_t ndl, int32_t ndh);
124 void free_fd3tensor(frame_data ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
125  int32_t ndl, int32_t ndh);
126 void free_fm3tensor(frame_mask ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
127  int32_t ndl, int32_t ndh);
128 void free_ul3tensor(uint32_t ***t, int32_t nrl, int32_t nrh, int32_t ncl,
129  int32_t nch,
130  int32_t ndl, int32_t ndh);
131 void free_l3tensor(int32_t ***t, int32_t nrl, int32_t nrh, int32_t ncl, int32_t nch,
132  int32_t ndl, int32_t ndh);
133 void free_l4tensor(int32_t ****t, int32_t nal, int32_t nah, int32_t nrl, int32_t nrh,
134  int32_t ncl, int32_t nch, int32_t ndl, int32_t ndh);
135 void matrix_product(double **, double **, double **, int , int , int );
136 void matrix_sum(double **, double **, int , int );
137 
138 
139 #endif