SHOGUN
v3.2.0
|
00001 #include <shogun/distance/DenseDistance.h> 00002 00003 namespace shogun { 00004 00005 template <class ST> bool CDenseDistance<ST>::init(CFeatures* l, CFeatures* r) 00006 { 00007 CDistance::init(l,r); 00008 00009 ASSERT(l->get_feature_class()==C_DENSE) 00010 ASSERT(r->get_feature_class()==C_DENSE) 00011 ASSERT(l->get_feature_type()==this->get_feature_type()) 00012 ASSERT(r->get_feature_type()==this->get_feature_type()) 00013 00014 00015 if ( ((CDenseFeatures<ST>*) l)->get_num_features() != ((CDenseFeatures<ST>*) r)->get_num_features() ) 00016 { 00017 SG_ERROR("train or test features #dimension mismatch (l:%d vs. r:%d)\n", 00018 ((CDenseFeatures<ST>*) l)->get_num_features(),((CDenseFeatures<ST>*) r)->get_num_features()); 00019 } 00020 00021 return true; 00022 } 00023 00028 template<> EFeatureType CDenseDistance<float64_t>::get_feature_type() { return F_DREAL; } 00029 00034 template<> EFeatureType CDenseDistance<uint64_t>::get_feature_type() { return F_ULONG; } 00035 00040 template<> EFeatureType CDenseDistance<int32_t>::get_feature_type() { return F_INT; } 00041 00046 template<> EFeatureType CDenseDistance<uint16_t>::get_feature_type() { return F_WORD; } 00047 00052 template<> EFeatureType CDenseDistance<int16_t>::get_feature_type() { return F_SHORT; } 00053 00058 template<> EFeatureType CDenseDistance<uint8_t>::get_feature_type() { return F_BYTE; } 00059 00064 template<> EFeatureType CDenseDistance<char>::get_feature_type() { return F_CHAR; } 00065 00066 template class CDenseDistance<char>; 00067 template class CDenseDistance<uint8_t>; 00068 template class CDenseDistance<int16_t>; 00069 template class CDenseDistance<uint16_t>; 00070 template class CDenseDistance<int32_t>; 00071 template class CDenseDistance<uint64_t>; 00072 template class CDenseDistance<float64_t>; 00073 }