-
Notifications
You must be signed in to change notification settings - Fork 0
/
c_example.c
40 lines (35 loc) · 1.01 KB
/
c_example.c
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
31
32
33
34
35
36
37
38
39
40
// Copyright 2022 Zncl2222
# include <stdio.h>
# include <stdlib.h>
# include "./uc_sgsim/c_core/include/sgsim.h"
# include "./uc_sgsim/c_core/include/cov_model.h"
# if defined(__linux__) || defined(__unix__)
# define PAUSE printf("Press Enter key to continue..."); fgetc(stdin);//NOLINT
# elif _WIN32
# define PAUSE system("PAUSE");
# endif
int main() {
// you can also set z_min and z_max at sgsim_t. Default value is depends on
// sill value in cov_model_t
sgsim_t sgsim_example = {
.x_len = 150,
.realization_numbers = 5,
.randomseed = 12345,
.kriging_method = 1,
.if_alloc_memory = 1,
.iteration_limit = 10,
};
// you can also set max_negibor at cov_model_t. Defualt value is 4.
cov_model_t cov_example = {
.bw_l = 35,
.bw_s = 1,
.k_range = 17.32,
.use_cov_cache = 0,
.sill = 1,
.nugget = 0,
};
sgsim_run(&sgsim_example, &cov_example, 0);
sgsim_t_free(&sgsim_example);
PAUSE
return 0;
}