Skip to content

Commit eb8e084

Browse files
committed
user can specify the prefType through option
1 parent ff8fefb commit eb8e084

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

main.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
#include <cstdio>
2+
#include <cstdlib>
23
#include <vector>
34
#include "ap.h"
45
using namespace std;
56

67
// test
7-
int main()
8+
int main(int argc, char** argv)
89
{
9-
vector<int> examplar = affinityPropagation(stdin);
10-
printf("examplar:");
10+
int prefType = 1;
11+
if (argc >= 2) {
12+
prefType = atoi(argv[1]);
13+
}
14+
vector<int> examplar = affinityPropagation(stdin, prefType);
1115
for (size_t i = 0; i < examplar.size(); ++i) {
12-
printf(" %d", examplar[i]);
16+
printf("%d ", examplar[i]);
1317
}
1418
puts("");
1519
return 0;

0 commit comments

Comments
 (0)