Skip to content

Commit

Permalink
last bit of std::random cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nyoungbq committed Oct 23, 2023
1 parent 8a163b3 commit 7172bd9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 23 deletions.
3 changes: 0 additions & 3 deletions src/Plugins/ComplexCore/test/MinNeighborsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
#include "complex/UnitTest/UnitTestCommon.hpp"
#include "complex/Utilities/Parsing/HDF5/Writers/FileWriter.hpp"

#include "complex/UnitTest/UnitTestCommon.hpp"

#include <catch2/catch.hpp>

#include <filesystem>
#include <random>
#include <string>

namespace fs = std::filesystem;
Expand Down
3 changes: 0 additions & 3 deletions src/Plugins/ITKImageProcessing/test/ITKImageWriterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

#include "ITKImageProcessing/Filters/ITKImageWriter.hpp"
#include "ITKImageProcessing/Filters/ITKImportImageStack.hpp"
#include "ITKImageProcessing/ITKImageProcessingPlugin.hpp"
#include "ITKImageProcessing/ITKImageProcessing_test_dirs.hpp"

#include "complex/Core/Application.hpp"
#include "complex/Parameters/GeneratedFileListParameter.hpp"
#include "complex/UnitTest/UnitTestCommon.hpp"
#include "complex/Utilities/Parsing/DREAM3D/Dream3dIO.hpp"

#include <filesystem>
#include <random>
#include <string>

namespace fs = std::filesystem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ Result<> EBSDSegmentFeatures::operator()()
m_FeatureIdsArray = m_DataStructure.getDataAs<Int32Array>(m_InputValues->featureIdsArrayPath);
m_FeatureIdsArray->fill(0); // initialize the output array with zeros

// Generate the random voxel indices that will be used for the seed points to start a new grain growth/agglomeration
auto totalPoints = m_QuatsArray->getNumberOfTuples();

const int64 rangeMin = 0;
const int64 rangeMax = static_cast<int64>(totalPoints - 1);
Int64Distribution distribution;
initializeStaticVoxelSeedGenerator(distribution, rangeMin, rangeMax);

execute(gridGeom);

IDataArray* activeArray = m_DataStructure.getDataAs<IDataArray>(m_InputValues->activeArrayPath);
Expand All @@ -63,6 +55,14 @@ Result<> EBSDSegmentFeatures::operator()()
// By default we randomize grains
if(m_InputValues->shouldRandomizeFeatureIds)
{
// Generate the random voxel indices that will be used for the seed points to start a new grain growth/agglomeration
auto totalPoints = m_QuatsArray->getNumberOfTuples();

const int64 rangeMin = 0;
const auto rangeMax = static_cast<int64>(totalPoints - 1);
Int64Distribution distribution;
initializeStaticVoxelSeedGenerator(distribution, rangeMin, rangeMax);

totalPoints = gridGeom->getNumberOfCells();
randomizeFeatureIds(m_FeatureIdsArray, totalPoints, totalFeatures, distribution);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "EbsdLib/LaueOps/LaueOps.h"

#include <random>
#include <vector>

namespace complex
Expand Down Expand Up @@ -42,8 +41,6 @@ struct ORIENTATIONANALYSIS_EXPORT EBSDSegmentFeaturesInputValues
class ORIENTATIONANALYSIS_EXPORT EBSDSegmentFeatures : public SegmentFeatures
{
public:
using SeedGenerator = std::mt19937_64;
using Int64Distribution = std::uniform_int_distribution<int64>;
using FeatureIdsArrayType = Int32Array;

EBSDSegmentFeatures(DataStructure& dataStructure, const IFilter::MessageHandler& mesgHandler, const std::atomic_bool& shouldCancel, EBSDSegmentFeaturesInputValues* inputValues);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
#include "GroupFeatures.hpp"

#include "complex/DataStructure/DataArray.hpp"
#include "complex/DataStructure/DataGroup.hpp"
#include "complex/DataStructure/DataStore.hpp"
#include "complex/DataStructure/NeighborList.hpp"

#include <chrono>
#include <random>

using namespace complex;

// -----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion src/complex/Utilities/SampleSurfaceMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "complex/Utilities/StringUtilities.hpp"

#include <chrono>
#include <random>

using namespace complex;

Expand Down

0 comments on commit 7172bd9

Please sign in to comment.