Mantid
Loading...
Searching...
No Matches
Algebra.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "MantidGeometry/DllConfig.h"
11
12namespace Mantid {
13
14namespace Geometry {
15
28class MANTID_GEOMETRY_DLL Algebra {
29private:
30 std::map<int, std::string> SurfMap;
32
33public:
34 Algebra();
35
37 const Acomp &getComp() const { return F; }
38
39 bool operator==(const Algebra &) const;
40 bool operator!=(const Algebra &) const;
41 Algebra &operator+=(const Algebra &);
42 Algebra &operator*=(const Algebra &);
43 Algebra operator+(const Algebra &) const;
44 Algebra operator*(const Algebra &) const;
45 int logicalEqual(const Algebra &) const;
46
47 void Complement();
48 void makeDNF() { F.makeDNFobject(); }
49 void makeCNF() { F.makeCNFobject(); }
50 std::pair<Algebra, Algebra> algDiv(const Algebra &) const;
51 int setFunctionObjStr(const std::string &);
52 int setFunction(const std::string &);
53 int setFunction(const Acomp &);
54
55 std::ostream &write(std::ostream &) const;
56 std::string writeMCNPX() const;
57
58 // Debug Functions::
59 int countLiterals() const;
61 std::string display() const;
62};
63
64std::ostream &operator<<(std::ostream &, const Algebra &);
65
66} // NAMESPACE Geometry
67
68} // NAMESPACE Mantid
Holds a state point in the decision tree.
Definition Acomp.h:43
int makeDNFobject()
Make the object into DNF form (Sum of Products)
Definition Acomp.cpp:1046
int makeCNFobject()
Make the object into CNF form (Product of Sums)
Definition Acomp.cpp:1063
Computes Boolean algebra for simplification.
Definition Algebra.h:28
void makeCNF()
assessor to makeCNFobj
Definition Algebra.h:49
const Acomp & getComp() const
Accessor.
Definition Algebra.h:37
void makeDNF()
assessor to makeDNFobj
Definition Algebra.h:48
std::map< int, std::string > SurfMap
Internal surface map.
Definition Algebra.h:30
MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs)
Adds two workspaces.
MatrixWorkspace_sptr MANTID_API_DLL operator*=(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs)
Multiply two workspaces.
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
Helper class which provides the Collimation Length for SANS instruments.
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
constexpr bool operator!=(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
std::common_type_t< wide_integer< Bits, Signed >, wide_integer< Bits2, Signed2 > > constexpr operator*(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
constexpr wide_integer< Bits, Signed > operator+(const wide_integer< Bits, Signed > &lhs) noexcept(is_same< Signed, unsigned >::value)