MD-Bench/common/includes/util.h

47 lines
996 B
C
Raw Permalink Normal View History

2020-08-18 14:27:28 +02:00
/*
* Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg.
* All rights reserved. This file is part of MD-Bench.
* Use of this source code is governed by a LGPL-3.0
* license that can be found in the LICENSE file.
2020-08-18 14:27:28 +02:00
*/
#ifndef __UTIL_H_
#define __UTIL_H_
#ifndef MIN
# define MIN(x,y) ((x)<(y)?(x):(y))
2020-08-18 14:27:28 +02:00
#endif
2020-08-18 14:27:28 +02:00
#ifndef MAX
# define MAX(x,y) ((x)>(y)?(x):(y))
2020-08-18 14:27:28 +02:00
#endif
2020-08-18 14:27:28 +02:00
#ifndef ABS
# define ABS(a) ((a) >= 0 ? (a) : -(a))
2020-08-18 14:27:28 +02:00
#endif
#define DEBUG_MESSAGE debug_printf
#ifndef MAXLINE
# define MAXLINE 4096
#endif
2020-08-18 14:27:28 +02:00
#define FF_LJ 0
#define FF_EAM 1
#define FF_DEM 2
#if PRECISION == 1
# define PRECISION_STRING "single"
#else
# define PRECISION_STRING "double"
#endif
2020-08-18 14:27:28 +02:00
extern double myrandom(int*);
extern void random_reset(int *seed, int ibase, double *coord);
extern int str2ff(const char *string);
extern const char* ff2str(int ff);
extern int get_num_threads();
extern void readline(char *line, FILE *fp);
extern void debug_printf(const char *format, ...);
2020-08-18 14:27:28 +02:00
#endif