50 const std::string ®ExpStr,
51 std::vector<std::string> &vectToFill) {
54 const size_t n = input->GetNumberOfColumns();
55 for(
size_t i = 0; i < n; ++i) {
56 const auto &name = input->GetColumnName(i);
57 if(std::regex_match(name, std::regex(regExpStr))) {
58 vectToFill.emplace_back(name);
65 vtkInformationVector **inputVector,
66 vtkInformationVector *outputVector) {
69 vtkTable *inputHigh = vtkTable::GetData(inputVector[0]);
70 vtkTable *inputLow = vtkTable::GetData(inputVector[1]);
72 vtkTable *output = vtkTable::GetData(outputVector);
74 if(!inputLow || !inputHigh || !output)
78 if(SelectFieldsWithRegexpHigh)
80 if(SelectFieldsWithRegexpLow)
83 const size_t nRowsHigh = inputHigh->GetNumberOfRows();
84 const size_t nColsHigh = ScalarFieldsHigh.size();
85 const size_t nRowsLow = inputLow->GetNumberOfRows();
86 const size_t nColsLow = ScalarFieldsLow.size();
87 if(nRowsHigh == 0 || nRowsHigh != nColsHigh) {
88 this->
printErr(
"High input matrix is not a valid square matrix (rows: "
89 + std::to_string(nRowsHigh)
90 +
", columns: " + std::to_string(nColsHigh) +
")");
94 if(nRowsLow == 0 || nRowsLow != nColsLow) {
95 this->
printErr(
"Low input matrix is not a valid square matrix (rows: "
96 + std::to_string(nRowsLow)
97 +
", columns: " + std::to_string(nColsLow) +
")");
100 if(nRowsHigh != nRowsLow) {
102 "High and low input matrices must have same size (rows(high): "
103 + std::to_string(nRowsHigh) +
", rows(low): " + std::to_string(nRowsLow)
108 int const n = nRowsHigh;
109 std::vector<double *> vectMatHigh(n),
113 std::vector<vtkDataArray *> arraysHigh{}, arraysLow{};
114 for(
const auto &s : ScalarFieldsHigh)
115 arraysHigh.push_back(
116 vtkDoubleArray::SafeDownCast(inputHigh->GetColumnByName(s.data())));
117 for(
const auto &s : ScalarFieldsLow)
119 vtkDoubleArray::SafeDownCast(inputLow->GetColumnByName(s.data())));
121#ifdef TTK_ENABLE_OPENMP
122#pragma omp parallel for num_threads(this->threadNumber_)
124 for(
int i = 0; i < n; i++) {
129 double distortionValue = 0;
130 vtkNew<vtkDoubleArray> tmpCol{}, distortionValArray{};
131 tmpCol->SetNumberOfTuples(n);
132 this->
printMsg(
"Starting computation of sim distortion value...");
133 this->
execute(vectMatHigh, vectMatLow, distortionValue,
136 tmpCol->SetName(
"SimValue");
138 output->AddColumn(tmpCol);
139 distortionValArray->SetName(
"DistortionValue");
140 distortionValArray->SetNumberOfTuples(1);
141 distortionValArray->SetTuple1(0, distortionValue);
142 output->GetFieldData()->AddArray(distortionValArray);
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/| (_) |"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)