Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/8614_letReduction
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Jan 13, 2014
2 parents 30d851b + 22d784f commit 3509771
Show file tree
Hide file tree
Showing 352 changed files with 14,509 additions and 9,633 deletions.
@@ -0,0 +1,105 @@
Name: mantid-developer
Version: 1.3
Release: 3%{?dist}
Summary: Meta Package to install dependencies for Mantid Development

Group: Development/Tools
License: GPL

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Requires: rpmfusion-nonfree-release
Requires: cmake-gui >= 2.8.5
Requires: boost-devel
Requires: gperftools-devel
Requires: gperftools-libs
Requires: gcc-c++
Requires: git-all
Requires: gsl-devel
Requires: hdf-devel
Requires: hdf5-devel
Requires: muParser-devel
Requires: mxml-devel
Requires: nexus >= 4.2
Requires: nexus-devel >= 4.2
Requires: numpy
Requires: OCE-devel
Requires: poco-devel
Requires: PyQt4-devel
Requires: python-devel
Requires: python-sphinx
Requires: qscintilla-devel
Requires: qt-devel >= 4.6
Requires: qwt5-qt4-devel
Requires: qwtplot3d-qt4-devel
Requires: redhat-lsb
Requires: rpmdevtools
Requires: sip-devel
Requires: git
Requires: openssl-devel
Requires: texlive-latex
Requires: dvipng
Requires: qt-devel
Requires: qt-assistant

BuildArch: noarch

%description
A virtual package which requires all the dependencies and tools that are
required for Mantid development.

%prep

%build

%install

%clean

%post
# Remove myself once I have installed all the required packages.
#rpm -e %{name}

%files

%changelog
* Fri Dec 20 2013 Stuart Campbell <campbellsi@ornl.gov>
- Added python-sphinx

* Thu Dec 19 2013 Stuart Campbell <campbellsi@ornl.gov>
- Changed to use OCE rather than OpenCASCADE.

* Tue Aug 20 2013 Peter Peterson <petersonpf@ornl.gov>
- Removed things not necessary for fedora 19.

* Tue May 07 2013 Stuart Campbell <campbellsi@ornl.gov>
- Added dvipng and latex for qt-assistant stuff
- Added software collection dependencies

* Thu Jun 7 2012 Russell Taylor <taylorrj@ornl.gov>
- Remove gmock & gtest now that we include them in our repo
- Remove subversion dependency now that we use git

* Mon Mar 19 2012 Stuart Campbell <campbellsi@ornl.gov>
- Updated for google-perftools -> gperftools package rename.

* Wed Feb 22 2012 Stuart Campbell <campbellsi@ornl.gov>
- Added nexus as it is not required by it's devel package.

* Wed Feb 22 2012 Stuart Campbell <campbellsi@ornl.gov>
- Added git as a dependency
- Added openssl-devel dependency

* Mon Feb 20 2012 Stuart Campbell <campbellsi@ornl.gov>
- Added dependency on NeXus development after nexus rpm split.
- Updated CMake dependency to 2.8.5 following 'the virus'!
- Added Google Mock and GTest.

* Fri Jun 3 2011 Stuart Campbell <campbellsi@ornl.gov>
- Added rpmdevtools and lsb dependencies

* Fri Jun 3 2011 Stuart Campbell <campbellsi@ornl.gov>
- Added versions for some packages

* Fri Jun 3 2011 Stuart Campbell <campbellsi@ornl.gov>
- Initial release
38 changes: 28 additions & 10 deletions Code/Mantid/Framework/API/inc/MantidAPI/FunctionFactory.h
Expand Up @@ -8,9 +8,11 @@
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/DynamicFactory.h"
#include "MantidKernel/SingletonHolder.h"
#include "MantidKernel/MultiThreaded.h"

#include <boost/shared_ptr.hpp>


namespace Mantid
{

Expand Down Expand Up @@ -76,7 +78,13 @@ namespace API

/// Query available functions based on the template type
template<typename FunctionType>
std::vector<std::string> getFunctionNames() const;
const std::vector<std::string>& getFunctionNames() const;

using Kernel::DynamicFactory<IFunction>::subscribe;
void subscribe(const std::string& className, AbstractFactory* pAbstractFactory,
Kernel::DynamicFactory<IFunction>::SubscribeAction replace=ErrorIfExists);

void unsubscribe(const std::string& className);

private:
friend struct Mantid::Kernel::CreateUsingNew<FunctionFactoryImpl>;
Expand Down Expand Up @@ -116,9 +124,11 @@ namespace API
/// Add a tie to the created function
void addTie(boost::shared_ptr<IFunction> fun,const Expression& expr)const;

///static reference to the logger class
/// Reference to the logger class
Kernel::Logger& g_log;

mutable std::map<std::string,std::vector<std::string>> m_cachedFunctionNames;
mutable Kernel::Mutex m_mutex;
};

