TTK
Loading...
Searching...
No Matches
MergeTreeAxesAlgorithmUtils.cpp
Go to the documentation of this file.
2
3namespace ttk {
4 namespace axa {
5 //----------------------------------------------------------------------------
6 // Output Utils
7 //----------------------------------------------------------------------------
8 void zeroPadding(std::string &colName,
9 const size_t numberCols,
10 const size_t colIdx) {
11 std::string const max{std::to_string(numberCols - 1)};
12 std::string const cur{std::to_string(colIdx)};
13 std::string const zer(max.size() - cur.size(), '0');
14 colName.append(zer).append(cur);
15 }
16
17 std::string getTableCoefficientName(int noAxes, int axeNum) {
18 std::string name{"T"};
19 zeroPadding(name, noAxes, axeNum);
20 return name;
21 }
22
23 std::string getTableCoefficientNormName(int noAxes, int axeNum) {
24 std::string name{"TNorm"};
25 zeroPadding(name, noAxes, axeNum);
26 return name;
27 }
28
29 std::string getTableVectorName(
30 int noAxes, int axeNum, int vId, int vComp, bool isSecondInput) {
31 std::string indexString{};
32 zeroPadding(indexString, noAxes, axeNum);
33 std::string const prefix{(isSecondInput ? "T2_" : "")};
34 std::string name{prefix + "V" + indexString + "_" + std::to_string(vId)
35 + "_" + std::to_string(vComp)};
36 return name;
37 }
38
39 std::string getTableCorrelationName(int noAxes, int axeNum) {
40 std::string name{"Corr"};
41 zeroPadding(name, noAxes, axeNum);
42 return name;
43 }
44
45 std::string getTableCorrelationPersName(int noAxes, int axeNum) {
46 std::string name{"CorrPers"};
47 zeroPadding(name, noAxes, axeNum);
48 return name;
49 }
50
51 std::string getTableTreeName(int noTrees, int treeNum) {
52 std::string name{"Tree"};
53 zeroPadding(name, noTrees, treeNum);
54 return name;
55 }
56 } // namespace axa
57} // namespace ttk
void zeroPadding(std::string &colName, const size_t numberCols, const size_t colIdx)
std::string getTableCoefficientNormName(int noAxes, int axeNum)
std::string getTableCorrelationPersName(int noAxes, int axeNum)
std::string getTableVectorName(int noAxes, int axeNum, int vId, int vComp, bool isSecondInput)
std::string getTableTreeName(int noTrees, int treeNum)
std::string getTableCoefficientName(int noAxes, int axeNum)
std::string getTableCorrelationName(int noAxes, int axeNum)
The Topology ToolKit.