Skip to content

Commit

Permalink
no longer copy subset index
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed May 6, 2012
1 parent 3bc5f3e commit 8264e5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/shogun/features/Subset.cpp
Expand Up @@ -22,11 +22,7 @@ CSubset::CSubset(SGVector<index_t> subset_idx)
{
init();

/* copy indices. TODO this is not needed once there is ref-counting for
* SGVectors */
m_subset_idx=SGVector<index_t>(subset_idx.vlen);
memcpy(m_subset_idx.vector, subset_idx.vector,
subset_idx.vlen*sizeof(index_t));
m_subset_idx=subset_idx;
}

CSubset::~CSubset() {
Expand Down
6 changes: 2 additions & 4 deletions src/shogun/features/Subset.h
Expand Up @@ -17,10 +17,7 @@
namespace shogun
{

/** @brief Wrapper class for an index subset which is used by SubsetStack.
* Currently, all index sets that are given to a CSubset instance are COPIED.
* This is bad because these should be re-usable, however, until there is no
* reference counting for SGVectors, this wont be possible. TODO */
/** @brief Wrapper class for an index subset which is used by SubsetStack. */
class CSubset: public CSGObject
{
friend class CSubsetStack;
Expand All @@ -45,6 +42,7 @@ class CSubset: public CSGObject

/** @return name of the SGSerializable */
inline const char* get_name() const { return "Subset"; }

private:
void init();

Expand Down

0 comments on commit 8264e5c

Please sign in to comment.