/**
Expand All @@ -127,13 +137,20 @@ namespace API
* @returns A vector of the names of the functions matching the template type
*/
template<typename FunctionType>
std::vector<std::string> FunctionFactoryImpl::getFunctionNames() const
const std::vector<std::string>& FunctionFactoryImpl::getFunctionNames() const
{
Kernel::Mutex::ScopedLock _lock(m_mutex);

const std::string soughtType(typeid(FunctionType).name());
if ( m_cachedFunctionNames.find( soughtType ) != m_cachedFunctionNames.end() )
{
return m_cachedFunctionNames[soughtType];
}

// Create the entry in the cache and work with it directly
std::vector<std::string>& typeNames = m_cachedFunctionNames[soughtType];
const std::vector<std::string> names = this->getKeys();
std::vector<std::string> typeNames;
typeNames.reserve(names.size());
for( std::vector<std::string>::const_iterator it = names.begin();
it != names.end(); ++it )
for( auto it = names.begin(); it != names.end(); ++it )
{
boost::shared_ptr<IFunction> func = this->createFunction(*it);
if ( func && dynamic_cast<FunctionType*>(func.get()) )
Expand All @@ -143,12 +160,13 @@ namespace API
}
return typeNames;
}
///Forward declaration of a specialisation of SingletonHolder for AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it.

///Forward declaration of a specialisation of SingletonHolder for AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it.
#ifdef _WIN32
// this breaks new namespace declaraion rules; need to find a better fix
template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<FunctionFactoryImpl>;
template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<FunctionFactoryImpl>;
#endif /* _WIN32 */
typedef MANTID_API_DLL Mantid::Kernel::SingletonHolder<FunctionFactoryImpl> FunctionFactory;
typedef MANTID_API_DLL Mantid::Kernel::SingletonHolder<FunctionFactoryImpl> FunctionFactory;

/// Convenient typedef for an UpdateNotification
typedef FunctionFactoryImpl::UpdateNotification FunctionFactoryUpdateNotification;
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/FunctionProperty.h
Expand Up @@ -12,7 +12,6 @@

#include <boost/shared_ptr.hpp>

#include <iostream>
#include <string>

namespace Mantid
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/ICatalog.h
Expand Up @@ -67,6 +67,8 @@ class DLLExport ICatalog
virtual void getFileLocation(const long long&,std::string& )=0;
/// get URLs of the files
virtual void getDownloadURL(const long long& fileid,std::string&)=0;
/// get URL of where to PUT (publish) files.
virtual const std::string getUploadURL(const std::string &fileName, const std::string &dataFileName)=0;
/// keep alive
virtual void keepAlive()=0;
///keep alive in minutes
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/API/inc/MantidAPI/IMDHistoWorkspace.h
Expand Up @@ -45,9 +45,9 @@ namespace API

/// See the MDHistoWorkspace definition for descriptions of these
virtual coord_t getInverseVolume() const = 0;
virtual signal_t * getSignalArray() = 0;
virtual signal_t * getErrorSquaredArray() = 0;
virtual signal_t * getNumEventsArray() = 0;
virtual signal_t * getSignalArray() const = 0;
virtual signal_t * getErrorSquaredArray() const = 0;
virtual signal_t * getNumEventsArray() const = 0;
virtual void setTo(signal_t signal, signal_t errorSquared, signal_t numEvents) = 0;
virtual Mantid::Kernel::VMD getCenter(size_t linearIndex) const = 0;
virtual void setSignalAt(size_t index, signal_t value) = 0;
Expand Down
1 change: 1 addition & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/IMDNode.h
Expand Up @@ -177,6 +177,7 @@ class IMDNode
* @param length :: length of cylinder below which to integrate
* @param signal [out] :: set to the integrated signal
* @param errorSquared [out] :: set to the integrated squared error.
* @param signal_fit [out] :: array of values for the fit.
*/
virtual void integrateCylinder(Mantid::API::CoordTransform & radiusTransform, const coord_t radius, const coord_t length, signal_t & signal, signal_t & errorSquared, std::vector<signal_t> & signal_fit) const = 0;

