THGraclus.c 456 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef TH_GENERIC_FILE
#define TH_GENERIC_FILE "generic/THGraclus.c"
#else

void THTensor_(graclus)(THLongTensor *self, THLongTensor *row, THLongTensor *col, THTensor *weight) {
  real *weightData = THTensor_(data)(weight);
  real maxWeight, tmp;
  TH_TENSOR_GRACLUS(self, row, col, maxWeight = 0;,
    tmp = weightData[e];
    if (selfData[colValue] < 0 && tmp > maxWeight) { matchedValue = colValue; maxWeight = tmp; }
  )
}

#endif  // TH_GENERIC_FILE