Skip to content

Commit

Permalink
Merge pull request #1043 from MohamedKISSI/topologicalOptimization
Browse files Browse the repository at this point in the history
add Topological Optimization code
  • Loading branch information
julien-tierny authored Sep 3, 2024
2 parents 9bfe75f + fbd2e90 commit fcd1e70
Show file tree
Hide file tree
Showing 11 changed files with 2,423 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ jobs:
- name: Create & configure TTK build directory
shell: cmd
run: |
set CMAKE_PREFIX_PATH=%CONDA_ROOT%\Library\lib\cmake;%CONDA_ROOT%\Library\share\eigen3\cmake;%CONDA_ROOT%\Library\share\Qull\cmake;%CONDA_ROOT%\Library\cmake;%ProgramFiles%\TTK-ParaView\lib\cmake
set CMAKE_PREFIX_PATH=%CONDA_ROOT%\Library\lib\cmake;%CONDA_ROOT%\Library\share\eigen3\cmake;%CONDA_ROOT%\Library\share\Qull\cmake;%CONDA_ROOT%\Library\cmake;%ProgramFiles%\TTK-ParaView\lib\cmake;
set CC=clang-cl.exe
set CXX=clang-cl.exe
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,46 @@ namespace ttk {
return this->distances;
}

void setTimeLimit(double timeLimit) {
this->TimeLimit = timeLimit;
}

void setForceUseOfAlgorithm(bool forceUseOfAlgorithm) {
this->ForceUseOfAlgorithm = forceUseOfAlgorithm;
}

void setDeltaLim(double DeltaLimNew) {
this->DeltaLim = DeltaLimNew;
}

void setUseAdditionalPrecision(bool Precision) {
this->UseAdditionalPrecision = Precision;
}

void setUseProgressive(bool UseProgressive_) {
this->UseProgressive = UseProgressive_;
}

void setUseInterruptible(bool UseInterruptible_) {
this->UseInterruptible = UseInterruptible_;
}

void setDeterministic(bool Deterministic_) {
this->Deterministic = Deterministic_;
}

void setAlpha(double Alpha_) {
this->Alpha = Alpha_;
}

void setUseAccelerated(bool UseAccelerated_) {
this->UseAccelerated = UseAccelerated_;
}

void setUseKmeansppInit(bool UseKmeansppInit_) {
this->UseKmeansppInit = UseKmeansppInit_;
}

protected:
// Critical pairs used for clustering
// 0:min-saddles ; 1:saddles-saddles ; 2:sad-max ; else : all
Expand Down
17 changes: 17 additions & 0 deletions core/base/topologicalOptimization/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ttk_add_base_library(topologicalOptimization
SOURCES
TopologicalOptimization.cpp
HEADERS
TopologicalOptimization.h
DEPENDS
triangulation
persistenceDiagram
persistenceDiagramClustering
)

if(TTK_ENABLE_TORCH)
target_include_directories(topologicalOptimization PUBLIC ${TORCH_INCLUDE_DIRS})
target_compile_options(topologicalOptimization PUBLIC "${TORCH_CXX_FLAGS}")
target_link_libraries(topologicalOptimization PUBLIC "${TORCH_LIBRARIES}")
target_compile_definitions(topologicalOptimization PUBLIC TTK_ENABLE_TORCH)
endif()
5 changes: 5 additions & 0 deletions core/base/topologicalOptimization/TopologicalOptimization.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <TopologicalOptimization.h>

ttk::TopologicalOptimization::TopologicalOptimization() {
this->setDebugMsgPrefix("TopologicalOptimization");
}
Loading

0 comments on commit fcd1e70

Please sign in to comment.