forked from richloft/RBF-FD-Prototype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreorder_nodes.h
23 lines (14 loc) · 960 Bytes
/
reorder_nodes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef _REORDER_NODES_H_
#define _REORDER_NODES_H_
#include <floating_types.h>
// reorders any one dimensional floating point array according to a one-to-one mapping
fType* reorder_1D_fp_arr(fType* var, int* mapping, int dim);
// reorders any one dimensional integer array according to a one-to-one mapping
int* reorder_1D_int_arr(int* var, int* mapping, int dim);
// reorders any two dimensional floating point array [dim1][dim2] where dim2 is padded to length dim1_stride
// to the new mapping (1D mapping must correspond to dim1, the slowest growing dimension)
fType* reorder_2D_fp_arr(fType* var, int* mapping, int dim1, int dim1_stride, int dim2_count);
// reorders any two dimensional integer array [dim1][dim2] where dim2 is padded to length dim1_stride
// to the new mapping (1D mapping must correspond to dim1, the slowest growing dimension)
int* reorder_2D_int_arr(int* var, int* mapping, int dim1, int dim1_stride, int dim2_count);
#endif