int put(const T& name) { int symbol = m_int2name.size(); m_int2name.push_back(name); m_name2int[name] = symbol; return symbol; }
std::vector<std::string> get_names() const { typename std::vector<std::string> lst; for(const_iterator i = begin(); i != end(); ++i) { lst.push_back(i->second); } return lst; }
std::vector<T> getCallbacks() { typename std::vector<T> result; result.reserve(functionList.size() - invalidIndexCount); for (typename TypedFunctionPointerWrapperRefVector<T>::type::iterator it = functionList.begin(); it != functionList.end(); it++) { if (*it) { result.push_back((*it)->callback); } } return result; }
/** * \brief Return in 'result' all the leaves inside 'box' */ void find_leaves(Box const& box, typename std::vector<node_pointer>& result) const { for (typename node_map::const_iterator it = m_nodes.begin(); it != m_nodes.end(); ++it) { if (is_overlapping(it->first, box)) { if (it->second->is_leaf()) { result.push_back(it->second); } else { it->second->find_leaves(box, result); } } } }
void CPDNRigid<Scalar, Dim>::correspondences() { this->corres_.setZero(this->M_, this->N_); for (size_t n = 0; n < this->N_; n ++) { typename std::vector<Scalar> t_exp; Scalar sum_exp = 0; Scalar c = pow((2*M_PI*paras_.sigma2_), 0.5*Dim) * (this->w_/(1-this->w_)) * (Scalar(this->M_)/this->N_); for (size_t m = 0; m < this->M_; m ++) { Scalar m_exp = computeGaussianExp(m, n); t_exp.push_back(m_exp); sum_exp += m_exp; } for (size_t m = 0; m < this->M_; m ++) { this->corres_(m, n) = t_exp.at(m) / (sum_exp + c); } } }
void CPDRigid<T, D>::correspondences() { _corres.setZero(_M, _N); for (size_t n = 0; n < _N; n ++) { typename std::vector<T> t_exp; T sum_exp = 0; T c = pow((2*M_PI*_paras._sigma2), 0.5*D) * (_w/(1-_w)) * (T(_M)/_N); for (size_t m = 0; m < _M; m ++) { T m_exp = computeGaussianExp(m, n); t_exp.push_back(m_exp); sum_exp += m_exp; } for (size_t m = 0; m < _M; m ++) { _corres(m, n) = t_exp.at(m) / (sum_exp + c); } } }