本文整理汇总了C++中Energy::SetFullEdges方法的典型用法代码示例。如果您正苦于以下问题:C++ Energy::SetFullEdges方法的具体用法?C++ Energy::SetFullEdges怎么用?C++ Energy::SetFullEdges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Energy
的用法示例。
在下文中一共展示了Energy::SetFullEdges方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
if (0)
{
Energy* g = ReadUAI("../grid4x4.UAI.LG");
g->SetFullEdges(1);
Energy::Options options;
options.method = Energy::Options::MPLP;
options.iter_max = 100;
g->Solve(options);
exit(1);
}
int i;
char* filename = NULL;
char* save_filename = NULL;
char* save_rep_filename = NULL;
bool BLP_relaxation = false;
bool FULL_relaxation = false;
bool FULLDUAL_relaxation = false;
int FULL_relaxation_flag = 0;
int FULLDUAL_relaxation_flag = 0;
bool print_stats = false;
Run* current = new Run;
Block<Run*> run_list(10);
Run** run_ptr = run_list.New();
*run_ptr = current;
for (i=1; i<argc; i++)
{
if (argv[i][0] == '+' && !argv[i][1])
{
current = new Run;
run_ptr = run_list.New();
*run_ptr = current;
continue;
}
if (argv[i][0] != '-')
{
if (filename) { printf("Error: filename can be specified only once\n"); ShowUsage(argv[0]); }
filename = argv[i];
continue;
}
if (!strcmp("h", &argv[i][1]))
{
ShowUsage(argv[0], true);
}
if (!strncmp("save=", &argv[i][1], 5))
{
if (save_filename) { printf("Error: save filename can be specified only once\n"); ShowUsage(argv[0]); }
save_filename = &argv[i][1+5];
continue;
}
if (!strncmp("saverep=", &argv[i][1], 8))
{
if (save_filename) { printf("Error: save filename can be specified only once\n"); ShowUsage(argv[0]); }
save_rep_filename = &argv[i][1+8];
continue;
}
if (!strncmp("t=", &argv[i][1], 2))
{
if (current->tighten_filename) { printf("Error: tightening filename can be specified only once\n"); ShowUsage(argv[0]); }
current->tighten_filename = &argv[i][1+2];
continue;
}
if (!strncmp("iter=", &argv[i][1], 5))
{
current->options.iter_max = atoi(&argv[i][1+5]);
continue;
}
if (!strncmp("time=", &argv[i][1], 5))
{
current->options.time_max = atof(&argv[i][1+5]);
continue;
}
if (!strncmp("eps=", &argv[i][1], 4))
{
current->options.eps = atof(&argv[i][1+4]);
continue;
}
if (!strcmp("SRMP", &argv[i][1]))
{
current->options.method = Energy::Options::SRMP;
continue;
}
if (!strcmp("CMP", &argv[i][1]))
{
current->options.method = Energy::Options::CMP;
continue;
}
if (!strcmp("MPLP", &argv[i][1]))
{
current->options.method = Energy::Options::MPLP;
continue;
}
//.........这里部分代码省略.........