| 1 |
/* We used to ICE because EXPAND_SUM was being used for all recursive calls |
| 2 |
to expand_expr. */ |
| 3 |
struct TSparseEntry |
| 4 |
{ |
| 5 |
int feat_index; |
| 6 |
double entry; |
| 7 |
}; |
| 8 |
|
| 9 |
struct TSparse |
| 10 |
{ |
| 11 |
int vec_index; |
| 12 |
int num_feat_entries; |
| 13 |
struct TSparseEntry *features; |
| 14 |
}; |
| 15 |
|
| 16 |
void |
| 17 |
get_full_feature_matrix (struct TSparse* sparse_feature_matrix, int num_vec) |
| 18 |
{ |
| 19 |
double *fm; |
| 20 |
int v, f; |
| 21 |
|
| 22 |
for (v=0; v < num_vec; v++) |
| 23 |
{ |
| 24 |
for (f=0; f < sparse_feature_matrix[v].num_feat_entries; f++) |
| 25 |
{ |
| 26 |
long long offs = sparse_feature_matrix[v].vec_index |
| 27 |
+ sparse_feature_matrix[v].features[f].feat_index; |
| 28 |
fm[offs] = sparse_feature_matrix[v].features[f].entry; |
| 29 |
} |
| 30 |
} |
| 31 |
} |
| 32 |
|