1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- /**
- * @file FeatureType.h
- * @brief dynamic selection between SparseVector and Vector
- * @author Björn Fröhlich
- * @date 02/08/2010
- */
- #ifndef FeatureTypeINCLUDE
- #define FeatureTypeINCLUDE
- #include "core/vector/SparseVectorT.h"
- #include "core/basics/Persistent.h"
- namespace OBJREC {
- //! enumeration for feature types
- enum Featuretype
- {
- VECTORFEATURE,
- SPARSEVECTORFEATURE
- };
- //! a class to differ between Vector und Sparsevector features
- class FeatureType
- {
- protected:
- //! Sparse or Vectorfeature?
- int ft;
- //! save to sv if Sparsefeatures
- NICE::SparseVector sv;
- //! save to v if vectorfeature
- NICE::Vector v;
- public:
- /**
- * constructor
- * @param f type of the faeture
- * @param dim dimension of the new feature
- */
- FeatureType(int f, int dim);
- /**
- * constructor setting SparseFeature
- * @param tsv input SparseFeature
- */
- FeatureType(NICE::SparseVector &tsv);
- /**
- * constructor setting VectorFeature
- * @param tv input VectorFeature
- */
- FeatureType(NICE::Vector &tv);
- /**
- * copy constructor
- * @param _ft
- */
- FeatureType(const FeatureType &_ft);
- void setDim(int dim);
- /**
- * get the dimension of feature
- * @return dimension of feature
- */
- int getDim() const;
- /**
- * returns adress of Vector
- * @return
- */
- const NICE::Vector& getVec() const;
- /**
- * returns adress of SparseVector
- * @return
- */
- const NICE::SparseVector& getSVec() const;
- double get(int pos) const;
- int getType();
- };
- } // namespace
- #endif
|