小编Pre*_*rem的帖子

在rtree中的填充算法

大家好我明白,如果rtree是用boost中的范围值创建的,那么它将使用打包算法.我需要一个使用打包算法的rtree示例.这是我使用二次算法的代码

    using  point = bg::model::point < int, 2, bg::cs::cartesian >;
    using  pointI = std::pair<point, std::size_t>;
 vector<point> contourCenters // has some value
bgi::rtree< pointI, bgi::quadratic<16> > rtree;
vector< pointI > cloud;

for (size_t i = 0; i < contourCenters.size(); ++i)
{
    int x = contourCenters[i].get < 0 >();
    int y = contourCenters[i].get < 1 >();

    cout << "Contour Centers: (" << x << "," << y << ")";
    cloud.push_back(mp(x, y, i));
    rtree.insert(make_pair(contourCenters[i], i));
}
Run Code Online (Sandbox Code Playgroud)

我想用打包算法创建rtree,因为它似乎是boost中最快的.请指导我如何在boost中使用打包算法创建rtree.

c++ algorithm boost packing

11
推荐指数
1
解决办法
2554
查看次数

If statement is not evaluated consistently

Here is the code snippet I have deployed in copy-acct-to-home-server. Which basically checks if the username has "@" sign... if yes then it extracts huntgroup from mysql table comparing NAS-IP-Address. And finally if the result from the query is not null then it updates Proxy-to-Realm.

if(request:User-Name =~ /@/){
                            update control {
                                    SQLQueryResult := "%{sql:SELECT `groupname` FROM `radhuntgroup` WHERE nasipaddress='%{NAS-IP-Address}'}" }
                            if( %{control:SQLQueryResult} != '') {
                                    update control {
                                    Proxy-To-Realm := SQLQueryResult } }
                    }
Run Code Online (Sandbox Code Playgroud)

This code is not working as …

freeradius

6
推荐指数
1
解决办法
161
查看次数

标签 统计

algorithm ×1

boost ×1

c++ ×1

freeradius ×1

packing ×1