Skip to content

Commit

Permalink
Merge branch 'toCheckin'
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf committed Jun 20, 2011
2 parents 6d4705c + 3e69bee commit 2eb94d6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 38 deletions.
5 changes: 0 additions & 5 deletions src/libshogun/features/Features.h
Expand Up @@ -249,11 +249,6 @@ class CFeatures : public CSGObject
return m_subset->get_subset();
}

virtual SGVector<index_t>* get_subset_copy()
{
return m_subset->get_subset_copy();
}

bool has_subset()
{
return m_subset->has_subset();
Expand Down
5 changes: 0 additions & 5 deletions src/libshogun/features/Labels.h
Expand Up @@ -257,11 +257,6 @@ class CLabels : public CSGObject
return m_subset->get_subset();
}

virtual SGVector<index_t>* get_subset_copy()
{
return m_subset->get_subset_copy();
}

bool has_subset()
{
return m_subset->has_subset();
Expand Down
15 changes: 5 additions & 10 deletions src/libshogun/features/StringFeatures.h
Expand Up @@ -2103,20 +2103,15 @@ template <class ST> class CStringFeatures : public CFeatures
/** @return object name */
inline virtual const char* get_name() const { return "StringFeatures"; }

/** sets the subset indices matrix which is afterwards used for feature access
* overrides method of superclass and adds calculations for this class
*
* @param subset_idx index matrix
* @param subset_len number of subset indices
*/
void set_subset(int32_t* subset_idx, int32_t subset_len)
bool has_subset() { return m_subset->has_subset(); }

void set_subset(SGVector<index_t> subset)
{
SGVector<index_t> subset(subset_idx, subset_len);
m_subset->set_subset(subset);
num_vectors = subset_len;
determine_maximum_string_length();
}

SGVector<index_t> get_subset() { return m_subset->get_subset(); }

/** resets the current subset indices matrix
* overrides method of superclass and adds resets properties dependend on subset as num_vectors
*/
Expand Down
12 changes: 0 additions & 12 deletions src/libshogun/features/Subset.cpp
Expand Up @@ -11,7 +11,6 @@
#include "features/Subset.h"
#include "lib/io.h"
#include "base/Parameter.h"
#include <string>

using namespace shogun;

Expand Down Expand Up @@ -42,14 +41,3 @@ void CSubset::remove_subset()
m_subset.vector=NULL;
m_subset.length=0;
}

SGVector<index_t>* CSubset::get_subset_copy()
{
SGVector<index_t>* copy=new SGVector<index_t> (
(index_t*) SG_MALLOC(m_subset.length*sizeof(index_t)),
m_subset.length);

memcpy(copy->vector, m_subset.vector, m_subset.length*sizeof(index_t));

return copy;
}
6 changes: 0 additions & 6 deletions src/libshogun/features/Subset.h
Expand Up @@ -36,12 +36,6 @@ class CSubset: public CSGObject
*/
SGVector<index_t> get_subset() { return m_subset; }

/** getter for the subset indices
*
* @return SGVector with subset indices array (copy)
*/
SGVector<index_t>* get_subset_copy();

bool has_subset() { return m_subset.vector!=NULL; }

/** setter for the subset indices. deletes any old subset vector before
Expand Down

0 comments on commit 2eb94d6

Please sign in to comment.