Mantid
Loading...
Searching...
No Matches
BnId.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"
10#include <iosfwd>
11#include <map>
12#include <set>
13#include <string>
14#include <vector>
15
16namespace Mantid {
17
18namespace Geometry {
37class MANTID_GEOMETRY_DLL BnId {
38private:
39 size_t size;
40 int PI;
41 int Tnum;
42 int Znum;
43 std::vector<int> Tval;
44
45 void setCounters();
46
47public:
48 BnId();
49 BnId(const size_t, unsigned int);
50
51 bool operator==(const BnId &) const;
52 bool operator<(const BnId &) const;
53 bool operator>(const BnId &) const;
54 int operator[](int const) const;
55 int operator++(int);
56 int operator++();
57 int operator--(int);
58 int operator--();
59
60 int equivalent(const BnId &) const;
61 void reverse();
62
63 int PIstatus() const { return PI; }
64 void setPI(const int A) { PI = A; }
65 int intValue() const;
66 std::pair<int, BnId> makeCombination(const BnId &) const;
67
69 size_t expressCount() const { return size - Znum; }
71 size_t Size() const { return size; }
73 int TrueCount() const { return Tnum; }
74
75 void mapState(const std::vector<int> &, std::map<int, int> &) const;
76
78 std::string display() const;
80 void write(std::ostream &) const;
81};
82
83std::ostream &operator<<(std::ostream &, const BnId &);
84
85} // NAMESPACE Geometry
86
87} // NAMESPACE Mantid
Tri-state variable.
Definition: BnId.h:37
int TrueCount() const
Access true count.
Definition: BnId.h:73
size_t size
number of variables
Definition: BnId.h:39
size_t expressCount() const
Total requiring expression.
Definition: BnId.h:69
void setPI(const int A)
PI accessor.
Definition: BnId.h:64
size_t Size() const
returns number of variables / size
Definition: BnId.h:71
int Znum
Zero number (0 in Tval)
Definition: BnId.h:42
int PIstatus() const
PI accessor.
Definition: BnId.h:63
int PI
Prime Implicant.
Definition: BnId.h:40
int Tnum
True number (1 in Tval)
Definition: BnId.h:41
std::vector< int > Tval
Truth values.
Definition: BnId.h:43
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)