summaryrefslogtreecommitdiff
path: root/src/corr_test.c
blob: e0de2d8212007c8adf0e54b9e8457018a43c5083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

#include "fracture.h"

int main() {
	cholmod_common c;
	CHOL_F(start)(&c);

	unsigned int width = 64;
	unsigned int n = pow(width / 2 + 1, 2) + pow((width + 1) / 2, 2);

	graph_t *network = ini_square_network(width, true, false, &c);
	net_t *instance = create_instance(network, 1e-14, true, true, &c);
	double *fuse_thres = gen_fuse_thres(network->ne, network->edge_coords,
																			0.001, beta_scaling_flat);
	fracture_network(instance, fuse_thres, &c, 1e-10);

	double *corr = get_corr(instance, NULL, &c);

	for (int i = 0; i < 2 * width; i++) {
		printf("%f ", corr[i]);
	}
	printf("\n");

	free_instance(instance, &c);
	free_net(network, &c);

	CHOL_F(finish)(&c);

	return 0;
}