Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Mantid::API::FunctionDomain1DVector Class Reference

Implements FunctionDomain1D with its own storage in form of a std::vector. More...

#include <FunctionDomain1D.h>

Inheritance diagram for Mantid::API::FunctionDomain1DVector:
Mantid::API::FunctionDomain1D Mantid::API::FunctionDomain Mantid::API::FunctionDomain1DSpectrum

Public Member Functions

 FunctionDomain1DVector (const double startX, const double endX, const size_t n)
 Constructor. More...
 
 FunctionDomain1DVector (const double x)
 Constructor. More...
 
 FunctionDomain1DVector (const FunctionDomain1DVector &)
 Copy constructor. More...
 
 FunctionDomain1DVector (const std::vector< double > &xvalues)
 Constructor. More...
 
 FunctionDomain1DVector (std::vector< double > &&xvalues)
 No-copy constructor. More...
 
 FunctionDomain1DVector (std::vector< double >::const_iterator from, std::vector< double >::const_iterator to)
 Constructor. More...
 
std::vector< double > getVector ()
 Get the underlying vector. More...
 
FunctionDomain1DVectoroperator= (const FunctionDomain1DVector &)
 Copy assignment operator. More...
 
- Public Member Functions inherited from Mantid::API::FunctionDomain1D
 FunctionDomain1D (const FunctionDomain1D &right)=delete
 copying is not allowed. More...
 
int getPeakRadius () const
 Get the peak radius. More...
 
const double * getPointerAt (size_t i) const
 Get a pointer to i-th value. More...
 
FunctionDomain1Doperator= (const FunctionDomain1D &)=delete
 copying is not allowed. More...
 
double operator[] (size_t i) const
 Get an x value. More...
 
void setPeakRadius (int radius)
 Set a peak radius to pass to peak functions. More...
 
size_t size () const override
 Return the number of arguments in the domain. More...
 
std::vector< double > toVector () const
 Convert to a vector. More...
 
- Public Member Functions inherited from Mantid::API::FunctionDomain
virtual void reset () const
 Reset the the domain so it can be reused. More...
 
virtual size_t size () const =0
 Return the number of points in the domain. More...
 
virtual ~FunctionDomain ()=default
 Virtual destructor. More...
 

Protected Attributes

std::vector< double > m_X
 vector of function arguments More...
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::API::FunctionDomain1D
 FunctionDomain1D (const double *x, size_t n)
 Protected constructor, shouldn't be created directly. More...
 
void resetData (const double *x, size_t n)
 Reset the pointer and size of the domain. More...
 

Detailed Description

Implements FunctionDomain1D with its own storage in form of a std::vector.

Definition at line 72 of file FunctionDomain1D.h.

Constructor & Destructor Documentation

◆ FunctionDomain1DVector() [1/6]

Mantid::API::FunctionDomain1DVector::FunctionDomain1DVector ( const double  x)

Constructor.

Create a domain with a single value.

Parameters
x:: The argument value.

Definition at line 107 of file FunctionDomain1D.cpp.

References m_X, Mantid::API::FunctionDomain1D::resetData(), and Mantid::Geometry::x.

◆ FunctionDomain1DVector() [2/6]

Mantid::API::FunctionDomain1DVector::FunctionDomain1DVector ( const double  startX,
const double  endX,
const size_t  n 
)

Constructor.

Create a domain with regular values in an interval.

The step in values is (endX - startX) / (n - 1). If n == 1 creates a single value of (startX + endX) / 2.

Parameters
startX:: The start of an interval.
endX:: The end of an interval.
n:: Number of values to create.

Definition at line 86 of file FunctionDomain1D.cpp.

References m_X, n, and Mantid::API::FunctionDomain1D::resetData().

◆ FunctionDomain1DVector() [3/6]

Mantid::API::FunctionDomain1DVector::FunctionDomain1DVector ( const std::vector< double > &  xvalues)

Constructor.

Create a domain from a vector.

Parameters
xvalues:: Vector with function arguments to be copied from.

Definition at line 41 of file FunctionDomain1D.cpp.

References m_X, and Mantid::API::FunctionDomain1D::resetData().

◆ FunctionDomain1DVector() [4/6]

Mantid::API::FunctionDomain1DVector::FunctionDomain1DVector ( std::vector< double > &&  xvalues)

No-copy constructor.

Create a domain from a vector using move semantics - no copy overhead.

Parameters
xvalues:: Vector with function arguments to be moved from.

Definition at line 53 of file FunctionDomain1D.cpp.

References m_X, and Mantid::API::FunctionDomain1D::resetData().

◆ FunctionDomain1DVector() [5/6]

Mantid::API::FunctionDomain1DVector::FunctionDomain1DVector ( std::vector< double >::const_iterator  from,
std::vector< double >::const_iterator  to 
)

Constructor.

Create a domain from a part of a vector.

Parameters
from:: Iterator to start copying values from.
to:: Iterator to the end of the data.

Definition at line 68 of file FunctionDomain1D.cpp.

References m_X, and Mantid::API::FunctionDomain1D::resetData().

◆ FunctionDomain1DVector() [6/6]

Mantid::API::FunctionDomain1DVector::FunctionDomain1DVector ( const FunctionDomain1DVector right)

Copy constructor.

Parameters
right:: The other domain.

Definition at line 117 of file FunctionDomain1D.cpp.

References right.

Member Function Documentation

◆ getVector()

std::vector< double > Mantid::API::FunctionDomain1DVector::getVector ( )
inline

Get the underlying vector.

Definition at line 89 of file FunctionDomain1D.h.

◆ operator=()

FunctionDomain1DVector & Mantid::API::FunctionDomain1DVector::operator= ( const FunctionDomain1DVector right)

Copy assignment operator.

Parameters
right:: The other domain.

Definition at line 125 of file FunctionDomain1D.cpp.

References m_X, Mantid::API::FunctionDomain1D::resetData(), and right.

Member Data Documentation

◆ m_X

std::vector<double> Mantid::API::FunctionDomain1DVector::m_X
protected

vector of function arguments

Definition at line 92 of file FunctionDomain1D.h.

Referenced by FunctionDomain1DVector(), and operator=().


The documentation for this class was generated from the following files: