| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef NUBASIS_H |
| 22 |
#define NUBASIS_H |
| 23 |
|
| 24 |
#include "nugrid.h" |
| 25 |
|
| 26 |
|
| 27 |
typedef struct |
| 28 |
{ |
| 29 |
NUgrid* restrict grid; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
double* restrict xVals; |
| 34 |
|
| 35 |
double* restrict dxInv; |
| 36 |
bool periodic; |
| 37 |
} NUBasis; |
| 38 |
|
| 39 |
|
| 40 |
#ifdef __cplusplus |
| 41 |
extern "C" { |
| 42 |
#endif |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
NUBasis* |
| 48 |
create_NUBasis (NUgrid *grid, bool periodic); |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
void |
| 54 |
destroy_NUBasis (NUBasis *basis); |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
int |
| 61 |
get_NUBasis_funcs_s (NUBasis* restrict basis, double x, |
| 62 |
float bfuncs[4]); |
| 63 |
void |
| 64 |
get_NUBasis_funcs_si (NUBasis* restrict basis, int i, |
| 65 |
float bfuncs[4]); |
| 66 |
|
| 67 |
int |
| 68 |
get_NUBasis_dfuncs_s (NUBasis* restrict basis, double x, |
| 69 |
float bfuncs[4], float dbfuncs[4]); |
| 70 |
void |
| 71 |
get_NUBasis_dfuncs_si (NUBasis* restrict basis, int i, |
| 72 |
float bfuncs[4], float dbfuncs[4]); |
| 73 |
|
| 74 |
int |
| 75 |
get_NUBasis_d2funcs_s (NUBasis* restrict basis, double x, |
| 76 |
float bfuncs[4], float dbfuncs[4], float d2bfuncs[4]); |
| 77 |
void |
| 78 |
get_NUBasis_d2funcs_si (NUBasis* restrict basis, int i, |
| 79 |
float bfuncs[4], float dbfuncs[4], float d2bfuncs[4]); |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
int |
| 85 |
get_NUBasis_funcs_d (NUBasis* restrict basis, double x, |
| 86 |
double bfuncs[4]); |
| 87 |
void |
| 88 |
get_NUBasis_funcs_di (NUBasis* restrict basis, int i, |
| 89 |
double bfuncs[4]); |
| 90 |
int |
| 91 |
get_NUBasis_dfuncs_d (NUBasis* restrict basis, double x, |
| 92 |
double bfuncs[4], double dbfuncs[4]); |
| 93 |
void |
| 94 |
get_NUBasis_dfuncs_di (NUBasis* restrict basis, int i, |
| 95 |
double bfuncs[4], double dbfuncs[4]); |
| 96 |
int |
| 97 |
get_NUBasis_d2funcs_d (NUBasis* restrict basis, double x, |
| 98 |
double bfuncs[4], double dbfuncs[4], |
| 99 |
double d2bfuncs[4]); |
| 100 |
void |
| 101 |
get_NUBasis_d2funcs_di (NUBasis* restrict basis, int i, |
| 102 |
double bfuncs[4], double dbfuncs[4], |
| 103 |
double d2bfuncs[4]); |
| 104 |
#ifdef __cplusplus |
| 105 |
} |
| 106 |
#endif |
| 107 |
|
| 108 |
#ifdef HAVE_SSE2 |
| 109 |
#include <xmmintrin.h> |
| 110 |
#include <emmintrin.h> |
| 111 |
|
| 112 |
#ifdef __cplusplus |
| 113 |
extern "C" { |
| 114 |
#endif |
| 115 |
int |
| 116 |
get_NUBasis_funcs_sse_s (NUBasis* restrict basis, double x, |
| 117 |
__m128 *restrict funcs); |
| 118 |
int |
| 119 |
get_NUBasis_dfuncs_sse_s (NUBasis* restrict basis, double x, |
| 120 |
__m128 *restrict funcs, __m128 *restrict dfuncs); |
| 121 |
int |
| 122 |
get_NUBasis_d2funcs_sse_s (NUBasis* restrict basis, double x, |
| 123 |
__m128 *restrict funcs, |
| 124 |
__m128 *restrict dfuncs, |
| 125 |
__m128 *restrict d2funcs); |
| 126 |
|
| 127 |
int |
| 128 |
get_NUBasis_funcs_sse_d (NUBasis* restrict basis, double x, |
| 129 |
__m128d *restrict f01, __m128d *restrict f23); |
| 130 |
int |
| 131 |
get_NUBasis_dfuncs_sse_d (NUBasis* restrict basis, double x, |
| 132 |
__m128d *restrict f01, __m128d *restrict f23, |
| 133 |
__m128d *restrict df01, __m128d *restrict df23); |
| 134 |
int |
| 135 |
get_NUBasis_d2funcs_sse_d (NUBasis* restrict basis, double x, |
| 136 |
__m128d *restrict f01, __m128d *restrict f23, |
| 137 |
__m128d *restrict df01, __m128d *restrict df23, |
| 138 |
__m128d *restrict d2f01, __m128d *restrict d2f23); |
| 139 |
#ifdef __cplusplus |
| 140 |
} |
| 141 |
#endif |
| 142 |
#endif |
| 143 |
|
| 144 |
#endif |