123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- #ifndef EXAMPLEINCLUDE
- #define EXAMPLEINCLUDE
- #include "CachedExample.h"
- namespace OBJREC {
- class Example
- {
- public:
-
- double weight;
-
- CachedExample *ce;
-
- long long int x;
-
- long long int y;
-
- long long int z;
-
- int width;
-
- int height;
-
- int depth;
-
- int position;
-
- double scale;
-
- NICE::Vector *vec;
-
- NICE::SparseVector *svec;
-
- Example();
-
- Example ( CachedExample *_ce );
-
- Example ( CachedExample *ce, int x, int y, double weight = 1.0 );
-
- Example ( CachedExample *ce, int x, int y, int z, double weight = 1.0 );
-
- Example ( CachedExample *ce, int x, int y, int width, int height, double weight = 1.0 );
-
- Example ( CachedExample *ce, int x, int y, int z,
- int width, int height, int depth, double weight = 1.0 );
-
- Example ( NICE::Vector *vec, double weight = 1.0 );
-
- Example ( const Example &ex );
-
- void copy ( const Example &ex );
-
- ~Example ();
-
- void clean ();
-
- void restore ( std::istream & is, int format = 0 );
-
- void store ( std::ostream & os, int format = 0 ) const;
- };
- class Examples : public std::vector< std::pair<int, Example> >
- {
- public:
- std::string filename;
- inline int getMaxClassNo () const
- {
- int maxClassno = -1;
- for ( const_iterator i = begin(); i != end(); i++ )
- if ( i->first > maxClassno )
- maxClassno = i->first;
- return maxClassno;
- }
-
- void clean ();
-
- static bool wrapExamplesAroundFeatureMatrix(const NICE::Matrix &p_MatFeaturesColumWiseSamples, const NICE::Vector &p_VecLabels, Examples &p_Examples);
- static bool wrapExamplesAroundFeatureMatrix(const NICE::Matrix &p_MatFeaturesColumWiseSamples, const NICE::VectorT<int> &p_VecLabels, Examples &p_Examples);
- };
- }
- #endif
|