Skip to content

Commit

Permalink
ENH: Use std::unordered_map for VoxelComplex in thin.
Browse files Browse the repository at this point in the history
Optimization (~10%)
  • Loading branch information
phcerdan committed Nov 29, 2018
1 parent a4bdd20 commit 22f42ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpp-scripts/thin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
#include <DGtal/io/boards/Board2D.h>
#include <DGtal/topology/CubicalComplex.h>
#include <DGtal/topology/CubicalComplexFunctions.h>
#include "DGtal/topology/KhalimskyCellHashFunctions.h"

#include <DGtal/topology/VoxelComplexNoObject.h>
#include <DGtal/topology/VoxelComplexNoObjectFunctions.h>
#include "DGtal/topology/NeighborhoodConfigurations.h"
#include "DGtal/topology/tables/NeighborhoodTables.h"
// ITKWriter
#include <itkImageFileWriter.h>
#include "itkImageFileWriter.h"
#include "itkChangeInformationImageFilter.h"

// Invert
Expand Down Expand Up @@ -209,11 +210,11 @@ int main(int argc, char* const argv[]){

// Create a VoxelComplexNoObject from the set
using DigitalTopology = DT26_6;
using DigitalSet =
using DigitalSet = // DGtal::Z3i::DigitalSet;
DGtal::DigitalSetByAssociativeContainer<Domain ,
std::unordered_set< typename Domain::Point> >;
using Complex =
DGtal::VoxelComplexNoObject<KSpace>;
using ComplexMap = std::unordered_map<KSpace::Cell, DGtal::CubicalCellData>;
using Complex = DGtal::VoxelComplexNoObject<KSpace, ComplexMap>;

auto & sk = sk_string;
KSpace ks;
Expand Down

0 comments on commit 22f42ff

Please sign in to comment.