Skip to content

Commit

Permalink
Refs #4036: added 7 algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Nov 8, 2011
1 parent 1f8a1cf commit 026651b
Show file tree
Hide file tree
Showing 25 changed files with 1,462 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Code/Mantid/Framework/MDAlgorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# GLOBs should be replaced with explicit listings
set ( SRC_FILES
# src/CreateMDFitWorkspace.cpp
src/AndMD.cpp
src/BinaryOperationMD.cpp
src/BooleanBinaryOperationMD.cpp
src/CobaltSpinWaveDSHO.cpp
src/CompositeFunctionBuilder.cpp
src/CompositeImplicitFunction.cpp
src/CompositeImplicitFunctionParser.cpp
src/ConvertToQ3DdE.cpp
src/ConvertToQNDany.cpp
src/DivideMD.cpp
src/EqualToMD.cpp
src/ExponentialMD.cpp
src/GreaterThanMD.cpp
src/IDynamicRebinning.cpp
src/InvalidParameter.cpp
src/InvalidParameterParser.cpp
src/LessThanMD.cpp
src/LogarithmMD.cpp
src/MinusMD.cpp
src/MultiplyMD.cpp
src/NotMD.cpp
src/NullImplicitFunction.cpp
src/OrMD.cpp
src/PlusMD.cpp
src/PowerMD.cpp
src/QuadEnBackground.cpp
Expand All @@ -26,29 +33,37 @@ set ( SRC_FILES
src/TobyFitSimulate.cpp
src/UnaryOperationMD.cpp
src/Vector3DParameterParser.cpp
src/XorMD.cpp
)

#set ( SRC_UNITY_IGNORE_FILES src/IDynamicRebinning.cpp
#)

set ( INC_FILES
# inc/MantidMDAlgorithms/CreateMDFitWorkspace.h
inc/MantidMDAlgorithms/AndMD.h
inc/MantidMDAlgorithms/BinaryOperationMD.h
inc/MantidMDAlgorithms/BooleanBinaryOperationMD.h
inc/MantidMDAlgorithms/CobaltSpinWaveDSHO.h
inc/MantidMDAlgorithms/CompositeFunctionBuilder.h
inc/MantidMDAlgorithms/CompositeImplicitFunction.h
inc/MantidMDAlgorithms/CompositeImplicitFunctionParser.h
inc/MantidMDAlgorithms/ConvertToQ3DdE.h
inc/MantidMDAlgorithms/ConvertToQNDany.h
inc/MantidMDAlgorithms/DivideMD.h
inc/MantidMDAlgorithms/EqualToMD.h
inc/MantidMDAlgorithms/ExponentialMD.h
inc/MantidMDAlgorithms/GreaterThanMD.h
inc/MantidMDAlgorithms/IDynamicRebinning.h
inc/MantidMDAlgorithms/InvalidParameter.h
inc/MantidMDAlgorithms/InvalidParameterParser.h
inc/MantidMDAlgorithms/LessThanMD.h
inc/MantidMDAlgorithms/LogarithmMD.h
inc/MantidMDAlgorithms/MinusMD.h
inc/MantidMDAlgorithms/MultiplyMD.h
inc/MantidMDAlgorithms/NotMD.h
inc/MantidMDAlgorithms/NullImplicitFunction.h
inc/MantidMDAlgorithms/OrMD.h
inc/MantidMDAlgorithms/PlusMD.h
inc/MantidMDAlgorithms/PowerMD.h
inc/MantidMDAlgorithms/QuadEnBackground.h
Expand All @@ -59,6 +74,7 @@ set ( INC_FILES
inc/MantidMDAlgorithms/UnaryOperationMD.h
inc/MantidMDAlgorithms/Vector3DParameter.h
inc/MantidMDAlgorithms/Vector3DParameterParser.h
inc/MantidMDAlgorithms/XorMD.h
)

# Test files. Other source files required.
Expand All @@ -67,21 +83,29 @@ set ( TEST_FILES
#test/CobaltSWDTest.h
#test/CreateMDFitWorkspaceTest.h
#test/QuadEnBackgroundTest.h
test/AndMDTest.h
test/BooleanBinaryOperationMDTest.h
test/ConvertToQ3DdETest.h
test/ConvertToQNDanyTest.h
test/DivideMDTest.h
test/EqualToMDTest.h
test/ExponentialMDTest.h
test/GreaterThanMDTest.h
test/InvalidParameterParserTest.h
test/InvalidParameterTest.h
test/LessThanMDTest.h
test/LogarithmMDTest.h
test/MinusMDTest.h
test/MultiplyMDTest.h
test/NotMDTest.h
test/OrMDTest.h
test/PlusMDTest.h
test/PowerMDTest.h
test/RunParamTest.h
test/SimulateMDDTest.h
test/TobyFitSimulateTest.h
test/UnaryOperationMDTest.h
test/XorMDTest.h
)

set ( GMOCK_TEST_FILES
Expand Down
55 changes: 55 additions & 0 deletions Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/AndMD.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#ifndef MANTID_MDALGORITHMS_ANDMD_H_
#define MANTID_MDALGORITHMS_ANDMD_H_

#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
#include "MantidMDAlgorithms/BinaryOperationMD.h"
#include "MantidMDAlgorithms/BooleanBinaryOperationMD.h"

namespace Mantid
{
namespace MDAlgorithms
{

/** AndMD : Perform the And boolean operation on two MDHistoWorkspaces
@date 2011-11-08
Copyright © 2011 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 DLLExport AndMD : public BooleanBinaryOperationMD
{
public:
AndMD();
virtual ~AndMD();

virtual const std::string name() const;
virtual int version() const;

private:
void execHistoHisto(Mantid::MDEvents::MDHistoWorkspace_sptr out, Mantid::MDEvents::MDHistoWorkspace_const_sptr operand);
};


} // namespace MDAlgorithms
} // namespace Mantid

#endif /* MANTID_MDALGORITHMS_ANDMD_H_ */
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#ifndef MANTID_MDALGORITHMS_BOOLEANBINARYOPERATIONMD_H_
#define MANTID_MDALGORITHMS_BOOLEANBINARYOPERATIONMD_H_

#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
#include "MantidMDAlgorithms/BinaryOperationMD.h"

namespace Mantid
{
namespace MDAlgorithms
{

/** BooleanBinaryOperationMD : base class for boolean-type operations on MDHistoWorkspaces
@date 2011-11-08
Copyright &copy; 2011 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 DLLExport BooleanBinaryOperationMD : public BinaryOperationMD
{
public:
BooleanBinaryOperationMD();
virtual ~BooleanBinaryOperationMD();

virtual const std::string name() const;
virtual int version() const;

protected:
/// Return true if the algorithm can operate on a scalar.
virtual bool acceptScalar()
{ return true; }

virtual void initDocs();
bool commutative() const;
void checkInputs();
void execEvent();
virtual void execHistoScalar(Mantid::MDEvents::MDHistoWorkspace_sptr out, Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar);

/// Run the algorithm with a MDHisotWorkspace as output and operand
virtual void execHistoHisto(Mantid::MDEvents::MDHistoWorkspace_sptr out, Mantid::MDEvents::MDHistoWorkspace_const_sptr operand) = 0;


};


} // namespace MDAlgorithms
} // namespace Mantid

#endif /* MANTID_MDALGORITHMS_BOOLEANBINARYOPERATIONMD_H_ */
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#ifndef MANTID_MDALGORITHMS_EQUALTOMD_H_
#define MANTID_MDALGORITHMS_EQUALTOMD_H_

#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
#include "MantidMDAlgorithms/BooleanBinaryOperationMD.h"

namespace Mantid
{
namespace MDAlgorithms
{

/** EqualToMD : boolean operation on MDHistoWorkspaces
@date 2011-11-08
Copyright &copy; 2011 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 DLLExport EqualToMD : public BooleanBinaryOperationMD
{
public:
EqualToMD();
virtual ~EqualToMD();

virtual const std::string name() const;
virtual int version() const;

private:
bool acceptScalar() { return true; }
void execHistoHisto(Mantid::MDEvents::MDHistoWorkspace_sptr out, Mantid::MDEvents::MDHistoWorkspace_const_sptr operand);
void execHistoScalar(Mantid::MDEvents::MDHistoWorkspace_sptr out, Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar);

};


} // namespace MDAlgorithms
} // namespace Mantid

#endif /* MANTID_MDALGORITHMS_EQUALTOMD_H_ */
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#ifndef MANTID_MDALGORITHMS_GREATERTHANMD_H_
#define MANTID_MDALGORITHMS_GREATERTHANMD_H_

#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
#include "MantidMDAlgorithms/BooleanBinaryOperationMD.h"

namespace Mantid
{
namespace MDAlgorithms
{

/** GreaterThanMD : boolean operation on MDHistoWorkspaces
@date 2011-11-08
Copyright &copy; 2011 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 DLLExport GreaterThanMD : public BooleanBinaryOperationMD
{
public:
GreaterThanMD();
virtual ~GreaterThanMD();

virtual const std::string name() const;
virtual int version() const;

private:
bool acceptScalar() { return true; }
bool commutative() { return false; }

void execHistoHisto(Mantid::MDEvents::MDHistoWorkspace_sptr out, Mantid::MDEvents::MDHistoWorkspace_const_sptr operand);
void execHistoScalar(Mantid::MDEvents::MDHistoWorkspace_sptr out, Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar);

};


} // namespace MDAlgorithms
} // namespace Mantid

#endif /* MANTID_MDALGORITHMS_GREATERTHANMD_H_ */

0 comments on commit 026651b

Please sign in to comment.