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