SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DenseDistance.cpp
Go to the documentation of this file.
2 
3 namespace shogun {
4 
5 template <class ST> bool CDenseDistance<ST>::init(CFeatures* l, CFeatures* r)
6 {
7  CDistance::init(l,r);
8 
11  ASSERT(l->get_feature_type()==this->get_feature_type())
12  ASSERT(r->get_feature_type()==this->get_feature_type())
13 
14 
15  if ( ((CDenseFeatures<ST>*) l)->get_num_features() != ((CDenseFeatures<ST>*) r)->get_num_features() )
16  {
17  SG_ERROR("train or test features #dimension mismatch (l:%d vs. r:%d)\n",
18  ((CDenseFeatures<ST>*) l)->get_num_features(),((CDenseFeatures<ST>*) r)->get_num_features());
19  }
20 
21  return true;
22 }
23 
29 
35 
41 
47 
53 
59 
65 
66 template class CDenseDistance<char>;
67 template class CDenseDistance<uint8_t>;
68 template class CDenseDistance<int16_t>;
69 template class CDenseDistance<uint16_t>;
70 template class CDenseDistance<int32_t>;
71 template class CDenseDistance<uint64_t>;
72 template class CDenseDistance<float64_t>;
73 }
virtual EFeatureType get_feature_type()
The class DenseFeatures implements dense feature matrices.
Definition: LDA.h:41
#define SG_ERROR(...)
Definition: SGIO.h:129
#define ASSERT(x)
Definition: SGIO.h:201
virtual EFeatureClass get_feature_class() const =0
EFeatureType
shogun feature type
Definition: FeatureTypes.h:19
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
template class DenseDistance
Definition: DenseDistance.h:24
virtual EFeatureType get_feature_type() const =0

SHOGUN Machine Learning Toolbox - Documentation