Commit 3ef5f3a3 authored by Nick Draper's avatar Nick Draper
Browse files

clang formatting re #15450

parent 1c21c454
......@@ -390,10 +390,10 @@ MatrixWorkspace::getSpectrumToWorkspaceIndexVector(specnum_t &offset) const {
// Find the min/max spectra IDs
specnum_t min = std::numeric_limits<specnum_t>::max(); // So that any number
// will be less than this
// will be less than this
specnum_t max = -std::numeric_limits<specnum_t>::max(); // So that any number
// will be greater than
// this
// will be greater than
// this
size_t length = ax->length();
for (size_t i = 0; i < length; i++) {
specnum_t spec = ax->spectraNo(i);
......
......@@ -123,7 +123,8 @@ public:
const size_t nhist(10);
testWS.initialize(nhist, 1, 1);
for (size_t i = 0; i < testWS.getNumberHistograms(); i++) {
TS_ASSERT_EQUALS(testWS.getSpectrum(i)->getSpectrumNo(), specnum_t(i + 1));
TS_ASSERT_EQUALS(testWS.getSpectrum(i)->getSpectrumNo(),
specnum_t(i + 1));
TS_ASSERT(testWS.getSpectrum(i)->hasDetectorID(detid_t(i)));
}
}
......
......@@ -326,8 +326,9 @@ void GeneratePeaks::importPeaksFromTable(
mapiter = functionmap.find(wsindex);
if (mapiter == functionmap.end()) {
std::vector<std::pair<double, API::IFunction_sptr>> tempvector;
std::pair<std::map<specnum_t, std::vector<std::pair<
double, API::IFunction_sptr>>>::iterator,
std::pair<std::map<specnum_t,
std::vector<std::pair<double, API::IFunction_sptr>>>::
iterator,
bool> ret;
ret = functionmap.emplace(wsindex, tempvector);
mapiter = ret.first;
......
......@@ -210,9 +210,9 @@ void GetEi::getGeometry(API::MatrixWorkspace_const_sptr WS, specnum_t mon0Spec,
std::vector<size_t> GetEi::getMonitorSpecIndexs(
API::MatrixWorkspace_const_sptr WS, specnum_t specNum1,
specnum_t specNum2) const { // getting spectra numbers from detector IDs is
// hard because the map works the other way,
// getting index numbers from spectra numbers has
// the same problem and we are about to do both
// hard because the map works the other way,
// getting index numbers from spectra numbers has
// the same problem and we are about to do both
// get the index number of the histogram for the first monitor
......@@ -220,7 +220,7 @@ std::vector<size_t> GetEi::getMonitorSpecIndexs(
auto wsInds = WS->getIndicesFromSpectra(specNumTemp);
if (wsInds.size() != 1) { // the monitor spectrum isn't present in the
// workspace, we can't continue from here
// workspace, we can't continue from here
g_log.error() << "Couldn't find the first monitor spectrum, number "
<< specNum1 << std::endl;
throw Exception::NotFoundError("GetEi::getMonitorSpecIndexs()", specNum1);
......@@ -230,7 +230,7 @@ std::vector<size_t> GetEi::getMonitorSpecIndexs(
specNumTemp[0] = specNum2;
auto wsIndexTemp = WS->getIndicesFromSpectra(specNumTemp);
if (wsIndexTemp.size() != 1) { // the monitor spectrum isn't present in the
// workspace, we can't continue from here
// workspace, we can't continue from here
g_log.error() << "Couldn't find the second monitor spectrum, number "
<< specNum2 << std::endl;
throw Exception::NotFoundError("GetEi::getMonitorSpecIndexs()", specNum2);
......
......@@ -237,7 +237,8 @@ API::Workspace_sptr LoadAscii::readData(std::ifstream &file) const {
if (haveXErrors)
localWorkspace->dataDx(i) = spectra[i].dataDx();
// Just have spectrum number start at 1 and count up
localWorkspace->getSpectrum(i)->setSpectrumNo(static_cast<specnum_t>(i) + 1);
localWorkspace->getSpectrum(i)
->setSpectrumNo(static_cast<specnum_t>(i) + 1);
}
return localWorkspace;
}
......
......@@ -1385,7 +1385,7 @@ void LoadEventNexus::makeMapToEventLists(std::vector<std::vector<T>> &vectors) {
Axis *ax1 = m_ws->getAxis(1);
specnum_t maxSpecNo =
-std::numeric_limits<specnum_t>::max(); // So that any number will be
// greater than this
// greater than this
for (size_t i = 0; i < ax1->length(); i++) {
specnum_t spec = ax1->spectraNo(i);
if (spec > maxSpecNo)
......
......@@ -260,7 +260,8 @@ void LoadNexusMonitors2::exec() {
}
// a temporary place to put the spectra/detector numbers
boost::scoped_array<specnum_t> spectra_numbers(new specnum_t[m_monitor_count]);
boost::scoped_array<specnum_t> spectra_numbers(
new specnum_t[m_monitor_count]);
boost::scoped_array<detid_t> detector_numbers(new detid_t[m_monitor_count]);
API::Progress prog3(this, 0.6, 1.0, m_monitor_count);
......@@ -517,10 +518,10 @@ bool LoadNexusMonitors2::allMonitorsHaveHistoData(
* @param spec_ids :: An array of spectrum numbers that the monitors have
* @param nmonitors :: The size of the det_ids and spec_ids arrays
*/
void LoadNexusMonitors2::fixUDets(boost::scoped_array<detid_t> &det_ids,
::NeXus::File &file,
const boost::scoped_array<specnum_t> &spec_ids,
const size_t nmonitors) const {
void LoadNexusMonitors2::fixUDets(
boost::scoped_array<detid_t> &det_ids, ::NeXus::File &file,
const boost::scoped_array<specnum_t> &spec_ids,
const size_t nmonitors) const {
try {
file.openGroup("isis_vms_compat", "IXvms");
} catch (::NeXus::Exception &) {
......
......@@ -384,8 +384,8 @@ void LoadRawHelper::setWorkspaceProperty(const std::string &propertyName,
void LoadRawHelper::setWorkspaceData(
DataObjects::Workspace2D_sptr newWorkspace,
const std::vector<boost::shared_ptr<MantidVec>> &timeChannelsVec,
int64_t wsIndex, specnum_t nspecNum, int64_t noTimeRegimes, int64_t lengthIn,
int64_t binStart) {
int64_t wsIndex, specnum_t nspecNum, int64_t noTimeRegimes,
int64_t lengthIn, int64_t binStart) {
if (!newWorkspace)
return;
typedef double (*uf)(double);
......
......@@ -50,7 +50,7 @@ void LoadTOFRawNexus::init() {
"spectrum_max is set.");
declareProperty(
new PropertyWithValue<specnum_t>("SpectrumMax", Mantid::EMPTY_INT(),
mustBePositive),
mustBePositive),
"The number of the last spectrum to read. Only used if explicitly\n"
"set.");
}
......
......@@ -331,7 +331,6 @@ public:
TS_ASSERT_EQUALS(*(ws->getSpectrum(1)->getDetectorIDs().begin()), 10);
TS_ASSERT(ws->getSpectrum(1)->hasDetectorID(10));
Mantid::specnum_t offset;
auto spectNum2WSInd = ws->getSpectrumToWorkspaceIndexVector(offset);
......@@ -383,7 +382,6 @@ public:
TS_ASSERT_EQUALS(ws->readY(18 - 9)[1], 1.);
TS_ASSERT_EQUALS(ws->getSpectrum(18 - 9)->getSpectrumNo(), 19);
Mantid::specnum_t offset;
auto spectNum2WSInd = ws->getSpectrumToWorkspaceIndexVector(offset);
TS_ASSERT_EQUALS(20 + offset + 1, spectNum2WSInd.size());
......
......@@ -244,7 +244,8 @@ NearestNeighbours::defaultNeighbours(const specnum_t spectrum) const {
* @param spectraMap :: A reference to the spectra map
* @returns A map of spectra number to detector pointer
*/
std::map<specnum_t, IDetector_const_sptr> NearestNeighbours::getSpectraDetectors(
std::map<specnum_t, IDetector_const_sptr>
NearestNeighbours::getSpectraDetectors(
boost::shared_ptr<const Instrument> instrument,
const ISpectrumDetectorMapping &spectraMap) {
std::map<specnum_t, IDetector_const_sptr> spectra;
......
......@@ -434,7 +434,8 @@ void ISISHistoDataListener::getData(int period, int index, int count,
workspace->setX(wi, m_bins[m_timeRegime]);
MantidVec &y = workspace->dataY(wi);
MantidVec &e = workspace->dataE(wi);
workspace->getSpectrum(wi)->setSpectrumNo(index + static_cast<specnum_t>(i));
workspace->getSpectrum(wi)
->setSpectrumNo(index + static_cast<specnum_t>(i));
size_t shift = i * (numberOfBins + 1) + 1;
y.assign(dataBuffer.begin() + shift, dataBuffer.begin() + shift + y.size());
std::transform(y.begin(), y.end(), e.begin(), dblSqrt);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment