Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
convert get_POIM2 to user SGVector
  • Loading branch information
Soeren Sonnenburg committed Apr 17, 2012
1 parent 879ba9e commit 8436b0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
9 changes: 3 additions & 6 deletions src/shogun/kernel/WeightedDegreePositionStringKernel.cpp
Expand Up @@ -1858,13 +1858,10 @@ void CWeightedDegreePositionStringKernel::compute_POIM2(
SG_FREE(sv_idx);
}

void CWeightedDegreePositionStringKernel::get_POIM2(
float64_t** poim, int32_t* result_len)
SGMatrix<float64_t> CWeightedDegreePositionStringKernel::get_POIM2()
{
*poim=SG_MALLOC(float64_t, m_poim_result_len);
ASSERT(*poim);
memcpy(*poim, m_poim, m_poim_result_len*sizeof(float64_t)) ;
*result_len=m_poim_result_len ;
SGVector<float64_t> poim(m_poim, m_poim_result_len);
return poim;
}

void CWeightedDegreePositionStringKernel::cleanup_POIM2()
Expand Down
5 changes: 2 additions & 3 deletions src/shogun/kernel/WeightedDegreePositionStringKernel.h
Expand Up @@ -595,10 +595,9 @@ class CWeightedDegreePositionStringKernel: public CStringKernel<char>

/** get POIM2
*
* @param poim POIMs (returned)
* @param result_len (returned)
* @return poim
*/
void get_POIM2(float64_t** poim, int32_t* result_len);
SGVector<float64_t> get_POIM2();

/// cleanup POIM2
void cleanup_POIM2();
Expand Down

0 comments on commit 8436b0a

Please sign in to comment.