-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re #4158. Refactored function interfaces to use domains and Values.
- Loading branch information
1 parent
125eb67
commit a5af579
Showing
30 changed files
with
1,051 additions
and
786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#ifndef MANTID_API_COMPOSITEDOMAIN_H_ | ||
#define MANTID_API_COMPOSITEDOMAIN_H_ | ||
|
||
//---------------------------------------------------------------------- | ||
// Includes | ||
//---------------------------------------------------------------------- | ||
#include "MantidAPI/DllConfig.h" | ||
#include "MantidAPI/FunctionDomain.h" | ||
|
||
#include <stdexcept> | ||
|
||
namespace Mantid | ||
{ | ||
namespace API | ||
{ | ||
/** Base class that represents the domain of a function. | ||
A domain is a generalisation of x (argument) and y (value) arrays. | ||
A domain consists at least of a list of function arguments for which a function should | ||
be evaluated and a buffer for the calculated values. If used in fitting also contains | ||
the fit data and weights. | ||
@author Roman Tolchenov, Tessella plc | ||
@date 15/11/2011 | ||
Copyright © 2009 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory | ||
This file is part of Mantid. | ||
Mantid is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
Mantid is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>. | ||
Code Documentation is available at: <http://doxygen.mantidproject.org> | ||
*/ | ||
class MANTID_API_DLL CompositeDomain: public FunctionDomain | ||
{ | ||
public: | ||
/// Return the number of parts in the domain | ||
virtual size_t getNParts() const = 0; | ||
/// Return i-th domain | ||
virtual const FunctionDomain& getDomain(size_t i) const = 0; | ||
}; | ||
|
||
} // namespace API | ||
} // namespace Mantid | ||
|
||
#endif /*MANTID_API_COMPOSITEDOMAIN_H_*/ |
67 changes: 67 additions & 0 deletions
67
Code/Mantid/Framework/API/inc/MantidAPI/CompositeDomainMD.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#ifndef MANTID_API_COMPOSITEDOMAINMD_H_ | ||
#define MANTID_API_COMPOSITEDOMAINMD_H_ | ||
|
||
//---------------------------------------------------------------------- | ||
// Includes | ||
//---------------------------------------------------------------------- | ||
#include "MantidAPI/CompositeDomain.h" | ||
#include "MantidAPI/IMDWorkspace.h" | ||
|
||
#include <vector> | ||
|
||
namespace Mantid | ||
{ | ||
namespace API | ||
{ | ||
class FunctionDomainMD; | ||
|
||
/** Base class that represents the domain of a function. | ||
A domain is a generalisation of x (argument) and y (value) arrays. | ||
A domain consists at least of a list of function arguments for which a function should | ||
be evaluated and a buffer for the calculated values. If used in fitting also contains | ||
the fit data and weights. | ||
@author Roman Tolchenov, Tessella plc | ||
@date 15/11/2011 | ||
Copyright © 2009 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory | ||
This file is part of Mantid. | ||
Mantid is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
Mantid is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>. | ||
Code Documentation is available at: <http://doxygen.mantidproject.org> | ||
*/ | ||
class MANTID_API_DLL CompositeDomainMD: public CompositeDomain | ||
{ | ||
public: | ||
CompositeDomainMD(IMDWorkspace_const_sptr ws, size_t maxDomainSize); | ||
~CompositeDomainMD(); | ||
/// Return the total number of arguments in the domain | ||
virtual size_t size() const {return m_totalSize;} | ||
/// Return the number of parts in the domain | ||
virtual size_t getNParts() const {return m_domains.size();} | ||
/// Return i-th domain | ||
virtual const FunctionDomain& getDomain(size_t i) const; | ||
protected: | ||
mutable IMDIterator* m_iterator; ///< IMDIterator | ||
size_t m_totalSize; ///< The total size of the domain | ||
mutable std::vector<FunctionDomainMD*> m_domains; ///< smaller parts of the domain | ||
}; | ||
|
||
} // namespace API | ||
} // namespace Mantid | ||
|
||
#endif /*MANTID_API_COMPOSITEDOMAINMD_H_*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.