// File: panosfoto[P]NGramGraphParallel/test.cpp
// Function: main
int main(){

    // An example of graph creation:

    // Declare a splitter for the Proximity Graph (string splitter here, since we will split a text to n-grams).
    StringSplitter testStringSplitter(4);

    // Set the size of the atoms (n-grams in this  case). Default is 3.
    testStringSplitter.setAtomSize(NGRAMSIZE_DEFAULT_VALUE);

    // Declare the payload of the Proximity Graph (the entity that will be split to atoms). We are using a text in this example, so it will be a string payload.
    StringPayload testStringPayload(TEXT_PAYLOAD);

    // Declare the Proximity Graph. We will split a text into n-grams, so we are using an NGramGraph which is a ProximityGraph for this use.
    // The NGramGraph has a built-in basic Proximity Evaluator so we won't explicitly pass one, but it needs a String Splitter and a String Payload to split.
    NGramGraph testNGramGraph(nullptr, &testStringSplitter, &testStringPayload, 2);

    // Create the graph from the text (StringPayload) and print it in DOT format.
    testNGramGraph.createGraph();
    testNGramGraph.printGraphviz();
    testNGramGraph.printGraphvizToFile("out.dot");



    // -------------------------------------------------------------------------------------------
    cout << endl << endl << "-------------------------" << endl << endl << endl;



    // An example of graph comparison:

    // Declare an instance of GraphSimilarity to hold the comparison's result
    GraphSimilarity testGraphSimilarity;

    // Declare the graph comparator
    GraphComparator<std::string, std::string> testGraphComparator;

    // Compare the previous graph with itself and store the result to testGraphSimilarity
    testGraphSimilarity = testGraphComparator.compare(testNGramGraph, testNGramGraph);

    // Display the size similarity (from the various similarity components) of the two compared graphs.
    map<string, double> testSimilarityComponents =  testGraphSimilarity.getSimilarityComponents();
    cout << "Size Similarity: " << testSimilarityComponents["sizeSimilarity"] << endl;
    // Since they are the same graph, their size is equal, therefore the similarity is 1.

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movl $0x0, -0x4(%rbp)
leaq -0x18(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
movl $0x4, %esi
callq 0x3e6d0
movq -0x1f0(%rbp), %rdi
movl $0x3, %esi
callq 0x8f00
leaq -0x61(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x86d0
movq -0x1e8(%rbp), %rdx
leaq 0x3758a(%rip), %rsi     # 0x40060
leaq -0x60(%rbp), %rdi
callq 0x8540
jmp 0x8ae1
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3e4d0
jmp 0x8af0
leaq -0x60(%rbp), %rdi
callq 0x8260
leaq -0x61(%rbp), %rdi
callq 0x8430
xorl %eax, %eax
movl %eax, %esi
leaq -0x118(%rbp), %rdi
leaq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rcx
movl $0x2, %r8d
callq 0x358f0
jmp 0x8b22
leaq -0x118(%rbp), %rdi
callq 0x359b0
jmp 0x8b30
movq 0x5f489(%rip), %rsi     # 0x67fc0
leaq -0x118(%rbp), %rdi
callq 0x8f20
jmp 0x8b45
leaq -0x139(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x86d0
movq -0x1f8(%rbp), %rdx
leaq 0x37513(%rip), %rsi     # 0x40079
leaq -0x138(%rbp), %rdi
callq 0x8540
jmp 0x8b74
movl $0x10, %edi
movl $0x20, %esi
callq 0x9420
movl %eax, -0x1fc(%rbp)
jmp 0x8b8b
movl -0x1fc(%rbp), %edx
leaq -0x118(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x9330
jmp 0x8ba6
leaq -0x138(%rbp), %rdi
callq 0x8260
leaq -0x139(%rbp), %rdi
callq 0x8430
movq 0x5f3fb(%rip), %rdi     # 0x67fc0
movq 0x5f3cc(%rip), %rsi     # 0x67f98
callq 0x8410
movq %rax, -0x208(%rbp)
jmp 0x8bda
movq -0x208(%rbp), %rdi
movq 0x5f3b0(%rip), %rsi     # 0x67f98
callq 0x8410
movq %rax, -0x210(%rbp)
jmp 0x8bf6
movq -0x210(%rbp), %rdi
leaq 0x3747d(%rip), %rsi     # 0x40081
callq 0x83d0
movq %rax, -0x218(%rbp)
jmp 0x8c12
movq -0x218(%rbp), %rdi
movq 0x5f378(%rip), %rsi     # 0x67f98
callq 0x8410
movq %rax, -0x220(%rbp)
jmp 0x8c2e
movq -0x220(%rbp), %rdi
movq 0x5f35c(%rip), %rsi     # 0x67f98
callq 0x8410
movq %rax, -0x228(%rbp)
jmp 0x8c4a
movq -0x228(%rbp), %rdi
movq 0x5f340(%rip), %rsi     # 0x67f98
callq 0x8410
jmp 0x8c5f
leaq -0x160(%rbp), %rdi
callq 0x35460
jmp 0x8c6d
leaq -0x168(%rbp), %rdi
callq 0x9440
jmp 0x8c7b
leaq -0x188(%rbp), %rdi
leaq -0x168(%rbp), %rsi
leaq -0x118(%rbp), %rcx
movq %rcx, %rdx
callq 0x9460
jmp 0x8c9a
leaq -0x160(%rbp), %rdi
movq %rdi, -0x230(%rbp)
leaq -0x188(%rbp), %rsi
callq 0x95b0
movq -0x230(%rbp), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x35510
jmp 0x8cc9
movq 0x5f2f0(%rip), %rdi     # 0x67fc0
leaq 0x373c4(%rip), %rsi     # 0x4009b
callq 0x83d0
movq %rax, -0x238(%rbp)
jmp 0x8ce5
leaq -0x1d9(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x86d0
movq -0x240(%rbp), %rdx
leaq 0x373a7(%rip), %rsi     # 0x400ad
leaq -0x1d8(%rbp), %rdi
callq 0x8540
jmp 0x8d14
leaq -0x1b8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x9600
movq %rax, -0x248(%rbp)
jmp 0x8d30
movq -0x238(%rbp), %rdi
movq -0x248(%rbp), %rax
movsd (%rax), %xmm0
callq 0x8740
movq %rax, -0x250(%rbp)
jmp 0x8d50
movq -0x250(%rbp), %rdi
movq 0x5f23a(%rip), %rsi     # 0x67f98
callq 0x8410
jmp 0x8d65
leaq -0x1d8(%rbp), %rdi
callq 0x8260
leaq -0x1d9(%rbp), %rdi
callq 0x8430
movl $0x0, -0x4(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x96e0
leaq -0x168(%rbp), %rdi
callq 0x9700
leaq -0x118(%rbp), %rdi
callq 0x35960
leaq -0x40(%rbp), %rdi
callq 0x3e540
movl -0x4(%rbp), %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8de0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x8260
leaq -0x61(%rbp), %rdi
callq 0x8430
jmp 0x8ebf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8eb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8eaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8e36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x8260
leaq -0x139(%rbp), %rdi
callq 0x8430
jmp 0x8eaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8e9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8e92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8e86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8260
leaq -0x1d9(%rbp), %rdi
callq 0x8430
leaq -0x1b8(%rbp), %rdi
callq 0x96e0
leaq -0x168(%rbp), %rdi
callq 0x9700
leaq -0x118(%rbp), %rdi
callq 0x35960
leaq -0x40(%rbp), %rdi
callq 0x3e540
movq -0x70(%rbp), %rdi
callq 0x86c0
nopl (%rax,%rax)