コード例 #1
0
ファイル: symbol_table.hpp プロジェクト: Ape/xboxdrv
 int put(const T& name)
 {
   int symbol = m_int2name.size();
   m_int2name.push_back(name);
   m_name2int[name] = symbol;
   return symbol;
 }
コード例 #2
0
ファイル: enum_box.hpp プロジェクト: brojudd/ubuntu
 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;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
ファイル: rtree_node.hpp プロジェクト: 1060460048/mapnik
 /**
  * \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);
             }
         }
     }
 }
コード例 #5
0
ファイル: cpd_nonrigid.hpp プロジェクト: LegendGraphics/regmm
    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);
            }
        }
    }
コード例 #6
0
    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);
            }
        }
    }