Skip to content

Commit

Permalink
refs #4013 Fix conversion error. Second attempt.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Nov 3, 2011
1 parent d73d542 commit f2cfc76
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace Mantid
/// Query the NearestNeighbours object for a given spectrum index using a search radius
std::map<specid_t, double> getNeighbours(specid_t spec, const double radius) const;
/// Query the NearestNeighbours object for a given spectrum index using the direct number of nearest neighbours
std::map<specid_t, double> getNeighbours(specid_t spec, const unsigned int nNeighbours) const;
std::map<specid_t, double> getNeighbours(specid_t spec, const int nNeighbours) const;
//@}

/// Const access to the spectra-detector map
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ namespace Mantid
* @param nNeighbours :: unsigned int, number of neighbours to include.
* @return map of DetectorID to distance for the nearest neighbours
*/
std::map<specid_t, double> MatrixWorkspace::getNeighbours(specid_t spec, const unsigned int nNeighbours) const
std::map<specid_t, double> MatrixWorkspace::getNeighbours(specid_t spec, const int nNeighbours) const
{
if ( !m_nearestNeighbours )
{
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/NormaliseByVanadium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace Algorithms
{
MatrixWorkspace_sptr sampleWS = getProperty("SampleInputWorkspace");
MatrixWorkspace_sptr vanadiumWS = getProperty("VanadiumInputWorkspace");
unsigned int uNeighbours = static_cast<unsigned int>(getProperty("NumberOfNeighbours"));
int neighbours = getProperty("NumberOfNeighbours");
if(sampleWS->getXDimension()->getNBins() != vanadiumWS->getXDimension()->getNBins())
{
throw std::runtime_error("Sample and Vanadium workspaces do not have the same number of bins.");
Expand Down Expand Up @@ -92,7 +92,7 @@ namespace Algorithms
PARALLEL_CRITICAL(NearestNeighboursSearch)
{
//CPUTimer tim;
specIdMap = vanadiumWS->getNeighbours(inSpec, uNeighbours); //This is not threadsafe!
specIdMap = vanadiumWS->getNeighbours(inSpec, neighbours); //This is not threadsafe!
// std::cout << tim << " to get nearest neighbours." << std::endl;
}
std::map<specid_t, double>::iterator it = specIdMap.begin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace Mantid
std::map<specid_t, double> neighbours(const specid_t spectrum, const double radius=0.0) const;

// Neighbouring spectra by
std::map<specid_t, double> neighbours(const specid_t spectrum, bool force, const unsigned int numberofneighbours=8) const;
std::map<specid_t, double> neighbours(const specid_t spectrum, bool force, const int numberofneighbours=8) const;

private:
/// typedef for Graph object used to hold the calculated information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Mantid
* @return map of Detector ID's to distance
* @throw NotFoundError if component is not recognised as a detector
*/
std::map<specid_t, double> NearestNeighbours::neighbours(const specid_t spectrum, bool force, const unsigned int noNeighbours) const
std::map<specid_t, double> NearestNeighbours::neighbours(const specid_t spectrum, bool force, const int noNeighbours) const
{
if(force || m_noNeighbours != int(noNeighbours))
{
Expand Down

0 comments on commit f2cfc76

Please sign in to comment.