scatter.c 339 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
5
6
7
8
9
10
11
#include <TH/TH.h>

#define scatter_(NAME) TH_CONCAT_4(scatter_, NAME, _, Real)
#define check_(NAME) TH_CONCAT_4(check_, NAME, _, Real)

inline void check_inBoundaries(int idx, int size, long *free) {
  if (idx < 0 || idx >= size) { THFree(free); THError("Invalid index"); }
}

#include "generic/scatter.c"
#include "THGenerateAllTypes.h"