Skip to content

Commit

Permalink
don't use Objects in structs allocated via SG_MALLOC
Browse files Browse the repository at this point in the history
- convert SGVector to ptr*, len
  • Loading branch information
Soeren Sonnenburg committed May 6, 2012
1 parent 7754d8c commit 7d802f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/shogun/machine/KernelMachine.cpp
Expand Up @@ -25,7 +25,8 @@ struct S_THREAD_PARAM
int32_t end;

/* if non-null, start and end correspond to indices in this vector */
SGVector<index_t> indices;
index_t* indices;
index_t indices_len;
bool verbose;
};
#endif // DOXYGEN_SHOULD_SKIP_THIS
Expand Down Expand Up @@ -520,7 +521,8 @@ CLabels* CKernelMachine::apply_locked(SGVector<index_t> indices)
/* use the parameter index vector */
params.start=0;
params.end=num_inds;
params.indices=indices;
params.indices=indices.vector;
params.indices_len=indices.vlen;

params.verbose=true;
apply_helper((void*) &params);
Expand All @@ -541,7 +543,8 @@ CLabels* CKernelMachine::apply_locked(SGVector<index_t> indices)
/* use the parameter index vector */
params[t].start=t*step;
params[t].end=(t+1)*step;
params[t].indices=indices;
params[t].indices=indices.vector;
params[t].indices_len=indices.vlen;

params[t].verbose=false;
pthread_create(&threads[t], NULL, CKernelMachine::apply_helper,
Expand All @@ -554,7 +557,8 @@ CLabels* CKernelMachine::apply_locked(SGVector<index_t> indices)
/* use the parameter index vector */
params[t].start=t*step;
params[t].end=num_inds;
params[t].indices=indices;
params[t].indices=indices.vector;
params[t].indices_len=indices.vlen;

params[t].verbose=true;
apply_helper((void*) &params[t]);
Expand Down

0 comments on commit 7d802f1

Please sign in to comment.