Skip to content

Commit

Permalink
refs #7454 Merging conflicts.
Browse files Browse the repository at this point in the history
Merge branch 'feature/7454_little_WinBugs' into develop

Conflicts:
	Code/Mantid/Framework/Geometry/src/Instrument.cpp
  • Loading branch information
abuts committed Jul 15, 2013
2 parents eeb0ebd + 5c93875 commit f29de34
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 52 deletions.
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/ExtractMaskToTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ namespace Algorithms
{
detid_t tmpid = minuend[i];
fiter = lower_bound(firstsubiter, subtrahend.end(), tmpid);
bool exist = *fiter == tmpid;
bool exist(false);
if (fiter != subtrahend.end())
exist = *fiter == tmpid;
if (!exist)
{
diff.push_back(tmpid);
Expand Down
76 changes: 39 additions & 37 deletions Code/Mantid/Framework/Algorithms/src/PDFFourierTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ transforms to

namespace Mantid
{
namespace Algorithms
{
namespace Algorithms
{

using std::string;

// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM( PDFFourierTransform)
DECLARE_ALGORITHM( PDFFourierTransform)

using namespace Mantid::Kernel;
using namespace Mantid::API;
using namespace Mantid::Kernel;
using namespace Mantid::API;

namespace { // anonymous namespace
/// Crystalline PDF
Expand All @@ -76,18 +76,18 @@ namespace Mantid
}

//----------------------------------------------------------------------------------------------
/** Constructor
*/
PDFFourierTransform::PDFFourierTransform()
{
}

//----------------------------------------------------------------------------------------------
/** Destructor
*/
PDFFourierTransform::~PDFFourierTransform()
{
}
/** Constructor
*/
PDFFourierTransform::PDFFourierTransform()
{
}

//----------------------------------------------------------------------------------------------
/** Destructor
*/
PDFFourierTransform::~PDFFourierTransform()
{
}

const std::string PDFFourierTransform::name() const
{
Expand All @@ -105,22 +105,22 @@ namespace Mantid
}

//----------------------------------------------------------------------------------------------
/// Sets documentation strings for this algorithm
void PDFFourierTransform::initDocs()
{
this->setWikiSummary("PDFFourierTransform() does Fourier transform from S(Q) to G(r), which is paired distribution function (PDF). G(r) will be stored in another named workspace.");
this->setOptionalMessage("Fourier transform from S(Q) to G(r), which is paired distribution function (PDF). G(r) will be stored in another named workspace.");
}

//----------------------------------------------------------------------------------------------
/** Initialize the algorithm's properties.
*/
void PDFFourierTransform::init() {
auto uv = boost::make_shared<API::WorkspaceUnitValidator>("MomentumTransfer");
/// Sets documentation strings for this algorithm
void PDFFourierTransform::initDocs()
{
this->setWikiSummary("PDFFourierTransform() does Fourier transform from S(Q) to G(r), which is paired distribution function (PDF). G(r) will be stored in another named workspace.");
this->setOptionalMessage("Fourier transform from S(Q) to G(r), which is paired distribution function (PDF). G(r) will be stored in another named workspace.");
}

//----------------------------------------------------------------------------------------------
/** Initialize the algorithm's properties.
*/
void PDFFourierTransform::init() {
auto uv = boost::make_shared<API::WorkspaceUnitValidator>("MomentumTransfer");

declareProperty(new WorkspaceProperty<> ("InputWorkspace", "", Direction::Input, uv),
S_OF_Q + ", " + S_OF_Q_MINUS_ONE + ", or " + Q_S_OF_Q_MINUS_ONE);
declareProperty(new WorkspaceProperty<> ("OutputWorkspace", "",
declareProperty(new WorkspaceProperty<> ("OutputWorkspace", "",
Direction::Output), "Result paired-distribution function");

// Set up input data type
Expand Down Expand Up @@ -185,10 +185,10 @@ namespace Mantid
return result;
}

//----------------------------------------------------------------------------------------------
/** Execute the algorithm.
*/
void PDFFourierTransform::exec() {
//----------------------------------------------------------------------------------------------
/** Execute the algorithm.
*/
void PDFFourierTransform::exec() {
// get input data
API::MatrixWorkspace_const_sptr inputWS = getProperty("InputWorkspace");
MantidVec inputQ = inputWS->dataX(0); // x for input
Expand Down Expand Up @@ -311,7 +311,9 @@ namespace Mantid
auto qmax_ptr = std::lower_bound(inputQ.begin(), inputQ.end(), qmax);
qmax_index = std::distance(inputQ.begin(), qmax_ptr);
}
g_log.notice() << "Adjusting to data: Qmin = " << inputQ[qmin_index] << " Qmax = " << inputQ[qmax_index] << "\n";
size_t qmi_out = qmax_index;
if (qmi_out == inputQ.size())qmi_out--; // prevent unit test problem under windows (and probably other hardly identified problem)
g_log.notice() << "Adjusting to data: Qmin = " << inputQ[qmin_index] << " Qmax = " << inputQ[qmi_out] << "\n";

// determine r axis for result
const double rmax = getProperty("RMax");
Expand Down Expand Up @@ -413,8 +415,8 @@ namespace Mantid

// set property
setProperty("OutputWorkspace", outputWS);
}
}

} // namespace Mantid
} // namespace Mantid
} // namespace Algorithms

29 changes: 15 additions & 14 deletions Code/Mantid/Framework/Geometry/src/Instrument/ParameterMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,20 +540,21 @@ namespace Mantid
{
const ComponentID id = comp->getComponentID();
pmap_cit it_found = m_map.find(id);
if( it_found->first && it_found != m_map.end() )
{
pmap_cit itr = m_map.lower_bound(id);
pmap_cit itr_end = m_map.upper_bound(id);
for( ; itr != itr_end; ++itr )
{
Parameter_sptr param = itr->second;
if( boost::iequals(param->type(), type) )
{
result = param;
break;
}
}
}
if(it_found != m_map.end() )
if (it_found->first)
{
pmap_cit itr = m_map.lower_bound(id);
pmap_cit itr_end = m_map.upper_bound(id);
for( ; itr != itr_end; ++itr )
{
Parameter_sptr param = itr->second;
if( boost::iequals(param->type(), type) )
{
result = param;
break;
}
}
}
}
}
return result;
Expand Down

0 comments on commit f29de34

Please sign in to comment.