Added script front-end for primer-design code
[htsworkflow.git] / htswanalysis / MACS / lib / gsl / gsl-1.11 / matrix / test.c
1 /* matrix/test.c
2  * 
3  * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough
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 3 of the License, or (at
8  * your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * 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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #include <config.h>
21
22 #if (!GSL_RANGE_CHECK) && defined(HAVE_INLINE)
23 #undef GSL_RANGE_CHECK
24 #define GSL_RANGE_CHECK 1
25 #endif
26
27 #include <stdlib.h>
28 #include <stdio.h>
29 #include <math.h>
30 #include <gsl/gsl_math.h>
31 #include <gsl/gsl_matrix.h>
32 #include <gsl/gsl_test.h>
33 #include <gsl/gsl_ieee_utils.h>
34
35 #define M 53
36 #define N 107
37
38 int status = 0;
39
40 #ifndef DESC
41 #define DESC ""
42 #endif
43
44 #define BASE_GSL_COMPLEX_LONG
45 #include "templates_on.h"
46 #include "test_complex_source.c"
47 #include "templates_off.h"
48 #undef  BASE_GSL_COMPLEX_LONG
49
50 #define BASE_GSL_COMPLEX
51 #include "templates_on.h"
52 #include "test_complex_source.c"
53 #include "templates_off.h"
54 #undef  BASE_GSL_COMPLEX
55
56 #define BASE_GSL_COMPLEX_FLOAT
57 #include "templates_on.h"
58 #include "test_complex_source.c"
59 #include "templates_off.h"
60 #undef  BASE_GSL_COMPLEX_FLOAT
61
62 #define BASE_LONG_DOUBLE
63 #include "templates_on.h"
64 #include "test_source.c"
65 #include "templates_off.h"
66 #undef  BASE_LONG_DOUBLE
67
68 #define BASE_DOUBLE
69 #include "templates_on.h"
70 #include "test_source.c"
71 #include "templates_off.h"
72 #undef  BASE_DOUBLE
73
74 #define BASE_FLOAT
75 #include "templates_on.h"
76 #include "test_source.c"
77 #include "templates_off.h"
78 #undef  BASE_FLOAT
79
80 #define BASE_ULONG
81 #include "templates_on.h"
82 #include "test_source.c"
83 #include "templates_off.h"
84 #undef  BASE_ULONG
85
86 #define BASE_LONG
87 #include "templates_on.h"
88 #include "test_source.c"
89 #include "templates_off.h"
90 #undef  BASE_LONG
91
92 #define BASE_UINT
93 #include "templates_on.h"
94 #include "test_source.c"
95 #include "templates_off.h"
96 #undef  BASE_UINT
97
98 #define BASE_INT
99 #include "templates_on.h"
100 #include "test_source.c"
101 #include "templates_off.h"
102 #undef  BASE_INT
103
104 #define BASE_USHORT
105 #include "templates_on.h"
106 #include "test_source.c"
107 #include "templates_off.h"
108 #undef  BASE_USHORT
109
110 #define BASE_SHORT
111 #include "templates_on.h"
112 #include "test_source.c"
113 #include "templates_off.h"
114 #undef  BASE_SHORT
115
116 #define BASE_UCHAR
117 #include "templates_on.h"
118 #include "test_source.c"
119 #include "templates_off.h"
120 #undef  BASE_UCHAR
121
122 #define BASE_CHAR
123 #include "templates_on.h"
124 #include "test_source.c"
125 #include "templates_off.h"
126 #undef  BASE_CHAR
127
128 void my_error_handler (const char *reason, const char *file,
129                        int line, int err);
130
131 int
132 main (void)
133 {
134   gsl_ieee_env_setup ();
135
136   test_func ();
137   test_float_func ();
138   test_long_double_func ();
139   test_ulong_func ();
140   test_long_func ();
141   test_uint_func ();
142   test_int_func ();
143   test_ushort_func ();
144   test_short_func ();
145   test_uchar_func ();
146   test_char_func ();
147   test_complex_func ();
148   test_complex_float_func ();
149   test_complex_long_double_func ();
150
151   test_text ();
152   test_float_text ();
153 #if HAVE_PRINTF_LONGDOUBLE
154   test_long_double_text ();
155 #endif
156   test_ulong_text ();
157   test_long_text ();
158   test_uint_text ();
159   test_int_text ();
160   test_ushort_text ();
161   test_short_text ();
162   test_uchar_text ();
163   test_char_text ();
164   test_complex_text ();
165   test_complex_float_text ();
166 #if HAVE_PRINTF_LONGDOUBLE
167   test_complex_long_double_text ();
168 #endif
169
170   test_binary ();
171   test_float_binary ();
172   test_long_double_binary ();
173   test_ulong_binary ();
174   test_long_binary ();
175   test_uint_binary ();
176   test_int_binary ();
177   test_ushort_binary ();
178   test_short_binary ();
179   test_uchar_binary ();
180   test_char_binary ();
181   test_complex_binary ();
182   test_complex_float_binary ();
183   test_complex_long_double_binary ();
184
185 #if GSL_RANGE_CHECK
186   gsl_set_error_handler (&my_error_handler);
187
188   test_trap ();
189   test_float_trap ();
190   test_long_double_trap ();
191   test_ulong_trap ();
192   test_long_trap ();
193   test_uint_trap ();
194   test_int_trap ();
195   test_ushort_trap ();
196   test_short_trap ();
197   test_uchar_trap ();
198   test_char_trap ();
199   test_complex_trap ();
200   test_complex_float_trap ();
201   test_complex_long_double_trap ();
202 #endif
203
204   test_complex_arith ();
205   test_complex_float_arith ();
206   test_complex_long_double_arith ();
207
208   exit (gsl_test_summary ());
209 }
210
211 void
212 my_error_handler (const char *reason, const char *file, int line, int err)
213 {
214   if (0)
215     printf ("(caught [%s:%d: %s (%d)])\n", file, line, reason, err);
216   status = 1;
217 }