|
| 1 | +#ifndef PLOVER_GENERATED_prelude |
| 2 | +#define PLOVER_GENERATED_prelude |
| 3 | + |
| 4 | + |
| 5 | +#include <assert.h> |
| 6 | + |
| 7 | +#include <stdint.h> |
| 8 | +#include <stdbool.h> |
| 9 | +#include <inttypes.h> |
| 10 | +#ifndef COMMON_INT_TYPES |
| 11 | +#define COMMON_INT_TYPES |
| 12 | +/** \defgroup common_inttypes Integer types |
| 13 | + * Specified-width integer type definitions for shorter and nicer code. |
| 14 | + * |
| 15 | + * These should be used in preference to unspecified width types such as |
| 16 | + * `int` which can lead to portability issues between different platforms. |
| 17 | + * \{ */ |
| 18 | + |
| 19 | +/** Signed 8-bit integer. */ |
| 20 | +typedef int8_t s8; |
| 21 | +/** Signed 16-bit integer. */ |
| 22 | +typedef int16_t s16; |
| 23 | +/** Signed 32-bit integer. */ |
| 24 | +typedef int32_t s32; |
| 25 | +/** Signed 64-bit integer. */ |
| 26 | +typedef int64_t s64; |
| 27 | +/** Unsigned 8-bit integer. */ |
| 28 | +typedef uint8_t u8; |
| 29 | +/** Unsigned 16-bit integer. */ |
| 30 | +typedef uint16_t u16; |
| 31 | +/** Unsigned 32-bit integer. */ |
| 32 | +typedef uint32_t u32; |
| 33 | +/** Unsigned 64-bit integer. */ |
| 34 | +typedef uint64_t u64; |
| 35 | + |
| 36 | +#endif |
| 37 | + |
| 38 | +/** \} */ |
| 39 | + |
| 40 | +#include <float.h> |
| 41 | +#include <stdio.h> |
| 42 | +#include <stdlib.h> |
| 43 | +#include <math.h> |
| 44 | +int ipow(int base, int exp); |
| 45 | +double dipow(double base, int exp); |
| 46 | +double rand_uniform(void); |
| 47 | +double rand_normal (void); |
| 48 | +double norm (const s32 n, const double * v); |
| 49 | +void normalize (const s32 n, const double * v, double * result); |
| 50 | +void print_vec (const s32 n, const double * v); |
| 51 | +void print_mat (const s32 n, const s32 m, const double * A); |
| 52 | +s32 matrix_inv (const s32 n, const double * A, double * B); |
| 53 | +double det (const s32 n, const double * A); |
| 54 | + |
| 55 | + |
| 56 | +#endif /* PLOVER_GENERATED_prelude */ |
0 commit comments