Skip to content

Commit

Permalink
refs #9428. Fix type conversion warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed May 12, 2014
1 parent c38ea5a commit 7e27b82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Crystal/src/FindClusterFaces.cpp
Expand Up @@ -51,7 +51,7 @@ namespace
}
LabelSet allowedLabels;
PeakClusterProjection projection(clusterImage);
for (size_t i = 0; i < filterWorkspace->rowCount(); ++i)
for (int i = 0; i < filterWorkspace->getNumberPeaks(); ++i)
{
IPeak& peak = filterWorkspace->getPeak(i);
const int labelIdAtPeakCenter = static_cast<int>(projection.signalAtPeakCenter(peak));
Expand Down Expand Up @@ -179,7 +179,7 @@ namespace Mantid
for (size_t i = 0; i < neighbours.size(); ++i)
{
size_t neighbourLinearIndex = neighbours[i];
const int neighbourId = clusterImage->getSignalAt(neighbourLinearIndex);
const int neighbourId = static_cast<int>(clusterImage->getSignalAt(neighbourLinearIndex));
if (neighbourId <= emptyLabelId)
{
// We have an edge!
Expand Down
16 changes: 8 additions & 8 deletions Code/Mantid/Framework/Crystal/test/FindClusterFacesTest.h
Expand Up @@ -388,8 +388,8 @@ class FindClusterFacesTest: public CxxTest::TestSuite
peak.setHKL(5, 5, 5); // Set HKL of peak
filterWS->addPeak(peak); // Add a single peak.

size_t nBins = 10;
size_t bulkSignalValue = 0;
const int nBins = 10;
const double bulkSignalValue = 0;
auto inWS = create_HKL_MDWS(min, max, nBins, bulkSignalValue);
inWS->setSignalAt(0, 2); // Cluster at linear index 0. No corresponding peak position.
inWS->setSignalAt(555, 1); // Cluster at linear index 125. Corresponds with peak position
Expand Down Expand Up @@ -420,8 +420,8 @@ class FindClusterFacesTest: public CxxTest::TestSuite
outOfBoundsPeak.setHKL(20, 20, 20); // Set HKL of peak
filterWS->addPeak(outOfBoundsPeak); // Add an out of bounds peak. Produces 0 faces.

size_t nBins = 10;
size_t bulkSignalValue = 0;
const int nBins = 10;
const double bulkSignalValue = 0;
auto inWS = create_HKL_MDWS(min, max, nBins, bulkSignalValue);
inWS->setSignalAt(0, 2); // Cluster at linear index 0. No corresponding peak position.
inWS->setSignalAt(555, 1); // Cluster at linear index 125. Corresponds with peak position
Expand Down Expand Up @@ -469,8 +469,8 @@ class FindClusterFacesTestPerformance: public CxxTest::TestSuite
const double max = 10; // HKL

Mantid::API::FrameworkManager::Instance();
size_t nBins = 100;
size_t bulkSignalValue = 0;
const int nBins = 100;
const double bulkSignalValue = 0;
m_inWS = create_HKL_MDWS(min, max, nBins, bulkSignalValue);

Instrument_sptr inst = ComponentCreationHelper::createTestInstrumentRectangular(1, 100, 0.05);
Expand All @@ -479,10 +479,10 @@ class FindClusterFacesTestPerformance: public CxxTest::TestSuite
//Add 50 cluster points and correspoinding peaks.
for (size_t i = 0; i < nBins; i += 2)
{
m_inWS->setSignalAt(i, i);
m_inWS->setSignalAt(i, static_cast<Mantid::signal_t>(i));

Peak peak(inst, 15050, 1.0);
peak.setHKL(i, 0, 0); // Set HKL of peak
peak.setHKL(double(i), 0, 0); // Set HKL of peak
m_filterWS->addPeak(peak); // Add a valid center peak. Produces 6 faces.
}

Expand Down

0 comments on commit 7e27b82

Please sign in to comment.