Mantid
|
Implements a domain for MD functions (IFunctionMD). More...
#include <FunctionDomainMD.h>
Public Member Functions | |
FunctionDomainMD (const IMDWorkspace_const_sptr &ws, size_t start=0, size_t length=0) | |
Constructor. More... | |
const IMDIterator * | getNextIterator () const |
Next iterator. More... | |
IMDWorkspace_const_sptr | getWorkspace () const |
Returns the pointer to the original workspace. More... | |
void | reset () const override |
Reset the iterator to point to the start of the domain. More... | |
size_t | size () const override |
Return the number of arguments in the domain. More... | |
~FunctionDomainMD () override | |
Destructor. 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 | |
size_t | m_currentIndex |
track the iterator's index, 0 <= m_currentIndex < m_size. More... | |
std::unique_ptr< IMDIterator > | m_iterator |
IMDIterator. More... | |
bool | m_justReset |
Just reset flag. More... | |
size_t | m_size |
The size of the domain. More... | |
const size_t | m_startIndex |
start of the domain, 0 <= m_startIndex < m_iterator->getDataSize() More... | |
Private Attributes | |
IMDWorkspace_const_sptr | m_workspace |
A pointer to the workspace. More... | |
Implements a domain for MD functions (IFunctionMD).
Definition at line 22 of file FunctionDomainMD.h.
Mantid::API::FunctionDomainMD::FunctionDomainMD | ( | const IMDWorkspace_const_sptr & | ws, |
size_t | start = 0 , |
||
size_t | length = 0 |
||
) |
Constructor.
Create a domain form a IMDWorkspace.
ws | :: Pointer to a workspace. |
start | :: Index of the first iterator in this domain. |
length | :: Size of this domain. If 0 use all workspace. |
Definition at line 23 of file FunctionDomainMD.cpp.
References m_iterator, and m_size.
|
overridedefault |
Destructor.
const IMDIterator * Mantid::API::FunctionDomainMD::getNextIterator | ( | ) | const |
Next iterator.
First call after creation returns the first iterator.
Successive calls return advanced iterators until the end of the domain reached in which case a NULL pointer is returned.
Definition at line 56 of file FunctionDomainMD.cpp.
References m_currentIndex, m_iterator, m_justReset, and m_size.
Referenced by Mantid::MDAlgorithms::FitMD::createDomain(), and Mantid::API::IFunctionMD::evaluateFunction().
IMDWorkspace_const_sptr Mantid::API::FunctionDomainMD::getWorkspace | ( | ) | const |
Returns the pointer to the original workspace.
Definition at line 70 of file FunctionDomainMD.cpp.
References m_workspace.
|
overridevirtual |
Reset the iterator to point to the start of the domain.
Reimplemented from Mantid::API::FunctionDomain.
Definition at line 43 of file FunctionDomainMD.cpp.
References m_currentIndex, m_iterator, m_justReset, and m_startIndex.
Referenced by Mantid::MDAlgorithms::FitMD::createDomain(), and Mantid::API::IFunctionMD::evaluateFunction().
|
inlineoverridevirtual |
Return the number of arguments in the domain.
Implements Mantid::API::FunctionDomain.
Definition at line 29 of file FunctionDomainMD.h.
References m_size.
|
mutableprotected |
track the iterator's index, 0 <= m_currentIndex < m_size.
Definition at line 43 of file FunctionDomainMD.h.
Referenced by getNextIterator(), and reset().
|
mutableprotected |
Definition at line 39 of file FunctionDomainMD.h.
Referenced by FunctionDomainMD(), getNextIterator(), and reset().
|
mutableprotected |
Just reset flag.
Definition at line 47 of file FunctionDomainMD.h.
Referenced by getNextIterator(), and reset().
|
protected |
The size of the domain.
Definition at line 45 of file FunctionDomainMD.h.
Referenced by FunctionDomainMD(), and getNextIterator().
|
protected |
start of the domain, 0 <= m_startIndex < m_iterator->getDataSize()
Definition at line 41 of file FunctionDomainMD.h.
Referenced by reset().
|
private |
A pointer to the workspace.
Definition at line 51 of file FunctionDomainMD.h.
Referenced by getWorkspace().