9#include <gtest/gtest.h>
11#include <tracking/trackFindingVXD/segmentNetwork/DirectedNode.h>
12#include <tracking/trackFindingVXD/segmentNetwork/DirectedNodeNetwork.h>
14#include <tracking/trackFindingVXD/segmentNetwork/CACell.h>
16#include <tracking/trackFindingVXD/algorithms/NodeCompatibilityCheckerPathCollector.h>
17#include <tracking/trackFindingVXD/algorithms/NodeFamilyDefiner.h>
33 TEST(NodeFamilyDefinerTest, TestNodeFamiliesUsingDirectedNodeNetworkInt)
36 std::array<int, 5> intArray = { { 1, 5, 3, 4, 2} };
37 std::array<int, 5> intArray2 = { { 0, 3, 4, 6, 7} };
38 std::array<int, 5> intArray3 = { { 99, 101, 103, 104, 105} };
39 std::array<int, 3> intArray4 = { { 100, 101, 102} };
42 EXPECT_EQ(0, intNetwork.
size());
45 for (
unsigned int index = 1 ; index < 5; index++) {
47 intNetwork.
addNode(intArray.at(index - 1), intArray.at(index - 1));
48 intNetwork.
addNode(intArray.at(index), intArray.at(index));
50 intNetwork.
linkNodes(intArray.at(index - 1), intArray.at(index));
53 for (
unsigned int index = 1 ; index < 5; index++) {
54 intNetwork.
addNode(intArray2.at(index - 1), intArray2.at(index - 1));
55 intNetwork.
addNode(intArray2.at(index), intArray2.at(index));
57 intNetwork.
linkNodes(intArray2.at(index - 1), intArray2.at(index));
60 for (
unsigned int index = 1 ; index < 5; index++) {
61 intNetwork.
addNode(intArray3.at(index - 1), intArray3.at(index - 1));
62 intNetwork.
addNode(intArray3.at(index), intArray3.at(index));
64 intNetwork.
linkNodes(intArray3.at(index - 1), intArray3.at(index));
67 for (
unsigned int index = 1 ; index < 3; index++) {
68 intNetwork.
addNode(intArray4.at(index - 1), intArray4.at(index - 1));
69 intNetwork.
addNode(intArray4.at(index), intArray4.at(index));
71 intNetwork.
linkNodes(intArray4.at(index - 1), intArray4.at(index));
75 EXPECT_EQ(15, intNetwork.
size());
80 std::vector<DirectedNode<int, CACell>* >> familyDefiner;
82 short nFamilies = familyDefiner.defineFamilies(intNetwork);
84 EXPECT_EQ(2, nFamilies);
Network of directed nodes of the type EntryType.
unsigned int size() const
Returns number of nodes to be found in the network.
bool linkNodes(NodeID outerNodeID, NodeID innerNodeID)
takes two entry IDs and weaves them into the network
bool addNode(NodeID nodeID, EntryType &newEntry)
************************* PUBLIC MEMBER FUNCTIONS *************************
This class assigns a common family identifier to all CACells in the network that are connected.
Abstract base class for different kinds of events.
These tests cover the functionality of the classes: DirectedNode, DirectedNodeNetwork.