[Notes] Timer Comparision when turn influence computing on/off
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的更多相关文章
- GPU Command Buffer
For Developers > Design Documents > GPU Command Buffer This are mostly just notes on the ...
- 【原】使用SQLite打开本地*.db文件
1.下载安装文件:官网下载地址:http://www.sqlite.org/download.html32位安装包:http://www.sqlite.org/2016/sqlite-tools-wi ...
- 【Android】Sqlite3命令详解
Sqlite3常用命令 Sqlite3命令有"."符合作为前缀. 基本操作 1.创建或者打开数据库 sqlite3 xxx.db 如果xxx.db存在则打开如果没有则新建此时执行创 ...
- Python第十三天 django 1.6 导入模板 定义数据模型 访问数据库 GET和POST方法 SimpleCMDB项目 urllib模块 urllib2模块 httplib模块 django和web服务器整合 wsgi模块 gunicorn模块
Python第十三天 django 1.6 导入模板 定义数据模型 访问数据库 GET和POST方法 SimpleCMDB项目 urllib模块 urllib2模块 ...
- React 轮播图实现
接到项目, 用react和material-ui实现轮播图. 搜索了一些方法参考, 不论语言/框架的使用,大体上分为两种思路 超宽列表实现法 在原生JS或者JQuery中,轮播图的实现一般是这样子的 ...
- css3 翻转
参考资料: WEB骇客 : http://www.webhek.com/css-flip/ Demo : Demo(谷歌浏览器观看,没做兼容) Demo截图: 代码: <!DOCTYPE h ...
- [数据库]Sqlite使用入门
官网的文档结构十分恶劣,大概翻了一下,提供入门指引. 0. sqlite的安装 根据自身情况,在官网下载32位/64位的dll文件以及sqlite-tools-win32-x86-3240000.zi ...
- 如何使用 sqlite3 访问 Android 手机的数据库
如何设置Android手机的sqlite3命令环境 http://www.cnblogs.com/linjiqin/archive/2011/11/28/2266619.html SQLite3 为a ...
- sqlite3.exe 使用
1 下载sqlite3.exe 2 命令行cmd,进入到sqlite3.exe目录 3 >sqlite3.exe database.db 来打开sqlite数据库. 4 基本语法: > ...
随机推荐
- Scala学习笔记之伴生对象
所谓伴生对象, 也是一个Scala中的单例对象, 使用object关键字修饰. 除此之外, 还有一个使用class关键字定义的同名类, 这个类和单例对象存在于同一个文件中, 这个类就叫做这个单例对象的 ...
- PHP+Mysql+jQuery实现文件下载次数统计
数据表 CREATE TABLE IF NOT EXISTS `downloads` ( `id` int(6) unsigned NOT NULL AUTO_INCREMENT, `file ...
- 编写一个make
一.简介 How to make a "make"?在进行实现前,应该先对make有一个最基本的了解.这里稍作简介:当一个程序的源文件较少时,对其进行修改并重新生成可执行文件并不复 ...
- Gvim插件管理Vundle
之前关于gvim的博客中提到的很多插件安装比较繁琐,这一篇来介绍一下gvim管理插件的插件--vundle的安装以及使用,让givm的插件安装更加的简单 首先给出vundle的git地址 https: ...
- Exhange上添加IMAP4
1.登录到Exchange admim Center,选择servers,双击servers名称,选择IMAP4 2.服务器上查看任务管理器中的服务器,找到exchange imap4两个服务器是否开 ...
- 信鸽推送(XGPush)
先放入两个链接: iOS信鸽接入官方文档:http://developer.qq.com/wiki/xg/iOS接入/iOS%20SDK完整接入/iOS%20SDK完整接入.html 信鸽开放平台:h ...
- centos7安装openoffice
[摘要:间接登录openoffice民网下载硬件包,但跳转的页里却不停挨没有开.末了只能正在末端里干活下了: 1. 挑选得当的版本:http://www.openoffice.org/download ...
- Linux 常用命令 :ls命令
ls命令是linux下最常用的命令.ls命令就是list的缩写缺省下ls用来打印出当前目录的清单如果ls指定其他目录那么就会显示指定目录里的文件及文件夹清单. 通过ls 命令不仅可以查看linu ...
- [学习笔记]JS中闭包的理解
一.闭包概念的理解 闭包,又称为词法闭包或函数闭包指引用了自由变量的函数.这个被引用的自由变量将和这个函数一同存在,即使已经离开了创造它的环境也不例外. 自由变量:该变量既不是函数本身定义的也不是函数 ...
- 初学c# -- 学习笔记(三)
结合前面学的许多东西,写了一个小程序.会话.自定义滚动条.css等等.小程序没有用数据库,主要不知道该用哪种,以后再说吧.登录也简单,就输入用户名就可以了. 百度是个好东西,写程序时候,需要什么图就直 ...