Newer
Older
#ifndef MANTID_API_IFUNCTIONGENERAL_H_
#define MANTID_API_IFUNCTIONGENERAL_H_
#include "MantidAPI/DllConfig.h"
#include "MantidAPI/IFunction.h"
#include "MantidAPI/FunctionDomainGeneral.h"
#include "MantidKernel/Logger.h"
namespace Mantid {
namespace API {
/** IFunctionGeneral: a very general function definition.
It gets its arguments from a FunctionDomainGeneral and they
can have any type. An argument can be a collection of a number
of values of different types.
The domain and the values object can have different sizes.
In particular the domain can be empty.
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Copyright © 2016 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
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://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport IFunctionGeneral : public virtual IFunction {
public:
void function(const FunctionDomain &domain,
FunctionValues &values) const override;
void functionDeriv(const FunctionDomain &domain, Jacobian &jacobian) override;
/// Provide a concrete function in an implementation that operates on a
/// FunctionDomainGeneral.
virtual void functionGeneral(const FunctionDomainGeneral &domain,
FunctionValues &values) const = 0;
/// Get number of columns that the domain must have.
/// If consider the collection of these columns as a table
/// then a row corresponds to a single (multi-valued) argument.
virtual size_t getNumberDomainColumns() const = 0;
/// Get number of values per argument in the domain.
virtual size_t getNumberValuesPerArgument() const = 0;
/// Get the default size of an output FunctionValues object.
/// It is a number of values the function will produce if it is
/// given an empty domain.
/// The default size must not be infinite (max of size_t).
virtual size_t getDefaultValuesSize() const;
protected:
static Kernel::Logger g_log;
};
} // namespace API
} // namespace Mantid
#endif /* MANTID_API_IFUNCTIONGENERAL_H_ */