Skip to content

Commit

Permalink
Merge branch 'master' into feature/10298_densityofstates_ui
Browse files Browse the repository at this point in the history
Conflicts:
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSimulation.cpp

Refs #10298
  • Loading branch information
DanNixon committed Feb 5, 2015
2 parents c6ac447 + bbccd6b commit 42606e9
Show file tree
Hide file tree
Showing 209 changed files with 11,996 additions and 9,243 deletions.
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
@@ -1,14 +1,13 @@
The [developer documentation](http://www.mantidproject.org/Category:Development) has information on how to participate in the mantid project as a developer. This document is meant to outline the steps for contributing to mantid without becomming a developer.
The [developer documentation](http://www.mantidproject.org/Category:Development) has information on how to participate in the mantid project as a developer. This document is meant to outline the steps for contributing to mantid without becomming a developer. We aspire to have similar guidelines as [github](https://github.com/blog/1943-how-to-write-the-perfect-pull-request).

1. [Fork](https://help.github.com/articles/fork-a-repo) the repository.
2. Make changes as you see fit. Please still follow the guidelines for [running the unit tests](http://www.mantidproject.org/Running_the_unit_tests) and the [build servers](http://www.mantidproject.org/The_automated_build_process).
3. Before submitting pull requests email mantid-help@mantidproject.org, and a developer will set up a branch that you can submit pull requests to.
4. Submit a [pull request](https://help.github.com/articles/using-pull-requests) to this branch.
4. Submit a [pull request](https://help.github.com/articles/using-pull-requests) to this branch. This is a start to the conversation.
3. (Optional) email mantid-help@mantidproject.org requests to.


Hints to make the integration of your changes easy:
Hints to make the integration of your changes easy (and happen faster):
- Keep your pull requests small
- Some comments are part of the build server infrastructure (e.g. 'test this please')
- Don't forget your unit tests
- All algorithms need documentation, don't forget the .rst file
- Contact us before creating the pull request
- Don't take changes requests to change your code personally
3 changes: 1 addition & 2 deletions Code/Mantid/Framework/API/src/IPowderDiffPeakFunction.cpp
Expand Up @@ -10,7 +10,6 @@
#include <cmath>

const double IGNOREDCHANGE = 1.0E-9;
const double PI = 3.14159265358979323846264338327950288419716939937510582;

namespace Mantid {
namespace API {
Expand Down Expand Up @@ -271,7 +270,7 @@ std::complex<double> E1(std::complex<double> z) {
exp_e1 = exp_e1 * exp(-z);
if (rz < 0.0 && fabs(imag(z)) < 1.0E-10) {
std::complex<double> u(0.0, 1.0);
exp_e1 = exp_e1 - (PI * u);
exp_e1 = exp_e1 - (M_PI * u);
}
}

Expand Down
6 changes: 4 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/RayTracerTester.cpp
Expand Up @@ -6,6 +6,8 @@
#include "MantidKernel/System.h"
#include "MantidKernel/V3D.h"

#include <cmath>

using namespace Mantid::Kernel;
using namespace Mantid::API;
using namespace Mantid::DataObjects;
Expand Down Expand Up @@ -66,9 +68,9 @@ void RayTracerTester::exec() {
Progress prog(this, 0.3, 1.0, NumAzimuth);
for (int iaz = 0; iaz < NumAzimuth; iaz++) {
prog.report();
double az = double(iaz) * 3.14159 * 2.0 / double(NumAzimuth);
double az = double(iaz) * M_PI * 2.0 / double(NumAzimuth);
for (int iz = 0; iz < NumZenith; iz++) {
double zen = double(iz) * 3.14159 * 1.0 / double(NumZenith);
double zen = double(iz) * M_PI / double(NumZenith);
double x = cos(az);
double z = sin(az);
double y = cos(zen);
Expand Down
Expand Up @@ -19,6 +19,7 @@
#include "MantidGeometry/Instrument/Component.h"
#include "MantidDataHandling/LoadEmptyInstrument.h"
#include "MantidGeometry/Instrument/ComponentHelper.h"
#include <cmath>
#include <stdexcept>


Expand Down Expand Up @@ -227,7 +228,7 @@ class CopyInstrumentParametersTestPerformance : public CxxTest::TestSuite
for(size_t i=0;i<n_detectors;i++)
{
IComponent_const_sptr det =instrument->getDetector(static_cast<Mantid::detid_t>(i+1));
Geometry::ComponentHelper::moveComponent(*det, *pmap, V3D(sin(3.1415926*double(i)),cos(3.1415926*double(i/500)),7), Absolute );
Geometry::ComponentHelper::moveComponent(*det, *pmap, V3D(sin(M_PI*double(i)),cos(M_PI*double(i/500)),7), Absolute );
}

// Create output workspace with another parameterized instrument and put into data store
Expand Down Expand Up @@ -285,8 +286,8 @@ class CopyInstrumentParametersTestPerformance : public CxxTest::TestSuite
int id = deto1->getID();
V3D newPos1 = deto1->getPos();
TS_ASSERT_EQUALS( id, i+1);
TS_ASSERT_DELTA( newPos1.X() ,sin(3.1415926*double(i)), 0.0001);
TS_ASSERT_DELTA( newPos1.Y() ,cos(3.1415926*double(i/500)), 0.0001);
TS_ASSERT_DELTA( newPos1.X() ,sin(M_PI*double(i)), 0.0001);
TS_ASSERT_DELTA( newPos1.Y() ,cos(M_PI*double(i/500)), 0.0001);
TS_ASSERT_DELTA( newPos1.Z() , 7, 1.e-6);

}
Expand Down
11 changes: 6 additions & 5 deletions Code/Mantid/Framework/Algorithms/test/CorrectFlightPathsTest.h
Expand Up @@ -11,6 +11,7 @@
#include "MantidKernel/ArrayProperty.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/IAlgorithm.h"
#include <cmath>

using namespace Mantid::API;
using namespace Mantid;
Expand Down Expand Up @@ -46,13 +47,13 @@ class CorrectFlightPathsTest: public CxxTest::TestSuite {
std::string outputWSName("test_output_ws");

std::vector<double> L2(5, 5);
std::vector<double> polar(5, (30. / 180.) * 3.1415926);
std::vector<double> polar(5, (30. / 180.) * M_PI);
polar[0] = 0;
std::vector<double> azimutal(5, 0);
azimutal[1] = (45. / 180.) * 3.1415936;
azimutal[2] = (90. / 180.) * 3.1415936;
azimutal[3] = (135. / 180.) * 3.1415936;
azimutal[4] = (180. / 180.) * 3.1415936;
azimutal[1] = (45. / 180.) * M_PI;
azimutal[2] = (90. / 180.) * M_PI;
azimutal[3] = (135. / 180.) * M_PI;
azimutal[4] = (180. / 180.) * M_PI;

int numBins = 10;
Mantid::API::MatrixWorkspace_sptr dataws = WorkspaceCreationHelper::createProcessedInelasticWS(L2, polar,
Expand Down
12 changes: 5 additions & 7 deletions Code/Mantid/Framework/Algorithms/test/ExportTimeSeriesLogTest.h
Expand Up @@ -4,8 +4,11 @@
#include <cxxtest/TestSuite.h>
#include "MantidKernel/Timer.h"
#include "MantidKernel/System.h"
#include <cmath>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <Poco/File.h>

#include "MantidAlgorithms/ExportTimeSeriesLog.h"
#include "MantidDataObjects/EventWorkspace.h"
Expand All @@ -21,10 +24,6 @@
#include "MantidDataHandling/LoadInstrument.h"
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidKernel/UnitFactory.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <Poco/File.h>

using namespace Mantid;
using namespace Mantid::Algorithms;
Expand Down Expand Up @@ -164,7 +163,6 @@ class ExportTimeSeriesLogTest : public CxxTest::TestSuite
DataObjects::EventWorkspace_sptr createEventWorkspace()
{
using namespace WorkspaceCreationHelper;
double PI = 3.14159265;

// 1. Empty workspace
DataObjects::EventWorkspace_sptr eventws =
Expand Down Expand Up @@ -199,7 +197,7 @@ class ExportTimeSeriesLogTest : public CxxTest::TestSuite
while (curtime_ns < runstoptime_ns)
{
Kernel::DateAndTime curtime(curtime_ns);
double value = sin(PI*static_cast<double>(curtime_ns)/period*0.25);
double value = sin(M_PI*static_cast<double>(curtime_ns)/period*0.25);
sinlog->addValue(curtime, value);
curtime_ns += pulsetime_ns/4;
++ numevents;
Expand All @@ -214,7 +212,7 @@ class ExportTimeSeriesLogTest : public CxxTest::TestSuite
while (curtime_ns < runstoptime_ns)
{
Kernel::DateAndTime curtime(curtime_ns);
double value = sin(2*PI*static_cast<double>(curtime_ns)/period);
double value = sin(2*M_PI*static_cast<double>(curtime_ns)/period);
coslog->addValue(curtime, value);
curtime_ns += pulsetime_ns*2;
}
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Algorithms/test/FFTTest.h
@@ -1,6 +1,7 @@
#ifndef FFT_TEST_H_
#define FFT_TEST_H_

#include <cmath>
#include <cxxtest/TestSuite.h>

#include "MantidAlgorithms/FFT.h"
Expand All @@ -20,7 +21,7 @@ class FFTTest : public CxxTest::TestSuite
static FFTTest *createSuite() { return new FFTTest(); }
static void destroySuite( FFTTest *suite ) { delete suite; }

FFTTest():dX(0.2),PI(3.1415926535897932384626433832795),h(sqrt(PI/3)),a(PI*PI/3)
FFTTest():dX(0.2),h(sqrt(M_PI/3)),a(M_PI*M_PI/3)
{
}
~FFTTest()
Expand Down Expand Up @@ -446,7 +447,6 @@ class FFTTest : public CxxTest::TestSuite
}

const double dX;
const double PI;
const double h;
const double a;
};
Expand Down
12 changes: 5 additions & 7 deletions Code/Mantid/Framework/Algorithms/test/GenerateEventsFilterTest.h
Expand Up @@ -4,8 +4,11 @@
#include <cxxtest/TestSuite.h>
#include "MantidKernel/Timer.h"
#include "MantidKernel/System.h"
#include <cmath>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <Poco/File.h>

#include "MantidAlgorithms/GenerateEventsFilter.h"
#include "MantidDataObjects/EventWorkspace.h"
Expand All @@ -22,10 +25,6 @@
#include "MantidDataHandling/LoadInstrument.h"
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidKernel/UnitFactory.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <Poco/File.h>

using namespace Mantid;
using namespace Mantid::Algorithms;
Expand Down Expand Up @@ -413,7 +412,6 @@ class GenerateEventsFilterTest : public CxxTest::TestSuite
DataObjects::EventWorkspace_sptr createEventWorkspace()
{
using namespace WorkspaceCreationHelper;
double PI = 3.14159265;

// Empty workspace
DataObjects::EventWorkspace_sptr eventws =
Expand Down Expand Up @@ -447,7 +445,7 @@ class GenerateEventsFilterTest : public CxxTest::TestSuite
while (curtime_ns < runstoptime_ns)
{
Kernel::DateAndTime curtime(curtime_ns);
double value = sin(PI*static_cast<double>(curtime_ns)/period*0.25);
double value = sin(M_PI*static_cast<double>(curtime_ns)/period*0.25);
sinlog->addValue(curtime, value);
curtime_ns += pulsetime_ns/4;
}
Expand All @@ -460,7 +458,7 @@ class GenerateEventsFilterTest : public CxxTest::TestSuite
while (curtime_ns < runstoptime_ns)
{
Kernel::DateAndTime curtime(curtime_ns);
double value = sin(2*PI*static_cast<double>(curtime_ns)/period);
double value = sin(2*M_PI*static_cast<double>(curtime_ns)/period);
coslog->addValue(curtime, value);
curtime_ns += pulsetime_ns*2;
}
Expand Down
Expand Up @@ -4,8 +4,11 @@
#include <cxxtest/TestSuite.h>
#include "MantidKernel/Timer.h"
#include "MantidKernel/System.h"
#include <cmath>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <Poco/File.h>

#include "MantidAlgorithms/GetTimeSeriesLogInformation.h"
#include "MantidDataObjects/EventWorkspace.h"
Expand All @@ -21,10 +24,6 @@
#include "MantidDataHandling/LoadInstrument.h"
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidKernel/UnitFactory.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <Poco/File.h>

using namespace Mantid;
using namespace Mantid::Algorithms;
Expand Down Expand Up @@ -72,7 +71,6 @@ class GetTimeSeriesLogInformationTest : public CxxTest::TestSuite
DataObjects::EventWorkspace_sptr createEventWorkspace()
{
using namespace WorkspaceCreationHelper;
double PI = 3.14159265;

// 1. Empty workspace
DataObjects::EventWorkspace_sptr eventws =
Expand Down Expand Up @@ -108,7 +106,7 @@ class GetTimeSeriesLogInformationTest : public CxxTest::TestSuite
while (curtime_ns < runstoptime_ns)
{
Kernel::DateAndTime curtime(curtime_ns);
double value = sin(PI*static_cast<double>(curtime_ns)/period*0.25);
double value = sin(M_PI*static_cast<double>(curtime_ns)/period*0.25);
sinlog->addValue(curtime, value);
curtime_ns += pulsetime_ns/4;
}
Expand All @@ -121,7 +119,7 @@ class GetTimeSeriesLogInformationTest : public CxxTest::TestSuite
while (curtime_ns < runstoptime_ns)
{
Kernel::DateAndTime curtime(curtime_ns);
double value = sin(2*PI*static_cast<double>(curtime_ns)/period);
double value = sin(2*M_PI*static_cast<double>(curtime_ns)/period);
coslog->addValue(curtime, value);
curtime_ns += pulsetime_ns*2;
}
Expand Down
8 changes: 4 additions & 4 deletions Code/Mantid/Framework/Algorithms/test/RRFMuonTest.h
Expand Up @@ -5,6 +5,7 @@
#include "MantidAlgorithms/RRFMuon.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidAPI/Workspace.h"
#include <cmath>
#include <Poco/File.h>
#include <stdexcept>

Expand Down Expand Up @@ -104,16 +105,15 @@ class RRFMuonTest : public CxxTest::TestSuite
MatrixWorkspace_sptr createDummyWorkspace()
{
int nBins = 300;
double pi = 3.14159;
MatrixWorkspace_sptr ws = WorkspaceFactory::Instance().create("Workspace2D", 2, nBins+1, nBins);

for (int i=0; i<nBins; i++)
{
double x = i/static_cast<int>(nBins);
ws->dataX(0)[i] = x;
ws->dataY(0)[i] = cos(2*pi*x);
ws->dataY(0)[i] = cos(2*M_PI*x);
ws->dataX(1)[i] = x;
ws->dataY(1)[i] = sin(2*pi*x);
ws->dataY(1)[i] = sin(2*M_PI*x);
}

ws->dataX(0)[nBins] = nBins;
Expand All @@ -124,4 +124,4 @@ class RRFMuonTest : public CxxTest::TestSuite

};

#endif /* MANTID_ALGORITHMS_RRFMUON_H_ */
#endif /* MANTID_ALGORITHMS_RRFMUON_H_ */
11 changes: 5 additions & 6 deletions Code/Mantid/Framework/Algorithms/test/RealFFTTest.h
Expand Up @@ -2,6 +2,7 @@
#define REALFFT_TEST_H_

#include <cxxtest/TestSuite.h>
#include <cmath>

#include "MantidAlgorithms/FFT.h"
#include "MantidAPI/AnalysisDataService.h"
Expand Down Expand Up @@ -88,9 +89,8 @@ class RealFFTTest : public CxxTest::TestSuite
const MantidVec& Yr = fWS->readY(0);
const MantidVec& Yi = fWS->readY(1);

const double PI = 3.1415926535897932384626433832795;
double h = sqrt(PI/3);
double a = PI*PI/3;
double h = sqrt(M_PI/3);
double a = M_PI*M_PI/3;
double dx = 1/(XX);

for(int i=0;i<N/4;i++)
Expand Down Expand Up @@ -159,9 +159,8 @@ class RealFFTTest : public CxxTest::TestSuite
const MantidVec& Yr = fWS->readY(0);
const MantidVec& Yi = fWS->readY(1);

const double PI = 3.1415926535897932384626433832795;
double h = sqrt(PI/3);
double a = PI*PI/3;
double h = sqrt(M_PI/3);
double a = M_PI*M_PI/3;
double dx = 1/(XX);

for(int i=0;i<N/4;i++)
Expand Down
5 changes: 1 addition & 4 deletions Code/Mantid/Framework/Algorithms/test/SassenaFFTTest.h
Expand Up @@ -2,16 +2,13 @@
#define MANTID_ALGORITHMS_SASSENAFFTTEST_H_

#include <cxxtest/TestSuite.h>
#include <cmath>
#include "MantidAlgorithms/SassenaFFT.h"
#include "MantidKernel/UnitFactory.h"
#include "MantidDataHandling/SaveAscii.h"
#include "MantidAPI/FileProperty.h"
#include "MantidKernel/PhysicalConstants.h"

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

using namespace Mantid;

class SassenaFFTTest : public CxxTest::TestSuite
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/CurveFitting/src/Bk2BkExpConvPV.cpp
@@ -1,9 +1,9 @@
#include "MantidCurveFitting/Bk2BkExpConvPV.h"
#include "MantidKernel/System.h"
#include "MantidAPI/FunctionFactory.h"
#include <cmath>
#include <gsl/gsl_sf_erf.h>

#define PI 3.14159265358979323846264338327950288419716939937510582

using namespace Mantid::Kernel;
using namespace Mantid::API;
Expand Down Expand Up @@ -159,7 +159,7 @@ double Bk2BkExpConvPV::calOmega(double x, double eta, double N, double alpha,
if (eta < 1.0E-8) {
omega2 = 0.0;
} else {
omega2 = 2 * N * eta / PI * (imag(exp(p) * E1(p)) + imag(exp(q) * E1(q)));
omega2 = 2 * N * eta / M_PI * (imag(exp(p) * E1(p)) + imag(exp(q) * E1(q)));
}
double omega = omega1 + omega2;

Expand Down Expand Up @@ -206,7 +206,7 @@ std::complex<double> Bk2BkExpConvPV::E1(std::complex<double> z) const {
e1 = e1 * exp(-z);
if (rz < 0.0 && fabs(imag(z)) < 1.0E-10) {
complex<double> u(0.0, 1.0);
e1 = e1 - (PI * u);
e1 = e1 - (M_PI * u);
}
}

Expand Down

0 comments on commit 42606e9

Please sign in to comment.