FeatureRef StandardPcaVlatBuilder::getVlat(string & format){ FeatureRef vlat; size_t dim = getDim(format); vlat = boost::make_shared<Feature>(dim); float * data = vlat->data(); for(size_t i = 0 ; i < clusters.size(); i++){ FeatureRef subVlat = clusters[i]->getData(format); memcpy(data, subVlat->data(), subVlat->dim()*sizeof(float)); data += subVlat->dim(); if((size_t)(data - vlat->data()) > dim) retinThrowException("StandardPcaVlatCluster::getVlat => data - vlat->data() > dim"); } return vlat; }
void StandardPcaVlatCluster::add(FeatureRef feat){ add(feat->data(), feat->dim()); }