IR2Vec
Loading...
Searching...
No Matches
Setting.h
1#ifndef SETTING_H
2#define SETTING_H
3#define INT long
4#define REAL float
5#include <cstdio>
6#include <cstring>
7#include <string>
8
9std::string inPath = "../data/FB15K/";
10std::string outPath = "../data/FB15K/";
11std::string ent_file = "";
12std::string rel_file = "";
13std::string train_file = "";
14std::string valid_file = "";
15std::string test_file = "";
16
17extern "C" void setInPath(char *path) {
18 INT len = strlen(path);
19 inPath = "";
20 for (INT i = 0; i < len; i++)
21 inPath = inPath + path[i];
22 printf("Input Files Path : %s\n", inPath.c_str());
23}
24
25extern "C" void setOutPath(char *path) {
26 INT len = strlen(path);
27 outPath = "";
28 for (INT i = 0; i < len; i++)
29 outPath = outPath + path[i];
30 printf("Output Files Path : %s\n", outPath.c_str());
31}
32
33extern "C" void setTrainPath(char *path) {
34 INT len = strlen(path);
35 train_file = "";
36 for (INT i = 0; i < len; i++)
37 train_file = train_file + path[i];
38 printf("Training Files Path : %s\n", train_file.c_str());
39}
40
41extern "C" void setValidPath(char *path) {
42 INT len = strlen(path);
43 valid_file = "";
44 for (INT i = 0; i < len; i++)
45 valid_file = valid_file + path[i];
46 printf("Valid Files Path : %s\n", valid_file.c_str());
47}
48
49extern "C" void setTestPath(char *path) {
50 INT len = strlen(path);
51 test_file = "";
52 for (INT i = 0; i < len; i++)
53 test_file = test_file + path[i];
54 printf("Test Files Path : %s\n", test_file.c_str());
55}
56
57extern "C" void setEntPath(char *path) {
58 INT len = strlen(path);
59 ent_file = "";
60 for (INT i = 0; i < len; i++)
61 ent_file = ent_file + path[i];
62 printf("Entity Files Path : %s\n", ent_file.c_str());
63}
64
65extern "C" void setRelPath(char *path) {
66 INT len = strlen(path);
67 rel_file = "";
68 for (INT i = 0; i < len; i++)
69 rel_file = rel_file + path[i];
70 printf("Relation Files Path : %s\n", rel_file.c_str());
71}
72
73/*
74============================================================
75*/
76
77INT workThreads = 1;
78
79extern "C" void setWorkThreads(INT threads) { workThreads = threads; }
80
81extern "C" INT getWorkThreads() { return workThreads; }
82
83/*
84============================================================
85*/
86
87INT relationTotal = 0;
88INT entityTotal = 0;
89INT tripleTotal = 0;
90INT testTotal = 0;
91INT trainTotal = 0;
92INT validTotal = 0;
93
94extern "C" INT getEntityTotal() { return entityTotal; }
95
96extern "C" INT getRelationTotal() { return relationTotal; }
97
98extern "C" INT getTripleTotal() { return tripleTotal; }
99
100extern "C" INT getTrainTotal() { return trainTotal; }
101
102extern "C" INT getTestTotal() { return testTotal; }
103
104extern "C" INT getValidTotal() { return validTotal; }
105/*
106============================================================
107*/
108
109INT bernFlag = 0;
110
111extern "C" void setBern(INT con) { bernFlag = con; }
112
113#endif