1.7 The class OZ_FSetValue

1.7.1 Miscellaneous

OZ_FSetState

enum OZ_FSetState {fs_emptyfs_full};

Used when constructing a Finite Set or with the operator ==.

value

meaning

fs_empty

the empty set

fs_full

the set \{\mbox{\tt OZ\_getFSInf()}, \ldots, \mbox{\tt OZ\_getFSSup()}\}

1.7.2 Constructor Member Functions

OZ_FSetValue

OZ_FSetValue(void);

This constructor creates an uninitialised Finite Set Value.

OZ_FSetValue

OZ_FSetValue(const OZ_FSetConstraint &fsc);

fsc must have a determined value (i. e. fsc.isValue() must be true). A Finite Set is constructed from this value.

OZ_FSetValue

OZ_FSetValue(const OZ_Term t);

Constructor using a level4 list description like for Finite Domains (see Section 1.2.4) to create a Finite Set Value.

OZ_FSetValue

OZ_FSetValue(const OZ_FSetState state);

Creates a Finite Set Value according to state (fs_empty or fs_full).

OZ_FSetValue

OZ_FSetValue(int min_elemint max_elem);

Creates a Finite Set Value \{min\_elem, \ldots, max\_elem\}.

1.7.3 Reflection Member Functions

getMinElem

int getMinElem(voidconst;

Returns the smallest element of the set.

getMaxElem

int getMaxElem(voidconst;

Returns the largest element of the set.

getNextLargerElem

int getNextLargerElem(int iconst;

Returns the next larger Element after i in the set, or -1 if there is none.

getNextSmallerElem

int getNextSmallerElem(int iconst;

Returns the next smaller Element before i in the set, or -1 if there is none.

getKnownInList

OZ_Term getKnownInList(voidconst;

Returns a level4-List (see Section 1.2.4) containing the elements in the set.

getKnownNotInList

OZ_Term getKnownNotInList(voidconst;

Returns a level4-List (see Section 1.2.4) containing the elements in the complementary set.

1.7.4 Operator Member Functions

operator ==

OZ_Boolean operator == (const OZ_FSetValue &fsconst;

Tests equality on sets.

operator <=

OZ_Boolean operator <= (const OZ_FSetValue &fsconst;

Return OZ_True if *this is a subset of fs.

operator &

OZ_FSetValue operator & (const OZ_FSetValue &fsconst;

Returns the intersection of *this with fs.

operator |

OZ_FSetValue operator | (const OZ_FSetValue &fsconst;

Returns the union of *this with fs.

operator -

OZ_FSetValue operator - (const OZ_FSetValue &fsconst;

Returns the elements in *this not in fs.

operator &=

OZ_FSetValue operator &= (const OZ_FSetValue &fs);

*this is assigned its intersection with fs.

operator |=

OZ_FSetValue operator |= (const OZ_FSetValue &);

*this is assigned its union with fs.

operator &=

OZ_FSetValue operator &= (const int i);

If i is in *this, this function returns \{i\}; otherwise the empty set.

operator +=

OZ_FSetValue operator += (const int i);

i is put into *this.

operator -=

OZ_FSetValue operator-=(const int);

i is removed from *this, if in.

operator -

OZ_FSetValue operator-(voidconst;

Returns the complement of *this.

1.7.5 Auxiliary Member Functions

init

void init(const OZ_FSetState state);

Initializes a Finite Set Value according to state (fs_empty or fs_full).

isIn

OZ_Boolean isIn(int iconst;

Returns OZ_True if i is in *this.

isNotIn

OZ_Boolean isNotIn(intconst;

Returns OZ_True if i is not in *this.

getCard

int getCard(voidconst;

Returns the cardinality of *this.

getKnownNotIn

int getKnownNotIn(voidconst;

Returns the cardinality of *this' complement.

copyExtension

void copyExtension(void);

This member function replaces the current extension of the set value representation by a copy of it.

disposeExtension

void disposeExtension(void);

This member function frees the heap memory occupied by the extension of the set value.

toString

char * toString(voidconst;

Returns a textual representation of the finite set value pointing to a static array of chars.


Tobias Müller
Version 1.4.0 (20080702)