Overall algorithm – bunny

关闭influence计算                                                             打开influence计算

Timer 插入位置:

FFAnalyzer::SeqPrint()

{

………

for (int l = 0; l < layer_size; l++)
{
    /*
    * Nl: number of dual verts in current layer
    * h : head for printing queue of the layer
    * t : tail for printing queue of the layer
    */
    layer_search.Reset();
    layer_search.Start();

int Nl = layers_[l].size();
    int h = print_queue_.size();
    int t;
    if (l == 0)
    {
        t = Nl;
    }
    else
    {
        t = h + Nl;
    }

if (h == t)
    {
        continue;
    }

/* max_z_ and min_z_ in current layer */
    min_z_ = 1e20;
    max_z_ = -min_z_;
    for (int i = 0; i < Nl; i++)
    {
        WF_edge *e = layers_[l][i];
        point u = e->pvert_->Position();
        point v = e->ppair_->pvert_->Position();
        min_z_ = min(min_z_, (double)min(u.z(), v.z()));
        max_z_ = max(max_z_, (double)max(u.z(), v.z()));
    }

if (!GenerateSeq(l, h, t))
    {
        fprintf(stderr,
            "All possible start edge at layer %d has been tried but no feasible sequence is obtained.\n",
            l + 1
            );
        bSuccess = false;
        break;
    }

layer_search.Stop();
   
    string str = std::to_string(l) + ":";
    const char *msg = str.c_str();
    char* cstr = new char[str.length() + 1];
    strcpy(cstr, msg);

layer_search.Print(cstr);
    printf("layer size: %d\n", Nl);
    printf("layer %d finished\n", l);
    printf("--------------\n");
}

……..

}

bool FFAnalyzer::GenerateSeq(int l, int h, int t)
{
    Timer ind_search;

ind_search.Reset();
    ind_search.Start();

/* last edge */
    assert(h != 0);                        // there must be pillars
    WF_edge *ei = print_queue_[h - 1];

if (debug_)
    {
        fprintf(stderr, "-----------------------------------\n");
        fprintf(stderr, "Searching edge #%d in layer %d, head %d, tail %d\n",
            ei->ID() / 2, l + 1, h, t);
    }

/* exit */
    if (h == t)
    {
        return true;
    }

/* next choice */
    multimap<double, WF_edge*> choice;
    multimap<double, WF_edge*>::iterator it;

/* next edge in current layer */
    int Nl = layers_[l].size();

for (int j = 0; j < Nl; j++)
    {
        WF_edge *ej = layers_[l][j];
        /* cost weight */
        double cost = GenerateCost(ei, ej);
        if (cost != -1)
        {
            choice.insert(pair<double, WF_edge*>(cost, ej));
        }
    }

ind_search.Stop();
    ind_search.Print("Single strut: ");

/* ranked by weight */
    for (it = choice.begin(); it != choice.end(); it++)
    {
        WF_edge *ej = it->second;
        print_queue_.push_back(ej);

/* update printed subgraph */
        UpdateStructure(ej);

/* update collision */
        vector<vector<lld>> tmp_angle(3);
        UpdateStateMap(ej, tmp_angle);

if (debug_)
        {
            fprintf(stderr, "Choose edge #%d in with cost %lf\n\n", ej->ID() / 2, it->first);
        }

if (GenerateSeq(l, h + 1, t))
        {
            return true;
        }

RecoverStateMap(ej, tmp_angle);
        RecoverStructure(ej);
        print_queue_.pop_back();
    }

return false;
}

