|
Packit |
67cb25 |
/* statistics/test.c
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Jim Davies, Brian Gough
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* This program is free software; you can redistribute it and/or modify
|
|
Packit |
67cb25 |
* it under the terms of the GNU General Public License as published by
|
|
Packit |
67cb25 |
* the Free Software Foundation; either version 3 of the License, or (at
|
|
Packit |
67cb25 |
* your option) any later version.
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* This program is distributed in the hope that it will be useful, but
|
|
Packit |
67cb25 |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
67cb25 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
67cb25 |
* General Public License for more details.
|
|
Packit |
67cb25 |
*
|
|
Packit |
67cb25 |
* You should have received a copy of the GNU General Public License
|
|
Packit |
67cb25 |
* along with this program; if not, write to the Free Software
|
|
Packit |
67cb25 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
Packit |
67cb25 |
*/
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#include <config.h>
|
|
Packit |
67cb25 |
#include <string.h>
|
|
Packit |
67cb25 |
#include <stdlib.h>
|
|
Packit |
67cb25 |
#include <math.h>
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#include <gsl/gsl_math.h>
|
|
Packit |
67cb25 |
#include <gsl/gsl_test.h>
|
|
Packit |
67cb25 |
#include <gsl/gsl_sort.h>
|
|
Packit |
67cb25 |
#include <gsl/gsl_sort_vector.h>
|
|
Packit |
67cb25 |
#include <gsl/gsl_statistics.h>
|
|
Packit |
67cb25 |
#include <gsl/gsl_ieee_utils.h>
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
int test_nist (void);
|
|
Packit |
67cb25 |
int test_robust (void);
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
/* Test program for mean.c. JimDavies 7.96 */
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_LONG_DOUBLE
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_float_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_LONG_DOUBLE
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_DOUBLE
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_float_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_DOUBLE
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_FLOAT
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_float_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_FLOAT
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_ULONG
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_int_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_ULONG
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_LONG
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_int_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_LONG
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_UINT
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_int_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_UINT
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_INT
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_int_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_INT
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_USHORT
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_int_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_USHORT
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_SHORT
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_int_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_SHORT
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_UCHAR
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_int_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_UCHAR
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
#define BASE_CHAR
|
|
Packit |
67cb25 |
#include "templates_on.h"
|
|
Packit |
67cb25 |
#include "test_int_source.c"
|
|
Packit |
67cb25 |
#include "templates_off.h"
|
|
Packit |
67cb25 |
#undef BASE_CHAR
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
int
|
|
Packit |
67cb25 |
main (void)
|
|
Packit |
67cb25 |
{
|
|
Packit |
67cb25 |
size_t s1, s2;
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
gsl_ieee_env_setup ();
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
for (s1 = 1; s1 < 4 ; s1++)
|
|
Packit |
67cb25 |
{
|
|
Packit |
67cb25 |
s2 = (s1 < 3) ? 1 : (s1 - 1) ;
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
test_func (s1,s2);
|
|
Packit |
67cb25 |
test_float_func (s1,s2);
|
|
Packit |
67cb25 |
test_long_double_func (s1,s2);
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
test_ulong_func (s1,s2);
|
|
Packit |
67cb25 |
test_long_func (s1,s2);
|
|
Packit |
67cb25 |
test_uint_func (s1,s2);
|
|
Packit |
67cb25 |
test_int_func (s1,s2);
|
|
Packit |
67cb25 |
test_ushort_func (s1,s2);
|
|
Packit |
67cb25 |
test_short_func (s1,s2);
|
|
Packit |
67cb25 |
test_uchar_func (s1,s2);
|
|
Packit |
67cb25 |
test_char_func (s1,s2);
|
|
Packit |
67cb25 |
}
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
test_nist();
|
|
Packit |
67cb25 |
test_robust();
|
|
Packit |
67cb25 |
|
|
Packit |
67cb25 |
exit (gsl_test_summary ());
|
|
Packit |
67cb25 |
}
|
|
Packit |
67cb25 |
|