2023-11-17 22:39:39 +01:00
|
|
|
#ifndef _LA_RANDOM_H
|
|
|
|
#define _LA_RANDOM_H
|
2023-11-17 21:57:28 +01:00
|
|
|
|
2023-12-27 23:24:13 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2023-11-17 21:57:28 +01:00
|
|
|
namespace LA {
|
|
|
|
|
2023-11-18 15:15:32 +01:00
|
|
|
extern double randdouble();
|
|
|
|
extern double randdoublesigned();
|
|
|
|
extern int randint32();
|
2023-12-27 23:24:13 +01:00
|
|
|
extern uint64_t randint64();
|
2023-11-18 15:15:32 +01:00
|
|
|
|
2023-11-17 21:57:28 +01:00
|
|
|
//RANDOM numbers defaulting to standard library but switchable to user's functions
|
|
|
|
#ifndef RANDDOUBLE
|
2023-11-18 15:15:32 +01:00
|
|
|
#define RANDDOUBLE LA::randdouble
|
2023-11-17 21:57:28 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RANDDOUBLESIGNED
|
2023-11-18 15:15:32 +01:00
|
|
|
#define RANDDOUBLESIGNED LA::randdoublesigned
|
2023-11-17 21:57:28 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RANDINT32
|
2023-11-18 15:15:32 +01:00
|
|
|
#define RANDINT32 LA::randint32
|
2023-11-17 21:57:28 +01:00
|
|
|
#endif
|
|
|
|
|
2023-12-27 23:24:13 +01:00
|
|
|
#ifndef RANDINT64
|
|
|
|
#define RANDINT64 LA::randint64
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2023-11-17 21:57:28 +01:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define WEAK_SYMBOL __attribute__((weak))
|
|
|
|
#else
|
|
|
|
#define WEAK_SYMBOL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}//namespace
|
|
|
|
|
|
|
|
#endif
|