Skip to content

Commit

Permalink
Merge pull request #519 from vigsterkr/master
Browse files Browse the repository at this point in the history
HKM: fix warning and pass vector by reference
  • Loading branch information
Soeren Sonnenburg committed May 10, 2012
2 parents c019459 + b4815de commit 904ebab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/shogun/preprocessor/HomogeneousKernelMap.cpp
Expand Up @@ -182,10 +182,7 @@ SGMatrix<float64_t> CHomogeneousKernelMap::apply_to_feature_matrix (CFeatures* f
/// apply preproc on single feature vector
SGVector<float64_t> CHomogeneousKernelMap::apply_to_feature_vector(SGVector<float64_t> vector)
{
uint64_t featureDimension = 2*m_order+1;
uint64_t m_target_dim = vector.vlen * featureDimension;
SGVector<float64_t> result = apply_to_vector(vector);

return result;
}

Expand Down Expand Up @@ -298,7 +295,7 @@ CHomogeneousKernelMap::get_smooth_spectrum (float64_t omega) const
return kappa_hat;
}

SGVector<float64_t> CHomogeneousKernelMap::apply_to_vector(SGVector<float64_t> in_v) const
SGVector<float64_t> CHomogeneousKernelMap::apply_to_vector(const SGVector<float64_t>& in_v) const
{
/* assert for in vector */
ASSERT (in_v.vlen > 0);
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/preprocessor/HomogeneousKernelMap.h
Expand Up @@ -144,7 +144,7 @@ namespace shogun
inline float64_t get_smooth_spectrum (float64_t omega) const;
inline float64_t sinc (float64_t x) const;
inline float64_t get_spectrum (float64_t omega) const;
SGVector<float64_t> apply_to_vector(SGVector<float64_t> in_v) const;
SGVector<float64_t> apply_to_vector(const SGVector<float64_t>& in_v) const;

private:
HomogeneousKernelType m_kernel;
Expand Down

0 comments on commit 904ebab

Please sign in to comment.