Skip to content

Commit

Permalink
remove unnecessary includes from .h files
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Sep 15, 2011
1 parent 4f9566f commit a49b0f6
Show file tree
Hide file tree
Showing 19 changed files with 106 additions and 75 deletions.
1 change: 1 addition & 0 deletions src/shogun/classifier/svm/OnlineLibLinear.cpp
Expand Up @@ -11,6 +11,7 @@
*/

#include <shogun/classifier/svm/OnlineLibLinear.h>
#include <shogun/lib/Time.h>

using namespace shogun;

Expand Down
1 change: 1 addition & 0 deletions src/shogun/distance/CustomDistance.cpp
Expand Up @@ -8,6 +8,7 @@
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
*/

#include <shogun/base/Parameter.h>
#include <shogun/lib/common.h>
#include <shogun/distance/CustomDistance.h>
#include <shogun/features/Features.h>
Expand Down
1 change: 0 additions & 1 deletion src/shogun/features/Alphabet.h
Expand Up @@ -12,7 +12,6 @@
#define _CALPHABET__H__

#include <shogun/base/SGObject.h>
#include <shogun/mathematics/Math.h>
#include <shogun/lib/common.h>

namespace shogun
Expand Down
3 changes: 3 additions & 0 deletions src/shogun/features/AttributeFeatures.cpp
Expand Up @@ -11,6 +11,9 @@
#include <shogun/features/Features.h>
#include <shogun/features/AttributeFeatures.h>

#include <string.h>


using namespace shogun;

CAttributeFeatures::CAttributeFeatures()
Expand Down
2 changes: 0 additions & 2 deletions src/shogun/features/AttributeFeatures.h
Expand Up @@ -10,8 +10,6 @@
#ifndef _CATTRIBUTE_FEATURES__H__
#define _CATTRIBUTE_FEATURES__H__

#include <string.h>

#include <shogun/features/Features.h>
#include <shogun/base/DynArray.h>

Expand Down
1 change: 0 additions & 1 deletion src/shogun/features/CombinedDotFeatures.h
Expand Up @@ -16,7 +16,6 @@
#include <shogun/lib/common.h>
#include <shogun/lib/List.h>
#include <shogun/features/DotFeatures.h>
#include <shogun/features/Features.h>

namespace shogun
{
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/features/DotFeatures.cpp
Expand Up @@ -11,6 +11,8 @@
#include <shogun/features/DotFeatures.h>
#include <shogun/io/SGIO.h>
#include <shogun/lib/Signal.h>
#include <shogun/lib/Time.h>
#include <shogun/mathematics/Math.h>
#include <shogun/base/Parallel.h>
#include <shogun/base/Parameter.h>

Expand Down
2 changes: 0 additions & 2 deletions src/shogun/features/DotFeatures.h
Expand Up @@ -13,8 +13,6 @@
#define _DOTFEATURES_H___

#include <shogun/lib/common.h>
#include <shogun/lib/Time.h>
#include <shogun/mathematics/Math.h>
#include <shogun/features/Features.h>

namespace shogun
Expand Down
1 change: 1 addition & 0 deletions src/shogun/features/DummyFeatures.cpp
@@ -1,4 +1,5 @@
#include <shogun/features/DummyFeatures.h>
#include <shogun/base/Parameter.h>

using namespace shogun;

Expand Down
1 change: 0 additions & 1 deletion src/shogun/features/DummyFeatures.h
Expand Up @@ -13,7 +13,6 @@

#include <shogun/lib/common.h>
#include <shogun/features/Features.h>
#include <shogun/base/Parameter.h>

namespace shogun
{
Expand Down
50 changes: 50 additions & 0 deletions src/shogun/features/ExplicitSpecFeatures.cpp
Expand Up @@ -53,6 +53,11 @@ CExplicitSpecFeatures::~CExplicitSpecFeatures()
delete_kmer_spectrum();
}

int32_t CExplicitSpecFeatures::get_dim_feature_space() const
{
return spec_size;
}

float64_t CExplicitSpecFeatures::dot(int32_t vec_idx1, CDotFeatures* df, int32_t vec_idx2)
{
ASSERT(df);
Expand Down Expand Up @@ -144,3 +149,48 @@ CFeatures* CExplicitSpecFeatures::duplicate() const
{
return new CExplicitSpecFeatures(*this);
}



void* CExplicitSpecFeatures::get_feature_iterator(int32_t vector_index)
{
SG_NOTIMPLEMENTED;
return NULL;
}

bool CExplicitSpecFeatures::get_next_feature(int32_t& index, float64_t& value, void* iterator)
{
SG_NOTIMPLEMENTED;
return NULL;
}

void CExplicitSpecFeatures::free_feature_iterator(void* iterator)
{
SG_NOTIMPLEMENTED;
}

int32_t CExplicitSpecFeatures::get_nnz_features_for_vector(int32_t num)
{
SG_NOTIMPLEMENTED;
return 0;
}

EFeatureType CExplicitSpecFeatures::get_feature_type()
{
return F_UNKNOWN;
}

EFeatureClass CExplicitSpecFeatures::get_feature_class()
{
return C_SPEC;
}

int32_t CExplicitSpecFeatures::get_num_vectors() const
{
return num_strings;
}

int32_t CExplicitSpecFeatures::get_size()
{
return sizeof(float64_t);
}
52 changes: 11 additions & 41 deletions src/shogun/features/ExplicitSpecFeatures.h
Expand Up @@ -12,7 +12,6 @@
#define _EXPLICITSPECFEATURES_H___

#include <shogun/lib/common.h>
#include <shogun/io/SGIO.h>
#include <shogun/features/DotFeatures.h>
#include <shogun/features/StringFeatures.h>

Expand Down Expand Up @@ -56,10 +55,7 @@ class CExplicitSpecFeatures : public CDotFeatures
*
* @return dimensionality
*/
inline virtual int32_t get_dim_feature_space() const
{
return spec_size;
}
virtual int32_t get_dim_feature_space() const;

/** compute dot product between vector1 and vector2,
* appointed by their indices
Expand All @@ -86,7 +82,8 @@ class CExplicitSpecFeatures : public CDotFeatures
* @param vec2_len length of real valued vector
* @param abs_val if true add the absolute value
*/
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t* vec2, int32_t vec2_len, bool abs_val=false);
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1,
float64_t* vec2, int32_t vec2_len, bool abs_val=false);

