#include <mapsetlib.h>
Public Member Functions | |
SET | changeScale (int newScale) const |
SET (int s=0) | |
SET (const CUBE< _DIM > &k) | |
Constructs a set which is a singleton of the single coordinate taken from CUBE structure. | |
SET (const std::set< Coords< _DIM, int > > &c, int s) | |
void | shrink (int diff) |
Function decresing the scale of the set by integer parameter diff. | |
void | expand (int diff) |
Function increasing the scale of the set by integer parameter diff. | |
SET | operator+ (const SET &a) const |
Adding two sets. | |
void | operator+= (const SET &a) |
Adding set to the current one. | |
SET | operator- (const SET &a) const |
Substructing two sets. | |
void | operator-= (const SET &a) |
Removing set from the current one. | |
SET | operator* (const SET &a) const |
Product of two sets. | |
bool | operator!= (const SET &a) const |
Function comparing two sets. | |
int | giveScale () const |
SET | intersection (const SET &s) const |
Different version of multiplying sets. | |
Private Attributes | |
int | scale |
Class storing a set of coordinates with associated scale parameter. It inherits STL set structure.
Constructs a set which is a singleton of the single coordinate taken from CUBE structure.
The scale parameter of the set is the same as for the cube.
void SET< _DIM >::shrink | ( | int | diff | ) | [inline] |
Function decresing the scale of the set by integer parameter diff.
The function changes the set of coordinates to represent the smallest possible cubic representation of the previous SET with the new scale parameter.
void SET< _DIM >::expand | ( | int | diff | ) | [inline] |
Function increasing the scale of the set by integer parameter diff.
The function changes the set of coordinates to represent the smallest possible cubic representation of the previous SET with the new scale parameter.
Adding two sets.
Function returns sum of two sets by first setting up the same scale for the right one. Example: A+B means first change scale of B to be the same as A and then add elements. Function in facts does not change the set B.
Adding set to the current one.
Function adds set by first setting up the same scale for the right one. Example: A+=B means first change scale of B to be the same as A and then add elements. Function in facts does not change the set B.
Substructing two sets.
Function returns substruction of two sets by first setting up the same scale for the right one. Example: A-B means first change scale of B to be the same as A and then substruct elements. Function in facts does not change the set B.
Removing set from the current one.
Function substructs two sets by first setting up the same scale for the right one. Example: A-=B means first change scale of B to be the same as A and then deducg elements of B from A. Function in facts does not change the set B.
Product of two sets.
Function returns product of two sets by first setting up the same scale for the right one. Example: A*B means first change scale of B to be the same as A and then multiply two sets. Function in facts does not change the set B.
Function comparing two sets.
First it compares scale parameter, than size of the sets and finally perform element by element comparison.
int SET< _DIM >::giveScale | ( | ) | const [inline] |
Different version of multiplying sets.