Expand Down
Expand Up @@ -12,7 +12,6 @@
#include "MantidKernel/Exception.h"
#include "MantidAPI/WorkspaceGroup.h"

#include <iostream>
#include <string>

namespace Mantid
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/src/FileLoaderRegistry.cpp
Expand Up @@ -23,7 +23,7 @@ namespace Mantid
{
void apply(Kernel::FileDescriptor & descriptor) { descriptor.resetStreamToStart(); }
};
///endcond
/// @endcond

/**
* @param filename A string giving a filename
Expand Down Expand Up @@ -79,7 +79,7 @@ namespace Mantid
/**
* If the name does not exist then it does nothing
* @param name Name of the algorithm to remove from the search list
* @aparam version An optional version to remove. -1 indicates remove all (Default=-1)
* @param version An optional version to remove. -1 indicates remove all (Default=-1)
*/
void FileLoaderRegistryImpl::unsubscribe(const std::string &name, const int version)
{
Expand Down
14 changes: 14 additions & 0 deletions Code/Mantid/Framework/API/src/FunctionFactory.cpp
Expand Up @@ -335,6 +335,20 @@ namespace Mantid
}
}

void FunctionFactoryImpl::subscribe(const std::string& className, AbstractFactory* pAbstractFactory,
Kernel::DynamicFactory<IFunction>::SubscribeAction replace)
{
// Clear the cache, then do all the work in the base class method
m_cachedFunctionNames.clear();
Kernel::DynamicFactory<IFunction>::subscribe(className,pAbstractFactory,replace);
}

void FunctionFactoryImpl::unsubscribe(const std::string& className)
{
// Clear the cache, then do all the work in the base class method
m_cachedFunctionNames.clear();
Kernel::DynamicFactory<IFunction>::unsubscribe(className);
}

} // namespace API
} // namespace Mantid
77 changes: 0 additions & 77 deletions Code/Mantid/Framework/API/src/IPowderDiffPeakFunction.cpp
Expand Up @@ -213,83 +213,6 @@ namespace API
return;
}

//----------------------------------------------------------------------------------------------
/** General implementation of the method for all peaks. Limits the peak evaluation to
* a certain number of FWHMs around the peak centre. The outside points are set to 0.
* Calls functionLocal() to compute the actual values
* @param out :: Output function values
* @param xValues :: X values for data points
* @param nData :: Number of data points
void IPowderDiffPeakFunction::functionLocal(double* out, const double* xValues, const size_t nData)const
{
double c = this->centre();
double dx = fabs(s_peakRadius*this->fwhm());
int i0 = -1;
int n = 0;
for(size_t i = 0; i < nData; ++i)
{
if (fabs(xValues[i] - c) < dx)
{
if (i0 < 0) i0 = static_cast<int>(i);
++n;
}
else
{
out[i] = 0.0;
}
}
if (i0 < 0 || n == 0)
return;
this->functionLocal(out+i0, xValues+i0, n);
return;
}
*/

//----------------------------------------------------------------------------------------------
/** General implementation of the method for all peaks. Calculates derivatives only
* for a range of x values limited to a certain number of FWHM around the peak centre.
* For the points outside the range all derivatives are set to 0.
* Calls functionDerivLocal() to compute the actual values
* @param out :: Derivatives
* @param xValues :: X values for data points
* @param nData :: Number of data points
void IPowderDiffPeakFunction::functionDeriv1D(Jacobian* out, const double* xValues, const size_t nData) const
{
double c = this->centre();
double dx = fabs(s_peakRadius*this->fwhm());
int i0 = -1;
int n = 0;
for(size_t i = 0; i < nData; ++i)
{
if (fabs(xValues[i] - c) < dx)
{
if (i0 < 0) i0 = static_cast<int>(i);
++n;
}
else
{
for(size_t ip = 0; ip < this->nParams(); ++ip)
{
out->set(i,ip, 0.0);
}
}
}
if (i0 < 0 || n == 0) return;
#if 0
PartialJacobian1 J(out,i0);
this->functionDerivLocal(&J,xValues+i0,n);
#else
throw runtime_error("Need to think how to implement! Message 1026.");
#endif
return;
}
*/

//----------------------------------------------------------------------------------------------
/** Set peak radius
* @param r :: radius
Expand Down

0 comments on commit 3509771

Please sign in to comment.