Mantid
Loading...
Searching...
No Matches
Acomp.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#include <map>
12#include <string>
13#include <utility>
14#include <vector>
15
16namespace Mantid {
17namespace Kernel {
18template <typename T> class Matrix;
19}
20
21namespace Geometry {
22
43class MANTID_GEOMETRY_DLL Acomp {
44
45private:
47 std::vector<int> Units;
48 std::vector<Acomp> Comp;
49
50 void deleteComp();
51 void addComp(const Acomp &);
52 void addUnitItem(int const);
53 void processIntersection(const std::string &);
54 void processUnion(const std::string &);
55 int joinDepth();
56 int removeEqComp();
57 int copySimilar(const Acomp &);
58
59 void addUnit(const std::vector<int> &,
60 const BnId &);
61 void assignDNF(const std::vector<int> &,
62 const std::vector<BnId> &);
63 int getDNFobject(std::vector<int> &, std::vector<BnId> &) const;
64 int getDNFpart(std::vector<Acomp> &) const;
65
66 int getCNFobject(std::vector<int> &, std::vector<BnId> &) const;
67 void assignCNF(const std::vector<int> &,
68 const std::vector<BnId> &);
69 // int getCNFpart(std::vector<Acomp>&) const; ///< get the
70 // CNF parts (as Acomp)
71
73 int makePI(std::vector<BnId> &) const;
74 int makeEPI(std::vector<BnId> &, std::vector<BnId> &) const;
75
76 int makeReadOnce();
77
78public:
79 Acomp(int const = 0);
80 bool operator==(const Acomp &) const;
81 bool operator!=(const Acomp &) const;
82 bool operator<(const Acomp &) const;
83 bool operator>(const Acomp &) const;
84 Acomp &operator+=(const Acomp &);
85 Acomp &operator-=(const Acomp &);
86 Acomp &operator*=(const Acomp &);
87
88 const Acomp *itemC(int const) const;
89 int itemN(int const) const;
90
91 std::pair<int, int> size() const;
92 int isSimple() const;
93 int isDNF() const;
94 int isCNF() const;
95 int isNull() const;
96 int isSingle() const;
97 int contains(const Acomp &) const;
98 int isInter() const { return Intersect; }
99 int isTrue(const std::map<int, int> &) const;
100
101 void Sort();
102 void getLiterals(std::map<int, int> &) const;
103 void getAbsLiterals(std::map<int, int> &) const;
104 std::vector<int> getKeys() const;
105 int logicalEqual(const Acomp &) const;
106
107 int makeDNFobject();
108 int makeCNFobject();
109
110 void complement();
111 std::pair<Acomp, Acomp> algDiv(const Acomp &);
112 void setString(const std::string &);
113 void writeFull(std::ostream &,
114 int const = 0) const;
115 std::string display() const;
116 std::string displayDepth(int const = 0) const;
117
118 void printImplicates(const std::vector<BnId> &, const Kernel::Matrix<int> &) const;
119};
120
121std::ostream &operator<<(std::ostream &, const Acomp &);
122
123} // NAMESPACE Geometry
124
125} // NAMESPACE Mantid
Holds a state point in the decision tree.
Definition: Acomp.h:43
std::vector< int > Units
Units in list.
Definition: Acomp.h:47
int Intersect
Union/Intersection (0,1)
Definition: Acomp.h:46
std::vector< Acomp > Comp
Components in list.
Definition: Acomp.h:48
int isInter() const
Deterimine if inter/union.
Definition: Acomp.h:98
Tri-state variable.
Definition: BnId.h:37
Numerical Matrix class.
Definition: Matrix.h:42
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)
Subtracts 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.
Definition: PointGroup.cpp:312
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)
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)