#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** iterator for weighted spectrum features */
Expand Down Expand Up @@ -116,11 +113,7 @@ class CExplicitSpecFeatures : public CDotFeatures
* iterate over
* @return feature iterator (to be passed to get_next_feature)
*/
virtual void* get_feature_iterator(int32_t vector_index)
{
SG_NOTIMPLEMENTED;
return NULL;
}
virtual void* get_feature_iterator(int32_t vector_index);

/** iterate over the non-zero features
*
Expand All @@ -132,68 +125,45 @@ class CExplicitSpecFeatures : public CDotFeatures
* @param iterator as returned by get_first_feature
* @return true if a new non-zero feature got returned
*/
virtual bool get_next_feature(int32_t& index, float64_t& value, void* iterator)
{
SG_NOTIMPLEMENTED;
return NULL;
}
virtual bool get_next_feature(int32_t& index, float64_t& value, void* iterator);

/** clean up iterator
* call this function with the iterator returned by get_first_feature
*
* @param iterator as returned by get_first_feature
*/
virtual void free_feature_iterator(void* iterator)
{
SG_NOTIMPLEMENTED;
}
virtual void free_feature_iterator(void* iterator);

/** get number of non-zero features in vector
*
* @param num which vector
* @return number of non-zero features in vector
*/
virtual inline int32_t get_nnz_features_for_vector(int32_t num)
{
SG_NOTIMPLEMENTED;
return 0;
}
virtual int32_t get_nnz_features_for_vector(int32_t num);

/** get feature type
*
* @return templated feature type
*/
inline virtual EFeatureType get_feature_type()
{
return F_UNKNOWN;
}
virtual EFeatureType get_feature_type();

/** get feature class
*
* @return feature class
*/
inline virtual EFeatureClass get_feature_class()
{
return C_SPEC;
}
virtual EFeatureClass get_feature_class();

/** get number of strings
*
* @return number of strings
*/
inline virtual int32_t get_num_vectors() const
{
return num_strings;
}
virtual int32_t get_num_vectors() const;

/** get size of one element
*
* @return size of one element
*/
inline virtual int32_t get_size()
{
return sizeof(float64_t);
}
virtual int32_t get_size();

