Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This function inherits from CompositeFunction to accumulate multiple functions and from IFunction1DSpectrum, so the correct domain creator is used in Fit.
- Loading branch information
Michael Wedel
committed
Jun 12, 2014
1 parent
44076a4
commit 92564e7
Showing
4 changed files
with
126 additions
and
0 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
57 changes: 57 additions & 0 deletions
57
Code/Mantid/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/Poldi2DFunction.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,57 @@ | ||
#ifndef MANTID_SINQ_POLDI2DFUNCTION_H_ | ||
#define MANTID_SINQ_POLDI2DFUNCTION_H_ | ||
|
||
#include "MantidKernel/System.h" | ||
#include "MantidSINQ/DllConfig.h" | ||
#include "MantidAPI/CompositeFunction.h" | ||
#include "MantidAPI/IFunction1DSpectrum.h" | ||
|
||
namespace Mantid | ||
{ | ||
namespace Poldi | ||
{ | ||
|
||
/** Poldi2DFunction : | ||
Function for POLDI 2D spectrum. | ||
@author Michael Wedel, Paul Scherrer Institut - SINQ | ||
@date 13/06/2014 | ||
Copyright © 2014 PSI-MSS | ||
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 MANTID_SINQ_DLL Poldi2DFunction : virtual public API::IFunction1DSpectrum, virtual public API::CompositeFunction | ||
{ | ||
public: | ||
Poldi2DFunction(); | ||
virtual ~Poldi2DFunction() {} | ||
|
||
virtual void function(const API::FunctionDomain &domain, API::FunctionValues &values) const; | ||
virtual void functionDeriv(const API::FunctionDomain &domain, API::Jacobian &jacobian); | ||
|
||
virtual void function1DSpectrum(const API::FunctionDomain1DSpectrum &domain, API::FunctionValues &values) const; | ||
}; | ||
|
||
|
||
} // namespace SINQ | ||
} // namespace Mantid | ||
|
||
#endif /* MANTID_SINQ_POLDI2DFUNCTION_H_ */ |
37 changes: 37 additions & 0 deletions
37
Code/Mantid/Framework/SINQ/src/PoldiUtilities/Poldi2DFunction.cpp
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,37 @@ | ||
#include "MantidSINQ/PoldiUtilities/Poldi2DFunction.h" | ||
|
||
namespace Mantid | ||
{ | ||
namespace Poldi | ||
{ | ||
using namespace API; | ||
|
||
//---------------------------------------------------------------------------------------------- | ||
/** Constructor | ||
*/ | ||
Poldi2DFunction::Poldi2DFunction() : | ||
IFunction1DSpectrum(), | ||
CompositeFunction() | ||
{ | ||
} | ||
|
||
void Poldi2DFunction::function(const FunctionDomain &domain, FunctionValues &values) const | ||
{ | ||
CompositeFunction::function(domain, values); | ||
} | ||
|
||
void Poldi2DFunction::functionDeriv(const FunctionDomain &domain, Jacobian &jacobian) | ||
{ | ||
CompositeFunction::functionDeriv(domain, jacobian); | ||
} | ||
|
||
void Poldi2DFunction::function1DSpectrum(const API::FunctionDomain1DSpectrum &domain, API::FunctionValues &values) const | ||
{ | ||
UNUSED_ARG(domain); | ||
UNUSED_ARG(values); | ||
} | ||
|
||
|
||
|
||
} // namespace SINQ | ||
} // namespace Mantid |
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,29 @@ | ||
#ifndef MANTID_SINQ_POLDI2DFUNCTIONTEST_H_ | ||
#define MANTID_SINQ_POLDI2DFUNCTIONTEST_H_ | ||
|
||
#include <cxxtest/TestSuite.h> | ||
|
||
#include "MantidSINQ/PoldiUtilities/Poldi2DFunction.h" | ||
|
||
using Mantid::SINQ::Poldi2DFunction; | ||
using namespace Mantid::API; | ||
|
||
class Poldi2DFunctionTest : public CxxTest::TestSuite | ||
{ | ||
public: | ||
// This pair of boilerplate methods prevent the suite being created statically | ||
// This means the constructor isn't called when running other tests | ||
static Poldi2DFunctionTest *createSuite() { return new Poldi2DFunctionTest(); } | ||
static void destroySuite( Poldi2DFunctionTest *suite ) { delete suite; } | ||
|
||
|
||
void test_Something() | ||
{ | ||
TSM_ASSERT( "You forgot to write a test!", 0); | ||
} | ||
|
||
|
||
}; | ||
|
||
|
||
#endif /* MANTID_SINQ_POLDI2DFUNCTIONTEST_H_ */ |