Skip to content
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ad40e45
save
thom-dani Jan 20, 2025
599ea63
v1 avec print
thom-dani Jan 21, 2025
9143cef
v1
thom-dani Jan 21, 2025
597e914
functioning version
thom-dani Jan 23, 2025
644dc1d
utility function fo stochastic backend
thom-dani Jan 27, 2025
785feb1
ok version
thom-dani Jan 29, 2025
5316a3e
fix
thom-dani Jan 29, 2025
5900b19
sans print
thom-dani Jan 30, 2025
e53519c
candidats dans stencil
thom-dani Jan 30, 2025
2349e2b
optimized version for regular grid only
thom-dani Jan 30, 2025
7d16589
Merge remote-tracking branch 'ttk-private/stochastic-discrete-gradien…
thom-dani Feb 3, 2025
100c72e
debug version with print
thom-dani Feb 3, 2025
29671f4
old return saddle connectors backend
thom-dani Feb 4, 2025
875c62b
fixed warnings saddle connectors
thom-dani Mar 11, 2025
b273b04
user defined seed
thom-dani Apr 4, 2025
f1a5f87
Merge remote-tracking branch 'origin/dev' into stochastic-discrete-gr…
thom-dani Apr 14, 2025
2154257
formatting
thom-dani Apr 15, 2025
3c52186
format
thom-dani Apr 15, 2025
ce64343
template on scalar type
thom-dani Nov 21, 2025
00a2695
Merge remote-tracking branch 'ttk/dev' into stochastic-discrete-gradient
thom-dani Nov 21, 2025
1e5db98
Merge branch 'dev' of https://github.com/topology-tool-kit/ttk into s…
julien-tierny Nov 24, 2025
2ed892e
[stochasticGradient] UI updates
julien-tierny Nov 24, 2025
c215814
fix bug with cached discrete gradient
thom-dani Nov 25, 2025
356f2d8
Merge remote-tracking branch 'ttk/dev' into stochastic-discrete-gradient
thom-dani Nov 25, 2025
ee2c417
Merge remote-tracking branch 'ttk-dani/stochastic-discrete-gradient' …
thom-dani Nov 25, 2025
92d5a29
default backend for non vti files
thom-dani Nov 27, 2025
506b26b
default backend for non vti files
thom-dani Nov 27, 2025
7c48a80
Merge remote-tracking branch 'ttk-dani/stochastic-discrete-gradient' …
thom-dani Nov 27, 2025
e233c59
[stochasticGradient] gui fix
julien-tierny Dec 1, 2025
c29fc68
fix cache update bug
thom-dani Dec 1, 2025
26d656f
fix bug cache update bis
thom-dani Dec 1, 2025
436c4d7
[stochasticGradient] Updated defaulting warning
julien-tierny Dec 3, 2025
4c23db1
Merge branch 'dev' of https://github.com/topology-tool-kit/ttk into s…
julien-tierny Dec 3, 2025
d8c23a7
[stochasticGradient] Updated ChangeLog
julien-tierny Dec 3, 2025
7a5be26
[stochasticGradient] seed initialization
julien-tierny Dec 3, 2025
9c5a463
fix cache update bug 3
thom-dani Dec 4, 2025
183d6b1
comments deleted
thom-dani Dec 4, 2025
502ac28
frist run attribute taken out
thom-dani Dec 4, 2025
ab3f1ad
warning about cache behavior
thom-dani Dec 5, 2025
859b07d
Merge branch 'dev' of https://github.com/topology-tool-kit/ttk into s…
julien-tierny Dec 31, 2025
b5bb415
[stocGrad] adjusted messages
julien-tierny Dec 31, 2025
eec8dc3
[stochGrad] clang-format17 edits
julien-tierny Dec 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Cycle-aware dimensionality reduction (TopoAE++)
- Distributed computation of persistent homology! (IEEE TPDS 2025)
- New backend for TrackingFromFields (critical point based)
- Stochastic discrete gradient (IEEE VIS 2012)
- Fast planar Rips filtration persistence computation
- Migration to ParaView 6
- CI updates
Expand Down
1 change: 1 addition & 0 deletions core/base/discreteGradient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ ttk_add_base_library(discreteGradient
DiscreteGradient_Template.h
DEPENDS
triangulation
ftmTree
)
52 changes: 52 additions & 0 deletions core/base/discreteGradient/DiscreteGradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,58 @@ int DiscreteGradient::setManifoldSize(
return 0;
}

void DiscreteGradient::computeDerivatives(
const SimplexId &x,
const std::vector<SimplexId> &stencilIds,
const std::array<float, 3> &xCoords,
const std::vector<std::array<float, 3>> &stencilCoords,
double (&grad)[3]) {

const double *scalars
= static_cast<double const *>(this->inputScalarField_.first);
if(stencilIds[0] != -1 && stencilIds[1] != -1)
grad[0] = -(scalars[stencilIds[0]] - scalars[stencilIds[1]])
/ std::abs(stencilCoords[0][0] - stencilCoords[1][0]);
else if(stencilIds[0] != -1 && stencilIds[1] == -1)
grad[0] = -(scalars[stencilIds[0]] - scalars[x])
/ std::abs(stencilCoords[0][0] - xCoords[0]);
else if(stencilIds[1] != -1 && stencilIds[0] == -1)
grad[0] = -(scalars[x] - scalars[stencilIds[1]])
/ std::abs(stencilCoords[1][0] - xCoords[0]);
if(stencilIds[2] != -1 && stencilIds[3] != -1)
grad[1] = -(scalars[stencilIds[2]] - scalars[stencilIds[3]])
/ std::abs(stencilCoords[2][1] - stencilCoords[3][1]);
else if(stencilIds[2] != -1 && stencilIds[3] == -1)
grad[1] = -(scalars[stencilIds[2]] - scalars[x])
/ std::abs(stencilCoords[2][1] - xCoords[1]);
else if(stencilIds[3] != -1 && stencilIds[2] == -1)
grad[1] = -(scalars[x] - scalars[stencilIds[3]])
/ std::abs(stencilCoords[3][1] - xCoords[1]);
if(stencilIds[4] != -1 && stencilIds[5] != -1)
grad[2] = -(scalars[stencilIds[4]] - scalars[stencilIds[5]])
/ std::abs(stencilCoords[4][2] - stencilCoords[5][2]);
else if(stencilIds[4] != -1 && stencilIds[5] == -1)
grad[2] = -(scalars[stencilIds[4]] - scalars[x])
/ std::abs(stencilCoords[4][2] - xCoords[2]);
else if(stencilIds[5] != -1 && stencilIds[4] == -1)
grad[2] = -(scalars[x] - scalars[stencilIds[5]])
/ std::abs(stencilCoords[5][2] - xCoords[2]);
}

int DiscreteGradient::getCriticalPointMap(
const vector<pair<SimplexId, char>> &criticalPoints, vector<char> &isPL) {
isPL.resize(numberOfVertices_);
std::fill(isPL.begin(), isPL.end(), 0);
for(pair<SimplexId, char> criticalPoint : criticalPoints) {
const SimplexId criticalPointId = criticalPoint.first;
const char criticalPointType = criticalPoint.second;

isPL[criticalPointId] = criticalPointType;
}

return 0;
}

#ifdef TTK_ENABLE_MPI
void DiscreteGradient::setCellToGhost(const int cellDim,
const SimplexId cellId) {
Expand Down
Loading
Loading