[Notes] Timer Comparision when turn influence computing on/off的更多相关文章

  1. GPU Command Buffer

    For Developers‎ > ‎Design Documents‎ > ‎ GPU Command Buffer This are mostly just notes on the ...

  2. 【原】使用SQLite打开本地*.db文件

    1.下载安装文件:官网下载地址:http://www.sqlite.org/download.html32位安装包:http://www.sqlite.org/2016/sqlite-tools-wi ...

  3. 【Android】Sqlite3命令详解

    Sqlite3常用命令 Sqlite3命令有"."符合作为前缀. 基本操作 1.创建或者打开数据库 sqlite3 xxx.db 如果xxx.db存在则打开如果没有则新建此时执行创 ...

  4. Python第十三天 django 1.6 导入模板 定义数据模型 访问数据库 GET和POST方法 SimpleCMDB项目 urllib模块 urllib2模块 httplib模块 django和web服务器整合 wsgi模块 gunicorn模块

    Python第十三天   django 1.6   导入模板   定义数据模型   访问数据库   GET和POST方法    SimpleCMDB项目   urllib模块   urllib2模块 ...

  5. React 轮播图实现

    接到项目, 用react和material-ui实现轮播图. 搜索了一些方法参考, 不论语言/框架的使用,大体上分为两种思路 超宽列表实现法 在原生JS或者JQuery中,轮播图的实现一般是这样子的 ...

  6. css3 翻转

    参考资料: WEB骇客  :  http://www.webhek.com/css-flip/ Demo : Demo(谷歌浏览器观看,没做兼容) Demo截图: 代码: <!DOCTYPE h ...

  7. [数据库]Sqlite使用入门

    官网的文档结构十分恶劣,大概翻了一下,提供入门指引. 0. sqlite的安装 根据自身情况,在官网下载32位/64位的dll文件以及sqlite-tools-win32-x86-3240000.zi ...

  8. 如何使用 sqlite3 访问 Android 手机的数据库

    如何设置Android手机的sqlite3命令环境 http://www.cnblogs.com/linjiqin/archive/2011/11/28/2266619.html SQLite3 为a ...

  9. sqlite3.exe 使用

    1 下载sqlite3.exe 2 命令行cmd,进入到sqlite3.exe目录 3 >sqlite3.exe database.db   来打开sqlite数据库. 4 基本语法: > ...

随机推荐

  1. 记录在windows7上安装MongoDB

    1.首先下载   官网地址  https://www.mongodb.com/download-center#community 选择 Windows Vista 32-bit, without SS ...

  2. 让ztree树默认是关闭的

    只需要在ztree的回调函数中加 var treeObj = $.fn.zTree.getZTreeObj("zTreeContent");treeObj.expandAll(tr ...

  3. MongoDB是一个介于关系数据库和非关系数据库之间的产品

    MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的.他支持的数据结构非常松散,是类似json的bjson格式,因此可以存储比较复杂的数据类型.M ...

  4. Apache ab压力测试时出现大量的错误原因分析

    最近有一个测试任务,是测试nginx的并发请求到底能够达到多少的, 于是就用ab工具对其进行压力测试. 这压力测试一执行,问题就来了:发起10000次请求,并发100,错误的情况能达到30%--50% ...

  5. CCS实现input和img水平对齐的方法

    在网页制作中,常将 input 和 img 放在同一行,img标签总是比input高出一个头,非常难看. CCS实现input和img水平对齐的方法 同时给input和img添加vertical-al ...

  6. 程序员能力矩阵 Programmer Competency Matrix

    [译文]程序员能力矩阵 Programmer Competency Matrix [译文]程序员能力矩阵 Programmer Competency Matrix 注意:每个层次的知识都是渐增的,位于 ...

  7. Nginx ssl证书部署

    查看当前安装的OpenSSL版本所支持的密码列表,可以使用下列命令:openssl ciphers 苹果ATS检测:https://www.qcloud.com/product/ssl 刚开始&quo ...

  8. MarkDown初体验

    初体验 写在前面 一周前第一次听说了MarkDown这个编辑器,通过它知道了LaTex,正好满足了我多年对网上博客里的公式简陋的表达的需求.起初,只是用到了LaTex公式这一个功能 , 对于主要文字的 ...

  9. 传输层(2)-TCP连接的建立和终止、TIME_WAIT状态

    1.TCP连接的建立和终止 1)三路握手 客户端发送一个SYN(同步)分解,告诉服务器客户将在连接中发送的数据的初始序列号. 服务器发送确认客户的SYN(ACK),同时自己也得发送一个SYN分节,它含 ...

  10. Windows 下针对python脚本做一个简单的进程保护

    前提: 大家运行的脚本程序经常会碰到系统异常关闭.或被其他用户错杀的情况.这样就需要一个进程保护的工具. 本文结合windows 的计划任务,实现一个简单的进程保护的功能. 利用py2exe生产 ex ...