MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / main

Function main

doc/code_examples/Tutorial_Clustering.cpp:34–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}; // end of LowLevelComparator
33
34Int main()
35{
36 // data
37 vector<double> data; // must be filled
38
39 srand(333);
40 Size nr = 12;
41 data.resize(nr);
42 for (Size i = 0; i < nr; ++i)
43 {
44 data[i] = (double)rand() / RAND_MAX;
45 }
46
47 LowLevelComparator llc;
48 CompleteLinkage sl;
49 vector<BinaryTreeNode> tree;
50 DistanceMatrix<float> dist; // will be filled
51 ClusterHierarchical ch;
52 ch.setThreshold(0.15);
53
54 // clustering
55 ch.cluster<double, LowLevelComparator>(data, llc, sl, tree, dist);
56
57 ClusterAnalyzer ca;
58 std::cout << ca.newickTree(tree) << std::endl;
59
60 return 0;
61} //end of main

Callers

nothing calls this directly

Calls 2

newickTreeMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected