Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/ElmerGUI/netgen/libsrc/general/seti.hpp
3206 views
1
#ifndef FILE_SETI
2
#define FILE_SETI
3
4
5
/**************************************************************************/
6
/* File: seti.hh */
7
/* Author: Joachim Schoeberl */
8
/* Date: 20. Mar. 98 */
9
/**************************************************************************/
10
11
/**
12
Set of Integers
13
*/
14
class IndexSet
15
{
16
ARRAY<int> set;
17
BitArray flags;
18
public:
19
IndexSet (int maxind);
20
21
~IndexSet ();
22
/// increase range to maxind
23
void SetMaxIndex (int maxind);
24
int IsIn (int ind) const
25
{
26
return flags.Test (ind);
27
}
28
29
void Add (int ind)
30
{
31
if (!flags.Test(ind))
32
{
33
set.Append (ind);
34
flags.Set (ind);
35
}
36
}
37
38
void Del (int ind);
39
void Clear ();
40
41
const ARRAY<int> & Array() { return set; }
42
};
43
44
#endif
45
46
47