Mantid
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
VectorHelper.h File Reference
#include "MantidKernel/DllConfig.h"
#include <cmath>
#include <functional>
#include <stdexcept>
#include <vector>

Go to the source code of this file.

Classes

struct  Mantid::Kernel::VectorHelper::AddVariance< T >
 Functor to deal with the increase in the error when adding (or subtracting) a number of counts. More...
 
struct  Mantid::Kernel::VectorHelper::DividesNonNull< T >
 Divide functor with result reset to 0 if the denominator is null. More...
 
struct  Mantid::Kernel::VectorHelper::Log< T >
 Log functor. More...
 
struct  Mantid::Kernel::VectorHelper::LogNoThrow< T >
 
struct  Mantid::Kernel::VectorHelper::SimpleAverage< T >
 A binary functor to compute the simple average of 2 numbers. More...
 
struct  Mantid::Kernel::VectorHelper::Squares< T >
 Square functor. More...
 
struct  Mantid::Kernel::VectorHelper::SumGaussError< T >
 Functor used for computing the sum of the square values of a vector, using the accumulate algorithm. More...
 
struct  Mantid::Kernel::VectorHelper::SumSquares< T >
 Functor to accumulate a sum of squares. More...
 
struct  Mantid::Kernel::VectorHelper::TimesSquares< T >
 Functor giving the product of the squares of the arguments. More...
 

Namespaces

namespace  Mantid
 Helper class which provides the Collimation Length for SANS instruments.
 
namespace  Mantid::Kernel
 
namespace  Mantid::Kernel::VectorHelper
 

Functions

void MANTID_KERNEL_DLL Mantid::Kernel::VectorHelper::convertToBinBoundary (const std::vector< double > &bin_centers, std::vector< double > &bin_edges)
 Convert an array of bin centers to bin boundary values. More...
 
void MANTID_KERNEL_DLL Mantid::Kernel::VectorHelper::convertToBinCentre (const std::vector< double > &bin_edges, std::vector< double > &bin_centres)
 Convert an array of bin boundaries to bin center values. More...
 
int MANTID_KERNEL_DLL Mantid::Kernel::VectorHelper::createAxisFromRebinParams (const std::vector< double > &params, std::vector< double > &xnew, const bool resize_xnew, const bool full_bins_only, const double xMinHint, const double xMaxHint, const bool useReverseLogarithmic, const double power)
 Creates a new output X array given a 'standard' set of rebinning parameters. More...
 
template<typename T >
std::vector< T > Mantid::Kernel::VectorHelper::flattenVector (const std::vector< std::vector< T > > &v)
 A convenience function to "flatten" the given vector of vectors into a single vector. More...
 
MANTID_KERNEL_DLL int Mantid::Kernel::VectorHelper::getBinIndex (const std::vector< double > &bins, const double value)
 Return the index into a vector of bin boundaries for a particular X value. More...
 
size_t MANTID_KERNEL_DLL Mantid::Kernel::VectorHelper::indexOfValueFromCenters (const std::vector< double > &bin_centers, const double value)
 Gets the bin of a value from a vector of bin centers and throws exception if out of range. More...
 
int MANTID_KERNEL_DLL Mantid::Kernel::VectorHelper::indexOfValueFromCentersNoThrow (const std::vector< double > &bin_centers, const double value)
 Gets the bin of a value from a vector of bin centers and returns -1 if out of range. More...
 
size_t MANTID_KERNEL_DLL Mantid::Kernel::VectorHelper::indexOfValueFromEdges (const std::vector< double > &bin_edges, const double value)
 Gets the bin of a value from a vector of bin edges. More...
 
bool MANTID_KERNEL_DLL Mantid::Kernel::VectorHelper::isConstantValue (const std::vector< double > &arra)
 Assess if all the values in the vector are equal or if there are some different values. More...
 
template<typename T >
Mantid::Kernel::VectorHelper::lengthVector (const std::vector< T > &x)
 Return the length of the vector (in the physical sense), the sqrt of the sum of the squares of the components. More...
 
template<typename T >
std::vector< T > Mantid::Kernel::VectorHelper::normalizeVector (const std::vector< T > &x)
 Normalize a vector of any size to unity, using the sum of the squares of the components. More...
 
void MANTID_KERNEL_DLL Mantid::Kernel::VectorHelper::rebin (const std::vector< double > &xold, const std::vector< double > &yold, const std::vector< double > &eold, const std::vector< double > &xnew, std::vector< double > &ynew, std::vector< double > &enew, bool distribution, bool addition)
 Rebins data according to a new output X array. More...
 
void MANTID_KERNEL_DLL Mantid::Kernel::VectorHelper::rebinHistogram (const std::vector< double > &xold, const std::vector< double > &yold, const std::vector< double > &eold, const std::vector< double > &xnew, std::vector< double > &ynew, std::vector< double > &enew, bool addition)
 Rebins histogram data according to a new output X array. More...
 
template<typename T >
Mantid::Kernel::VectorHelper::scalar_prod (const std::vector< T > &v1, const std::vector< T > &v2)
 
template<typename T , typename U >
double Mantid::Kernel::VectorHelper::scalar_prod (const std::vector< T > &v1, const std::vector< U > &v2)
 
MANTID_KERNEL_DLL void Mantid::Kernel::VectorHelper::smoothInRange (const std::vector< double > &input, std::vector< double > &output, const double avrgInterval, std::vector< double > const *const binBndrs, size_t startIndex, size_t endIndex, std::vector< double > *const outBins)
 Basic running average of input vector within specified range, considering variable bin-boundaries if such boundaries are provided. More...
 
template<typename NumT >
MANTID_KERNEL_DLL std::vector< NumT > Mantid::Kernel::VectorHelper::splitStringIntoVector (std::string listString)
 Take a string of comma or space-separated values, and splits it into a vector of doubles. More...