| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <stddef.h> |
| 4 |
#include <util/api.h> |
| 5 |
#include <util/bitarray.h> |
| 6 |
|
| 7 |
#ifdef __cplusplus |
| 8 |
extern "C" { |
| 9 |
#endif |
| 10 |
|
| 11 |
typedef struct { |
| 12 |
int i, j; |
| 13 |
float d, w; |
| 14 |
} term_sgd; |
| 15 |
|
| 16 |
typedef struct graph_sgd { |
| 17 |
size_t n; // number of nodes |
| 18 |
size_t *sources; // index of first edge in *targets for each node (length n+1) |
| 19 |
bitarray_t pinneds; // whether a node is fixed or not |
| 20 |
|
| 21 |
size_t *targets; // index of targets for each node (length sources[n]) |
| 22 |
float *weights; // weights of edges (length sources[n]) |
| 23 |
} graph_sgd; |
| 24 |
|
| 25 |
PRIVATE void sgd(graph_t *, int); |
| 26 |
|
| 27 |
#ifdef __cplusplus |
| 28 |
} |
| 29 |
#endif |