16#define POINTS_BELOW_DIAG_TOLERANCE 1e-4
29 std::vector<std::vector<std::tuple<ftm::idNode, ftm::idNode, double>>>
35 "MergeTreePrincipalGeodesicsBase");
43 template <
class dataType>
47 std::vector<std::vector<double *>> &vS,
48 std::vector<std::vector<double *>> &v2s,
50 std::vector<std::vector<double>> &allTreesTs,
51 std::vector<double> &reconstructionErrors,
52 std::vector<std::vector<std::tuple<ftm::idNode, ftm::idNode, double>>>
54 bool transposeVector =
true) {
55 reconstructionErrors.resize(inputTrees.size());
56 matchings.resize(inputTrees.size());
57 dataType reconstructionError = 0.0;
58#ifdef TTK_ENABLE_OPENMP
59#pragma omp parallel for schedule(dynamic) num_threads(this->threadNumber_) reduction(+:reconstructionError)
61 for(
unsigned int i = 0; i < inputTrees.size(); ++i) {
63 getMultiInterpolation<dataType>(barycenter, vS, v2s, vSize,
64 allTreesTs[i], reconstructedTree,
67 computeOneDistance<dataType>(
68 reconstructedTree, inputTrees[i], matchings[i], error,
true);
69 reconstructionError += error / inputTrees.size();
70 reconstructionErrors[i] = error;
72 return reconstructionError;
75 template <
class dataType>
79 std::vector<std::vector<std::vector<double>>> &vS,
80 std::vector<std::vector<std::vector<double>>> &v2s,
81 std::vector<std::vector<double>> &allTreesTs,
82 std::vector<double> &reconstructionErrors) {
83 std::vector<std::vector<double *>> pVS, pV2s;
86 std::vector<std::vector<std::tuple<ftm::idNode, ftm::idNode, double>>>
89 vS[0].size(), allTreesTs,
90 reconstructionErrors, matchings,
false);
93 template <
class dataType>
97 std::vector<std::vector<std::vector<double>>> &vS,
98 std::vector<std::vector<std::vector<double>>> &v2s,
99 std::vector<std::vector<double>> &allTreesTs) {
100 std::vector<double> reconstructionErrors;
102 barycenter, inputTrees, vS, v2s, allTreesTs, reconstructionErrors);
109 std::vector<double> &v2) {
110 std::vector<double> vProj, v2Proj;
115 for(
unsigned int i = 0; i < vProj.size(); ++i) {
118 alpha += (vProj[i] / v2Proj[i]);
122 double const m = alpha / (1 + alpha);
129 return (m - tMin) * (1 - m) / m + m;
135 return (m - tMax) * m / (1 - m) + m;
139 double newT,
double m,
double &tMin,
double &tMax,
bool updateTMin) {
141 tMin = std::max(newT, tMin);
143 if(adjustedTMax > tMin)
144 tMax = std::min(adjustedTMax, tMax);
146 tMax = std::min(newT, tMax);
148 if(adjustedTMin < tMax)
149 tMin = std::max(adjustedTMin, tMin);
153 template <
class dataType>
157 std::vector<std::vector<double>> &vNew,
158 std::vector<std::vector<double>> &v2New,
161 bool shortener =
false;
164 auto newBirthV1 = baryBirth - vNew[node][0];
165 auto newDeathV1 = baryDeath - vNew[node][1];
168 auto newBirthV2 = baryBirth + v2New[node][0];
169 auto newDeathV2 = baryDeath + v2New[node][1];
172 if(newBirthV1 > newDeathV1 and newBirthV2 > newDeathV2) {
176 = (vNew[node][1] - vNew[node][0]) / (baryDeath - baryBirth);
177 vNew[node][0] /= divisor;
178 vNew[node][1] /= divisor;
179 double const divisor2
180 = (v2New[node][0] - v2New[node][1]) / (baryDeath - baryBirth);
181 v2New[node][0] /= divisor2;
182 v2New[node][1] /= divisor2;
183 }
else if(newBirthV1 > newDeathV1 or newBirthV2 > newDeathV2) {
185 = (baryDeath - vNew[node][1] - baryBirth + vNew[node][0])
186 / (vNew[node][0] + v2New[node][0]
187 - (vNew[node][1] + v2New[node][1]));
189 if(newBirthV1 > newDeathV1)
190 updateT(newT, m, tMin, tMax,
true);
191 if(newBirthV2 > newDeathV2)
192 updateT(newT, m, tMin, tMax,
false);
198 template <
class dataType>
203 std::vector<std::vector<double>> &vNew,
204 std::vector<std::vector<double>> &v2New,
207 bool shortener =
false;
209 dataType birthParent = 0.0;
210 dataType deathParent = 1.0;
212 auto interpolant = [&](
int i,
double t) {
213 return -vNew[node][i] + t * (vNew[node][i] + v2New[node][i]);
217 auto newBirthV1 = baryBirth + interpolant(0, tMin);
218 auto newDeathV1 = baryDeath + interpolant(1, tMin);
219 auto parentBirthV1 = 0.0;
220 auto parentDeathV1 = 1.0;
223 auto newBirthV2 = baryBirth + interpolant(0, tMax);
224 auto newDeathV2 = baryDeath + interpolant(1, tMax);
225 auto parentBirthV2 = 0.0;
226 auto parentDeathV2 = 1.0;
229 bool const extremOutPathIn
230 = ((newDeathV1 > parentDeathV1 and not(newBirthV1 < parentBirthV1)
231 and not(newDeathV2 > parentDeathV2) and newBirthV2 < parentBirthV2)
232 or (not(newDeathV1 > parentDeathV1) and newBirthV1 < parentBirthV1
233 and newDeathV2 > parentDeathV2
234 and not(newBirthV2 < parentBirthV2)));
238 if(((newDeathV1 > parentDeathV1 and newDeathV2 > parentDeathV2)
239 or (newBirthV1 < parentBirthV1 and newBirthV2 < parentBirthV2))
240 and not(extremOutPathIn)) {
245 if(newDeathV1 > parentDeathV1 and newBirthV1 < parentBirthV1)
246 if(newBirthV1 < newDeathV1)
247 coef1 = (parentBirthV1 - baryBirth) / interpolant(0, tMin);
249 coef1 = (parentDeathV1 - baryDeath) / interpolant(1, tMin);
250 else if(newBirthV1 < parentBirthV1)
251 coef1 = (parentBirthV1 - baryBirth) / interpolant(0, tMin);
252 else if(newDeathV1 > parentDeathV1)
253 coef1 = (parentDeathV1 - baryDeath) / interpolant(1, tMin);
254 vNew[node][0] *= coef1;
255 vNew[node][1] *= coef1;
259 if(newDeathV2 > parentDeathV2 and newBirthV2 < parentBirthV2)
260 if(newBirthV2 < newDeathV2)
261 coef2 = (parentBirthV2 - baryBirth) / interpolant(0, tMax);
263 coef2 = (parentDeathV2 - baryDeath) / interpolant(1, tMax);
264 else if(newBirthV2 < parentBirthV2)
265 coef2 = (parentBirthV2 - baryBirth) / interpolant(0, tMax);
266 else if(newDeathV2 > parentDeathV2)
267 coef2 = (parentDeathV2 - baryDeath) / interpolant(1, tMax);
268 v2New[node][0] *= coef2;
269 v2New[node][1] *= coef2;
274 if(((newDeathV1 > parentDeathV1 or newBirthV1 < parentBirthV1)
275 != (newDeathV2 > parentDeathV2 or newBirthV2 < parentBirthV2))
276 or extremOutPathIn) {
278 if(newDeathV1 > parentDeathV1 or newDeathV2 > parentDeathV2) {
279 double const newT = (deathParent - baryDeath + vNew[node][1])
280 / (vNew[node][1] + v2New[node][1]);
281 if(newDeathV1 > parentDeathV1)
282 updateT(newT, m, tMin, tMax,
true);
283 if(newDeathV2 > parentDeathV2)
284 updateT(newT, m, tMin, tMax,
false);
286 if(newBirthV1 < parentBirthV1 or newBirthV2 < parentBirthV2) {
287 double const newT = (birthParent - baryBirth + vNew[node][0])
288 / (vNew[node][0] + v2New[node][0]);
289 if(newBirthV1 < parentBirthV1)
290 updateT(newT, m, tMin, tMax,
true);
291 if(newBirthV2 < parentBirthV2)
292 updateT(newT, m, tMin, tMax,
false);
299 template <
class dataType>
302 std::vector<std::vector<double>> &vNew,
303 std::vector<std::vector<double>> &v2New,
308 const std::string &msg,
309 std::stringstream &ssT) {
310 double const tNew = (t * (tMax - tMin) + tMin);
311 std::streamsize
const sSize = std::cout.precision();
312 ssT << std::setprecision(12) << std::endl << msg << std::endl;
313 ssT <<
"interBirth : "
314 << birth - vNew[i][0] + tNew * (vNew[i][0] + v2New[i][0]) <<
" _ "
316 << death - vNew[i][1] + tNew * (vNew[i][1] + v2New[i][1])
318 ssT <<
"v : " << vNew[i][0] <<
" _ " << vNew[i][1] << std::endl;
319 ssT <<
"v2 : " << v2New[i][0] <<
" _ " << v2New[i][1] << std::endl;
320 ssT <<
"ts : " << tMin <<
" _ " << tMax << std::endl;
321 ssT <<
"t : " << t <<
" _ tNew : " << tNew << std::endl;
322 std::cout.precision(sSize);
325 template <
class dataType>
327 std::vector<std::vector<double>> &v,
328 std::vector<std::vector<double>> &v2,
332 double tMin = 0.0, tMax = 1.0;
336 auto birth = std::get<0>(birthDeath);
337 auto death = std::get<1>(birthDeath);
341 auto parentBirthDeath = baryTree->
getBirthDeath<dataType>(parent);
342 auto parentBirth = std::get<0>(parentBirthDeath);
343 auto parentDeath = std::get<1>(parentBirthDeath);
346 birth = (birth - parentBirth) / (parentDeath - parentBirth);
347 death = (death - parentBirth) / (parentDeath - parentBirth);
351 bool diagonalShortener
355 bool nestingShortener =
false;
362 double const tNew = t * (tMax - tMin) + tMin;
364 if(diagonalShortener or nestingShortener)
370 template <
class dataType>
372 std::vector<double *> &v,
373 std::vector<double *> &v2,
376 std::vector<dataType> &interpolationVectorT,
377 bool transposeVector) {
380 std::vector<dataType> scalarsVector;
381 ttk::ftm::getTreeScalars<dataType>(barycenter, scalarsVector);
382 std::vector<double> interpolationVector(scalarsVector.size());
383 std::vector<std::vector<double>> vNew, v2New;
386 if(transposeVector) {
387 std::vector<std::vector<double>> out;
395 int cptBelowDiagonal = 0, cptNotNesting = 0;
396 std::queue<ftm::idNode> queue;
397 queue.emplace(baryTree->
getRoot());
398 int noNestingShortener = 0, noDiagonalShortener = 0;
399 while(!queue.empty()) {
405 auto nodeBirth = std::get<0>(nodeBirthDeath);
406 auto nodeDeath = std::get<1>(nodeBirthDeath);
407 auto birth = scalarsVector[nodeBirth];
408 auto death = scalarsVector[nodeDeath];
412 auto parentNodeBirthDeath
414 auto parentNodeBirth = std::get<0>(parentNodeBirthDeath);
415 auto parentNodeDeath = std::get<1>(parentNodeBirthDeath);
416 auto parentBirth = scalarsVector[parentNodeBirth];
417 auto parentDeath = scalarsVector[parentNodeDeath];
418 auto interParentBirth = interpolationVector[parentNodeBirth];
419 auto interParentDeath = interpolationVector[parentNodeDeath];
422 std::stringstream ssT;
423 std::streamsize
const sSize2 = std::cout.precision();
424 ssT << std::setprecision(12);
425 ssT <<
"info" << std::endl;
426 ssT <<
"birth death : " << birth <<
" ___ " << death << std::endl;
427 ssT <<
"par. birth death : " << parentBirth <<
" ___ " << parentDeath
429 ssT <<
"par. inter birth death : " << interParentBirth <<
" ___ "
430 << interParentDeath << std::endl;
433 birth = (birth - parentBirth) / (parentDeath - parentBirth);
434 death = (death - parentBirth) / (parentDeath - parentBirth);
435 ssT <<
"norm. birth death : " << birth <<
" ___ " << death
438 std::cout.precision(sSize2);
442 double tMin = 0.0, tMax = 1.0;
445 getInterpolationVectorDebugMsg<dataType>(birth, death, vNew, v2New, i,
447 "before adjustDiagonalT", ssT);
451 bool const diagonalShortener
453 noDiagonalShortener += diagonalShortener;
456 getInterpolationVectorDebugMsg<dataType>(
457 birth, death, vNew, v2New, i, t, tMin, tMax,
458 "after adjustDiagonalT/before adjustNestingT", ssT);
464 barycenter, birth, death, i, vNew, v2New, tMin, tMax);
465 noNestingShortener += nestingShortener;
468 getInterpolationVectorDebugMsg<dataType>(birth, death, vNew, v2New, i,
470 "after adjustNestingT", ssT);
475 double const tNew = t * (tMax - tMin) + tMin;
477 = birth - vNew[i][0] + tNew * (vNew[i][0] + v2New[i][0]);
479 = death - vNew[i][1] + tNew * (vNew[i][1] + v2New[i][1]);
481 double const coef = (interParentDeath - interParentBirth);
483 interBirth += interParentBirth;
485 interDeath += interParentBirth;
487 interpolationVector[nodeBirth] = interBirth;
488 interpolationVector[nodeDeath] = interDeath;
491 if(std::isnan(interpolationVector[nodeBirth])
492 or std::isnan(interpolationVector[nodeDeath])) {
498 if(interpolationVector[nodeBirth] > interpolationVector[nodeDeath]
499 and interpolationVector[nodeBirth] - interpolationVector[nodeDeath]
501 interpolationVector[nodeBirth] = interpolationVector[nodeDeath];
503 if(interpolationVector[nodeBirth] > interpolationVector[nodeDeath]) {
506 std::streamsize
const sSize = std::cout.precision();
507 std::stringstream ss;
508 ss << std::setprecision(12) << interpolationVector[nodeBirth] <<
" > "
509 << interpolationVector[nodeDeath];
511 std::cout.precision(sSize);
516 if(interpolationVector[nodeBirth] < interParentBirth
517 and (interParentBirth - interpolationVector[nodeBirth]) < eps)
518 interpolationVector[nodeBirth] = interParentBirth;
519 if(interpolationVector[nodeBirth] > interParentDeath
520 and (interpolationVector[nodeBirth] - interParentDeath) < eps) {
521 interpolationVector[nodeBirth] = interParentDeath;
523 if(interpolationVector[nodeDeath] < interParentBirth
524 and (interParentBirth - interpolationVector[nodeDeath]) < eps) {
525 interpolationVector[nodeDeath] = interParentBirth;
527 if(interpolationVector[nodeDeath] > interParentDeath
528 and (interpolationVector[nodeDeath] - interParentDeath) < eps)
529 interpolationVector[nodeDeath] = interParentDeath;
532 and (interpolationVector[nodeBirth] < interParentBirth
533 or interpolationVector[nodeBirth] > interParentDeath
534 or interpolationVector[nodeDeath] < interParentBirth
535 or interpolationVector[nodeDeath] > interParentDeath)) {
538 std::streamsize
const sSize = std::cout.precision();
539 std::stringstream ss;
540 ss << std::setprecision(12) << interpolationVector[nodeBirth] <<
" _ "
541 << interpolationVector[nodeDeath] <<
" --- " << interParentBirth
542 <<
" _ " << interParentDeath;
544 std::cout.precision(sSize);
548 std::vector<ftm::idNode> children;
550 for(
auto child : children)
551 queue.emplace(child);
553 if(noNestingShortener != 0)
554 printWrn(
"[getInterpolationVector] "
556 +
" nesting vector shortener.");
557 if(noDiagonalShortener != 0)
558 printMsg(
"[getInterpolationVector] "
560 +
" diagonal vector shortener.",
562 if(cptBelowDiagonal != 0)
563 printErr(
"[getInterpolationVector] point below diagonal.");
564 if(cptNotNesting != 0)
565 printErr(
"[getInterpolationVector] nesting condition not ok.");
567 interpolationVectorT.resize(scalarsVector.size());
568 for(
unsigned int i = 0; i < interpolationVectorT.size(); ++i)
569 interpolationVectorT[i] = interpolationVector[i];
572 template <
class dataType>
574 std::vector<double *> &v,
575 std::vector<double *> &v2,
579 bool transposeVector =
true) {
583 std::vector<dataType> newScalarsVector;
584 getInterpolationVector<dataType>(
585 barycenter, v, v2, vSize, t, newScalarsVector, transposeVector);
589 = ttk::ftm::createEmptyMergeTree<dataType>(newScalarsVector.size());
590 ttk::ftm::setTreeScalars<dataType>(interpolated, newScalarsVector);
597 persistenceThresholding<dataType>(treeNew, 0.001);
600 template <
class dataType>
602 std::vector<std::vector<double>> &v,
603 std::vector<std::vector<double>> &v2,
606 std::vector<double *> pV, pV2;
609 return getInterpolation<dataType>(
610 barycenter, pV, pV2, v[0].size(), t, interpolated,
false);
613 template <
class dataType>
615 std::vector<std::vector<double *>> &vS,
616 std::vector<std::vector<double *>> &v2s,
618 std::vector<double> &ts,
620 bool transposeVector =
true) {
621 getInterpolation<dataType>(
622 barycenter, vS[0], v2s[0], vSize, ts[0], interpolated, transposeVector);
623 for(
unsigned int i = 1; i < vS.size(); ++i) {
625 getInterpolation<dataType>(interpolated, vS[i], v2s[i], vSize, ts[i],
626 newInterpolated, transposeVector);
627 interpolated = newInterpolated;
631 template <
class dataType>
634 std::vector<std::vector<std::vector<double>>> &vS,
635 std::vector<std::vector<std::vector<double>>> &v2s,
636 std::vector<double> &ts,
638 std::vector<std::vector<double *>> pVS, pV2s;
642 barycenter, pVS, pV2s, vS[0][0].size(), ts, interpolated,
false);
645 template <
class dataType>
648 std::vector<std::vector<std::vector<double>>> &vS,
649 std::vector<std::vector<std::vector<double>>> &v2s,
650 std::vector<std::vector<double>> &v,
651 std::vector<std::vector<double>> &v2,
652 std::vector<double> &ts,
655 std::vector<std::vector<std::vector<double>>> vSTemp = vS, v2sTemp = v2s;
657 v2sTemp.push_back(v2);
658 std::vector<double> tsTemp = ts;
659 if(tsTemp.size() != 0)
660 tsTemp[vSTemp.size() - 1] = t;
670 std::vector<double> &v,
671 std::vector<double> &newV);
676 std::vector<double *> &pVec);
679 std::vector<std::vector<std::vector<double>>> &vS,
680 std::vector<std::vector<double *>> &pVS);
682 void pointerToVector(
double *pVec,
size_t size, std::vector<double> &vec);
685 std::vector<size_t> sizes,
686 std::vector<std::vector<double>> &vec);
690 std::vector<std::vector<double>> &vec);
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
#define POINTS_BELOW_DIAG_TOLERANCE
Minimalist debugging class.
int printWrn(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
void setDebugMsgPrefix(const std::string &prefix)
int printErr(const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const
bool normalizedWasserstein_
double getGeodesicVectorMiddle(std::vector< double > &v, std::vector< double > &v2)
MergeTreePrincipalGeodesicsBase()
dataType computeReconstructionError(ftm::MergeTree< dataType > &barycenter, std::vector< ftm::MergeTree< dataType > > &inputTrees, std::vector< std::vector< std::vector< double > > > &vS, std::vector< std::vector< std::vector< double > > > &v2s, std::vector< std::vector< double > > &allTreesTs)
void getInterpolationVectorDebugMsg(dataType birth, dataType death, std::vector< std::vector< double > > &vNew, std::vector< std::vector< double > > &v2New, int i, double t, double tMin, double tMax, const std::string &msg, std::stringstream &ssT)
std::vector< std::vector< double > > allTreesTs_
std::vector< std::vector< std::vector< double > > > v2s_
void vectorToPointer(std::vector< double > &vec, double *&pVec)
void pointersToVectors(std::vector< double * > &pVec, std::vector< size_t > sizes, std::vector< std::vector< double > > &vec)
double getTNew(ftm::MergeTree< dataType > &barycenter, std::vector< std::vector< double > > &v, std::vector< std::vector< double > > &v2, int i, double t)
double getAdjustedTMin(double tMax, double m)
std::vector< std::vector< std::vector< double > > > trees2V2s_
void getMultiInterpolation(ftm::MergeTree< dataType > &barycenter, std::vector< std::vector< double * > > &vS, std::vector< std::vector< double * > > &v2s, size_t vSize, std::vector< double > &ts, ftm::MergeTree< dataType > &interpolated, bool transposeVector=true)
std::vector< std::vector< std::vector< double > > > vS_
void getInterpolation(ftm::MergeTree< dataType > &barycenter, std::vector< double * > &v, std::vector< double * > &v2, size_t vSize, double t, ftm::MergeTree< dataType > &interpolated, bool transposeVector=true)
void vectorsToPointers(std::vector< std::vector< double > > &vec, std::vector< double * > &pVec)
bool adjustNestingT(ftm::MergeTree< dataType > &ttkNotUsed(barycenter), dataType baryBirth, dataType baryDeath, ftm::idNode node, std::vector< std::vector< double > > &vNew, std::vector< std::vector< double > > &v2New, double &tMin, double &tMax)
std::vector< std::vector< double > > allTs_
std::vector< std::vector< double > > branchesCorrelationMatrix_
void getMultiInterpolation(ftm::MergeTree< dataType > &barycenter, std::vector< std::vector< std::vector< double > > > &vS, std::vector< std::vector< std::vector< double > > > &v2s, std::vector< double > &ts, ftm::MergeTree< dataType > &interpolated)
std::vector< std::vector< double > > persCorrelationMatrix_
std::vector< std::vector< std::tuple< ftm::idNode, ftm::idNode, double > > > baryMatchings_
std::vector< std::vector< std::tuple< ftm::idNode, ftm::idNode, double > > > baryMatchings2_
bool adjustDiagonalT(dataType baryBirth, dataType baryDeath, ftm::idNode node, std::vector< std::vector< double > > &vNew, std::vector< std::vector< double > > &v2New, double &tMin, double &tMax)
void getMultiInterpolation(ftm::MergeTree< dataType > &barycenter, std::vector< std::vector< std::vector< double > > > &vS, std::vector< std::vector< std::vector< double > > > &v2s, std::vector< std::vector< double > > &v, std::vector< std::vector< double > > &v2, std::vector< double > &ts, double t, ftm::MergeTree< dataType > &interpolated)
double getAdjustedTMax(double tMin, double m)
void pointerToVector(double *pVec, size_t size, std::vector< double > &vec)
void getInterpolation(ftm::MergeTree< dataType > &barycenter, std::vector< std::vector< double > > &v, std::vector< std::vector< double > > &v2, double t, ftm::MergeTree< dataType > &interpolated)
void getInterpolationVector(ftm::MergeTree< dataType > &barycenter, std::vector< double * > &v, std::vector< double * > &v2, size_t vSize, double t, std::vector< dataType > &interpolationVectorT, bool transposeVector)
std::vector< std::vector< std::vector< double > > > trees2Vs_
std::vector< std::vector< double > > allScaledTs_
void vectorOfVectorsToPointers(std::vector< std::vector< std::vector< double > > > &vS, std::vector< std::vector< double * > > &pVS)
dataType computeReconstructionError(ftm::MergeTree< dataType > &barycenter, std::vector< ftm::MergeTree< dataType > > &inputTrees, std::vector< std::vector< double * > > &vS, std::vector< std::vector< double * > > &v2s, size_t vSize, std::vector< std::vector< double > > &allTreesTs, std::vector< double > &reconstructionErrors, std::vector< std::vector< std::tuple< ftm::idNode, ftm::idNode, double > > > &matchings, bool transposeVector=true)
void updateT(double newT, double m, double &tMin, double &tMax, bool updateTMin)
dataType computeReconstructionError(ftm::MergeTree< dataType > &barycenter, std::vector< ftm::MergeTree< dataType > > &inputTrees, std::vector< std::vector< std::vector< double > > > &vS, std::vector< std::vector< std::vector< double > > > &v2s, std::vector< std::vector< double > > &allTreesTs, std::vector< double > &reconstructionErrors)
void callGramSchmidt(std::vector< std::vector< double > > &vS, std::vector< double > &v, std::vector< double > &newV)
bool notNeedToNormalize(idNode nodeId)
std::tuple< dataType, dataType > getBirthDeath(idNode nodeId)
std::tuple< ftm::idNode, ftm::idNode > getBirthDeathNode(idNode nodeId)
idNode getParentSafe(idNode nodeId)
void getChildren(idNode nodeId, std::vector< idNode > &res)
void copyMergeTreeStructure(FTMTree_MT *tree)
std::string to_string(__int128)
T1 pow(const T1 val, const T2 n)
void addVectorsProjection(const std::vector< T > &a, const std::vector< T > &b, std::vector< T > &a_out, std::vector< T > &b_out)
void transposeMatrix(const std::vector< std::vector< T > > &a, std::vector< std::vector< T > > &out)
unsigned int idNode
Node index in vect_nodes_.
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)