netgen/libsrc/general/seti.hpp

46 lines
898 B
C++
Raw Normal View History

2009-01-13 04:40:13 +05:00
#ifndef FILE_SETI
#define FILE_SETI
/**************************************************************************/
/* File: seti.hh */
/* Author: Joachim Schoeberl */
/* Date: 20. Mar. 98 */
/**************************************************************************/
/**
Set of Integers
*/
class IndexSet
{
2009-01-25 17:35:25 +05:00
Array<int> set;
2009-01-13 04:40:13 +05:00
BitArray flags;
public:
IndexSet (int maxind);
~IndexSet ();
/// increase range to maxind
void SetMaxIndex (int maxind);
int IsIn (int ind) const
{
return flags.Test (ind);
}
void Add (int ind)
{
if (!flags.Test(ind))
{
set.Append (ind);
flags.Set (ind);
}
}
void Del (int ind);
void Clear ();
2009-01-25 20:04:33 +05:00
const Array<int> & GetArray() { return set; }
2009-01-13 04:40:13 +05:00
};
#endif