/** @return object name */
inline virtual const char* get_name() const { return "ExplicitSpecFeatures"; }
Expand Down
25 changes: 25 additions & 0 deletions src/shogun/features/ImplicitWeightedSpecFeatures.cpp
Expand Up @@ -245,6 +245,11 @@ CFeatures* CImplicitWeightedSpecFeatures::duplicate() const
return new CImplicitWeightedSpecFeatures(*this);
}

int32_t CImplicitWeightedSpecFeatures::get_dim_feature_space() const
{
return spec_size;
}

void* CImplicitWeightedSpecFeatures::get_feature_iterator(int32_t vector_index)
{
if (vector_index>=num_strings)
Expand Down Expand Up @@ -316,3 +321,23 @@ int32_t CImplicitWeightedSpecFeatures::get_nnz_features_for_vector(int32_t num)
nnz+=CMath::min(CMath::pow(alphabet_size,i), vlen);
return nnz;
}

EFeatureType CImplicitWeightedSpecFeatures::get_feature_type()
{
return F_UNKNOWN;
}

EFeatureClass CImplicitWeightedSpecFeatures::get_feature_class()
{
return C_WEIGHTEDSPEC;
}

int32_t CImplicitWeightedSpecFeatures::get_num_vectors() const
{
return num_strings;
}

int32_t CImplicitWeightedSpecFeatures::get_size()
{
return sizeof(float64_t);
}
28 changes: 7 additions & 21 deletions src/shogun/features/ImplicitWeightedSpecFeatures.h
Expand Up @@ -58,10 +58,7 @@ class CImplicitWeightedSpecFeatures : public CDotFeatures
*
* @return dimensionality
*/
inline virtual int32_t get_dim_feature_space() const
{
return spec_size;
}
virtual int32_t get_dim_feature_space() const;

/** compute dot product between vector1 and vector2,
* appointed by their indices
Expand All @@ -88,7 +85,8 @@ class CImplicitWeightedSpecFeatures : public CDotFeatures
* @param vec2_len length of real valued vector
* @param abs_val if true add the absolute value
*/
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t* vec2, int32_t vec2_len, bool abs_val=false);
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1,
float64_t* vec2, int32_t vec2_len, bool abs_val=false);

/** get number of non-zero features in vector
*
Expand All @@ -101,37 +99,25 @@ class CImplicitWeightedSpecFeatures : public CDotFeatures
*
* @return templated feature type
*/
inline virtual EFeatureType get_feature_type()
{
return F_UNKNOWN;
}
virtual EFeatureType get_feature_type();

/** get feature class
*
* @return feature class
*/
inline virtual EFeatureClass get_feature_class()
{
return C_WEIGHTEDSPEC;
}
virtual EFeatureClass get_feature_class();

/** get number of strings
*
* @return number of strings
*/
inline virtual int32_t get_num_vectors() const
{
return num_strings;
}
virtual int32_t get_num_vectors() const;

/** get size of one element
*
* @return size of one element
*/
inline virtual int32_t get_size()
{
return sizeof(float64_t);
}
virtual int32_t get_size();

/** set weighted degree weights
*
Expand Down
4 changes: 3 additions & 1 deletion src/shogun/features/LBPPyrDotFeatures.h
Expand Up @@ -150,7 +150,9 @@ class CLBPPyrDotFeatures : public CDotFeatures
* @param vec2_len length of vec2
* @param abs_val if true add the absolute value
*/
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t* vec2, int32_t vec2_len, bool abs_val=false);
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1,
float64_t* vec2, int32_t vec2_len, bool abs_val=false);

protected:

/** lib lbp pyr get dim
Expand Down
2 changes: 0 additions & 2 deletions src/shogun/features/Labels.h
Expand Up @@ -14,14 +14,12 @@
#define _LABELS__H__

#include <shogun/lib/common.h>
#include <shogun/io/SGIO.h>
#include <shogun/io/File.h>
#include <shogun/base/SGObject.h>
#include <shogun/features/Subset.h>

namespace shogun
{

class CFile;

/** @brief The class Labels models labels, i.e. class assignments of objects.
Expand Down
1 change: 0 additions & 1 deletion src/shogun/features/PolyFeatures.h
Expand Up @@ -241,7 +241,6 @@ class CPolyFeatures : public CDotFeatures

/** Register all parameters */
void register_parameters();

};
}
#endif // _POLYFEATURES__H__

0 comments on commit a49b0f6

Please sign in to comment.