maxflow.h

来自「这是一个用于立体匹配的程序。 可以用来进行立体匹配!」· C头文件 代码 · 共 38 行

H
38
字号
#ifndef __MAXFLOW_H__
#define __MAXFLOW_H__


typedef long flowtype;

struct Edge
{
	long		from;
	long		to;
	long		cap;
};

#define BLOCK_SIZE 512

struct EdgeList
{
	struct Edge edge[BLOCK_SIZE];
	struct EdgeList *next;
	int    num;
};

struct Graph
{
	long		node_min, node_max;
	long		m;
	long		source;
	long		sink;
	struct EdgeList	*first;
	struct EdgeList *current;
};

struct Graph * init_graph(long source, long sink);
void add_edge(struct Graph *graph, long from, long to, long cap);
flowtype maxflow(struct Graph *graph, int *cut);

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?