32#ifndef __MEM_RUBY_COMMON_SET_HH__
33#define __MEM_RUBY_COMMON_SET_HH__
54 std::bitset<NUMBER_BITS_PER_SET>
bits;
61 if (size > NUMBER_BITS_PER_SET)
62 fatal(
"Number of bits(%d) < size specified(%d). "
63 "Increase the number of bits and recompile.\n",
64 NUMBER_BITS_PER_SET, size);
121 for (
int j =
m_nSize; j < NUMBER_BITS_PER_SET; ++j) {
165 std::bitset<NUMBER_BITS_PER_SET>
r =
bits & obj.
bits;
177 std::bitset<NUMBER_BITS_PER_SET>
r =
bits |
test.bits;
203 panic(
"No smallest element of an empty set.");
213 if (size > NUMBER_BITS_PER_SET)
214 fatal(
"Number of bits(%d) < size specified(%d). "
215 "Increase the number of bits and recompile.\n",
216 NUMBER_BITS_PER_SET, size);
223 out <<
"[Set (" <<
m_nSize <<
"): " <<
bits <<
"]";
std::bitset< NUMBER_BITS_PER_SET > bits
bool isSuperset(const Set &test) const
bool isElement(NodeID element) const
bool isEqual(const Set &obj) const
bool intersectionIsEmpty(const Set &obj) const
Set & operator=(const Set &obj)
void removeSet(const Set &obj)
bool elementAt(int index) const
void print(std::ostream &out) const
Set AND(const Set &obj) const
void remove(NodeID index)
void addSet(const Set &obj)
Set OR(const Set &obj) const
NodeID smallestElement() const
bool isSubset(const Set &test) const
#define panic(...)
This implements a cprintf based panic() function.
#define fatal(...)
This implements a cprintf based fatal() function.
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.