Skip to content

Commit

Permalink
Rename static method DotFeatures::get_mean -> compute_mean for swig c…
Browse files Browse the repository at this point in the history
…ompatibility.
  • Loading branch information
micmn authored and vigsterkr committed Jul 6, 2017
1 parent 4063204 commit d5ab2f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/shogun/distance/MahalanobisDistance.cpp
Expand Up @@ -50,7 +50,8 @@ bool CMahalanobisDistance::init(CFeatures* l, CFeatures* r)
}
else
{
mean = ((CDenseFeatures<float64_t>*) l)->get_mean((CDotFeatures*) lhs, (CDotFeatures*) rhs);
mean = ((CDenseFeatures<float64_t>*)l)
->compute_mean((CDotFeatures*)lhs, (CDotFeatures*)rhs);
icov = CDotFeatures::compute_cov((CDotFeatures*) lhs, (CDotFeatures*) rhs);
}

Expand Down
5 changes: 3 additions & 2 deletions src/shogun/features/DotFeatures.cpp
Expand Up @@ -277,7 +277,8 @@ SGVector<float64_t> CDotFeatures::get_mean()
return mean;
}

SGVector<float64_t> CDotFeatures::get_mean(CDotFeatures* lhs, CDotFeatures* rhs)
SGVector<float64_t>
CDotFeatures::compute_mean(CDotFeatures* lhs, CDotFeatures* rhs)
{
ASSERT(lhs && rhs)
ASSERT(lhs->get_dim_feature_space() == rhs->get_dim_feature_space())
Expand Down Expand Up @@ -368,7 +369,7 @@ SGMatrix<float64_t> CDotFeatures::compute_cov(CDotFeatures* lhs, CDotFeatures* r

memset(cov.matrix, 0, sizeof(float64_t)*dim*dim);

SGVector<float64_t> mean=get_mean(lhs,rhs);
SGVector<float64_t> mean = compute_mean(lhs, rhs);

for (int i = 0; i < 2; i++)
{
Expand Down
3 changes: 2 additions & 1 deletion src/shogun/features/DotFeatures.h
Expand Up @@ -213,7 +213,8 @@ class CDotFeatures : public CFeatures
*
* @return mean returned
*/
static SGVector<float64_t> get_mean(CDotFeatures* lhs, CDotFeatures* rhs);
static SGVector<float64_t>
compute_mean(CDotFeatures* lhs, CDotFeatures* rhs);

/** get covariance
*
Expand Down

0 comments on commit d5ab2f2

Please sign in to comment.