Skip to content

Commit

Permalink
skip swig
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurabh7 committed Jul 4, 2016
1 parent 3dc6153 commit 37868f4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/shogun/features/DenseFeatures.cpp
Expand Up @@ -636,6 +636,7 @@ CFeatures* CDenseFeatures<ST>::copy_dimension_subset(SGVector<index_t> dims)
return result;
}

#ifndef SWIG // SWIG should skip this part
template<class ST>
CFeatures* CDenseFeatures<ST>::shallow_subset_copy()
{
Expand All @@ -650,6 +651,7 @@ CFeatures* CDenseFeatures<ST>::shallow_subset_copy()

return shallow_copy_features;
}
#endif

template<class ST> ST* CDenseFeatures<ST>::compute_feature_vector(int32_t num, int32_t& len,
ST* target)
Expand Down
4 changes: 3 additions & 1 deletion src/shogun/labels/BinaryLabels.cpp
Expand Up @@ -139,6 +139,7 @@ void CBinaryLabels::scores_to_probabilities(float64_t a, float64_t b)
SG_DEBUG("leaving CBinaryLabels::scores_to_probabilities()\n")
}

#ifndef SWIG // SWIG should skip this part
CLabels* CBinaryLabels::shallow_subset_copy()
{
CLabels* shallow_copy_labels=nullptr;
Expand All @@ -151,4 +152,5 @@ CLabels* CBinaryLabels::shallow_subset_copy()
shallow_copy_labels->add_subset(m_subset_stack->get_last_subset()->get_subset_idx());

return shallow_copy_labels;
}
}
#endif
2 changes: 2 additions & 0 deletions src/shogun/labels/MulticlassLabels.cpp
Expand Up @@ -135,6 +135,7 @@ int32_t CMulticlassLabels::get_num_classes()
return unique.vlen;
}

#ifndef SWIG // SWIG should skip this part
CLabels* CMulticlassLabels::shallow_subset_copy()
{
CLabels* shallow_copy_labels=nullptr;
Expand All @@ -147,3 +148,4 @@ CLabels* CMulticlassLabels::shallow_subset_copy()

return shallow_copy_labels;
}
#endif
4 changes: 3 additions & 1 deletion src/shogun/labels/RegressionLabels.cpp
Expand Up @@ -25,6 +25,7 @@ ELabelType CRegressionLabels::get_label_type() const
return LT_REGRESSION;
}

#ifndef SWIG // SWIG should skip this part
CLabels* CRegressionLabels::shallow_subset_copy()
{
CLabels* shallow_copy_labels=nullptr;
Expand All @@ -37,4 +38,5 @@ CLabels* CRegressionLabels::shallow_subset_copy()
shallow_copy_labels->add_subset(m_subset_stack->get_last_subset()->get_subset_idx());

return shallow_copy_labels;
}
}
#endif
6 changes: 2 additions & 4 deletions tests/unit/features/DenseFeatures_unittest.cc
Expand Up @@ -126,10 +126,8 @@ TEST(DenseFeaturesTest, shallow_copy_subset_data)
index_t n=10;

SGMatrix<float64_t> data(dim, n);
for (index_t i=0; i<dim; ++i)
for (index_t j=0; j<n; ++j)
data(i,j)=CMath::random(0, n-1);

std::iota(data.data(), data.data()+data.size(), 1);

SGVector<index_t> inds(n/2);
inds.random(0, n-1);

Expand Down

0 comments on commit 37868f4

Please sign in to comment.