Browse Source

removed redundant class VectorFeature

Johannes Ruehle 11 years ago
parent
commit
4049b6e2b0
2 changed files with 0 additions and 156 deletions
  1. 0 62
      features/fpfeatures/VectorFeature.cpp
  2. 0 94
      features/fpfeatures/VectorFeature.h

+ 0 - 62
features/fpfeatures/VectorFeature.cpp

@@ -1,62 +0,0 @@
-#include <iostream>
-
-#include "VectorFeature.h"
-#include "vislearning/cbaselib/FeaturePool.h"
-
-using namespace OBJREC;
-
-using namespace std;
-// refactor-nice.pl: check this substitution
-// old: using namespace ice;
-using namespace NICE;
-
-/** simple destructor */
-VectorFeature::~VectorFeature()
-{
-}
-
-double VectorFeature::val( const Example *example ) const
-{
-    return example->vec->get(feature_index);
-}
-
-void VectorFeature::explode ( FeaturePool & featurePool, bool variableWindow ) const
-{
-	for ( int i = 0 ; i < dimension ; i++ )
-	{
-        VectorFeature *f = new VectorFeature ( dimension , i);
-		featurePool.addFeature(f, 1.0 / dimension);
-	}
-}
-
-Feature *VectorFeature::clone() const
-{
-    VectorFeature *f = new VectorFeature( dimension, feature_index);
-	return f;
-}
-
-Feature *VectorFeature::generateFirstParameter () const
-{
-	return clone();
-}
-
-void VectorFeature::restore (istream & is, int format)
-{
-	is >> feature_index;
-}
-
-void VectorFeature::store (ostream & os, int format) const
-{
-    os << "VECTORFEATURE "
-			<< feature_index;
-}
-
-void VectorFeature::clear ()
-{
-}
-
-void VectorFeature::getStump ( int & _feature_index, int & _dimension ) const
-{
-	_feature_index = feature_index;
-	_dimension = dimension;
-}

+ 0 - 94
features/fpfeatures/VectorFeature.h

@@ -1,94 +0,0 @@
-/** 
- * @file VectorFeature.h
- * @brief feature class to use feature raw data stored in Examples
- * @author Johannes Ruehle
- * @date 04/11/2014
-
- */
-#ifndef VectorFeatureINCLUDE
-#define VectorFeatureINCLUDE
-
-#include "vislearning/cbaselib/Feature.h"
-
-namespace OBJREC {
-
-class VectorFeature : public Feature
-{
-
-	protected:
-		//! feature dimension
-		int dimension;
-		
-		//! index of the feature
-		int feature_index;
-
-	public:
-  
-		/**
-         * internally used by VectorFeature::explode
-		 * @param _dimension new dimension
-		 * @param _feature_index new featureindex
-		 */
-        VectorFeature ( int _dimension, int _feature_index = 0 ):
-            dimension(_dimension), feature_index(_feature_index)
-        {}
-      
-		/**
-		 * simple destructor
-		 */
-        virtual ~VectorFeature();
-     
-		/**
-		 * returns the value of the sparse feature stored in example
-		 * @param example input example
-		 * @return feature value
-		 */
-		double val( const Example *example ) const;
-		
-		
-		/**
-		 * creates for each feature a own SparseVectorFeature in featurepool
-		 * @param featurePool the feature pool
-		 * @param variableWindow 
-		 */
-		void explode ( FeaturePool & featurePool, bool variableWindow = true ) const;
-		
-		
-		Feature *clone() const;
-		Feature *generateFirstParameter () const;
-
-		/**
-		 * store the data
-		 * @param is input stream
-		 * @param format 
-		 */
-		void restore (std::istream & is, int format = 0);
-		
-		
-		/**
-		 * read the data
-		 * @param os 
-		 * @param format 
-		 */
-		void store (std::ostream & os, int format = 0) const;
-		
-		
-		/**
-		 * does nothing
-		 */
-		void clear ();
-
-		
-		/**
-		 * returns the feature index and the dimension
-		 * @param feature_index 
-		 * @param dimension 
-		 */
-		void getStump ( int & feature_index, int & dimension ) const;
-
-};
-
-
-} // namespace
-
-#endif