Newer
Older
#include "MantidDataObjects/Histogram1D.h"
#include "MantidKernel/Exception.h"
#include "MantidAPI/WorkspaceFactory.h"
namespace Mantid {
namespace DataObjects {
Janik Zikovsky
committed
/**
Russell Taylor
committed
Constructor
*/
Janik Zikovsky
committed
/**
Russell Taylor
committed
Copy constructor
Janik Zikovsky
committed
@param A :: Histogram to copy
Russell Taylor
committed
*/
Histogram1D::Histogram1D(const Histogram1D &A)
: ISpectrum(A), refY(A.refY), refE(A.refE) {}
Janik Zikovsky
committed
/**
Russell Taylor
committed
Assignment operator
Janik Zikovsky
committed
@param A :: Histogram to copy
@return *this
Russell Taylor
committed
*/
Histogram1D &Histogram1D::operator=(const Histogram1D &A) {
if (this != &A) {
refX = A.refX;
refY = A.refY;
refE = A.refE;
refDx = A.refDx;
Russell Taylor
committed
}
Russell Taylor
committed
/// Destructor. Nothing to do since refX, refY, and refE are managed ptr
void Histogram1D::clearData() {
MantidVec &yValues = this->dataY();
Russell Taylor
committed
std::fill(yValues.begin(), yValues.end(), 0.0);
MantidVec &eValues = this->dataE();
Russell Taylor
committed
std::fill(eValues.begin(), eValues.end(), 0.0);
}