Implementation of space-filling curve. More...
#include <sfcIndex.h>
Public Member Functions | |
| sfcIndex () | |
| sfcIndex (const int dim, const int levs, const int base=sfcBase) | |
| sfcIndex (sfcIndex const &other) | |
| sfcIndex const & | operator= (sfcIndex const &other) |
| Overload various operators for sfcIndex. | |
| int | operator== (sfcIndex const &other) const |
| int | operator!= (sfcIndex const &other) const |
| int | operator> (sfcIndex const &other) const |
| int | operator< (sfcIndex const &other) const |
| int | operator>= (sfcIndex const &other) const |
| int | operator<= (sfcIndex const &other) const |
| int | sfcGetDigit (const int level) const |
| Return the sfcIndexUnit (sfcdigitw bits) corresponding to level "level" of the sfc. | |
| void | sfcSetDigit (const int level, const int digit) |
| Sets the sfcIndexUnit (sfcdigitw bits) corresponding to level "level" of the sfc using "digit. | |
| void | sfcUnsetDigit (const int level) |
| Resets the sfcIndexUnit (sfcdigitw bits) corresponding to level "level" of the sfc. | |
| void | sfcMaxDigit (const int level) |
| Set to all 1's the sfcIndexUnit (sfcdigitw bits) corresponding to level "level" of the sfc. | |
| void | sfcSwapDigitWd (const int level, const int pos1, const int pos2) |
| Swaps sfcbasew bits at positions pos1 and pos2 in the sfcIndexUnit corresponding to level "level". | |
| void | sfcToggleDigitWd (const int level, const int pos) |
| Toggles sfcbasew bits at pos in the sfcIndexUnit corresponding to level "level". | |
| int | sfcGetIndex () const |
| Returns the (int) integer value of the index. | |
| int | sfcGetIndex (const int lev) const |
| Returns the (int) integer value of the index at level lev; i.e. | |
| int | sfcGetIndex (const int lev, const int nlev) const |
| Returns the (int) integer value of the index from level lev-nlev+1 to level lev. | |
| void | sfcSetIndex (const int index) |
| Sets the (int) integer value of the sfcIndex to "index". | |
| void | sfcSetIndex (const int index, const int lev) |
| Sets the (int) integer value of the sfcIndex at level lev (i.e. | |
| void | sfcSetIndex (const int index, const int lev, const int nlev) |
| Sets the (int) integer value of the sfcIndex from lev to lev+nlev-1 to "index". | |
| void | sfcMaxIndex (const int lev) |
| void | sfcCreateLocNum (const int *coords) |
| Create location numbers from given coordinates. | |
| void | sfcGetCoords (int *coords) const |
| Returns an array of coordinates from the locations number. | |
| void | sfcGetDigitArray (int *digits) const |
| Returns the sfcdigitw bits corresponding to each sfcIndexUnit as an array of int. | |
| int | sfcGetBaseW (void) const |
| Query interface. | |
| int | sfcGetDigitW (void) const |
Protected Attributes | |
| short int | sfcbase |
| short int | sfcdim |
| short int | sfclevs |
Friends | |
| std::ostream & | operator<< (std::ostream &, sfcIndex const &) |
Implementation of space-filling curve.
Class sfcIndex defines an index generated by the chosen SFC mapping i.e. specified space dimensions, base used and mapping function. sfcIndex is an ordering vector of sfcIndexUnits; each sfcIndexUnits defined as Dim Base-b digts, and defining the index at each level of the sfc. The most-significant sfcIndexUnits corresponds to level 1 Class sfcIndex is derived from BitVec.
| sfcIndex::sfcIndex | ( | ) | [inline] |
| sfcIndex::sfcIndex | ( | const int | dim, | |
| const int | levs, | |||
| const int | base = sfcBase | |||
| ) | [inline] |
References sfcdim.
| sfcIndex::sfcIndex | ( | sfcIndex const & | other | ) | [inline] |
| void sfcIndex::sfcCreateLocNum | ( | const int * | coords | ) |
Create location numbers from given coordinates.
References BitVec::ResetVec(), sfcdim, and sfclevs.
Referenced by PeanoHilbert::Map().
| int sfcIndex::sfcGetBaseW | ( | void | ) | const [inline] |
Query interface.
| void sfcIndex::sfcGetCoords | ( | int * | coords | ) | const |
Returns an array of coordinates from the locations number.
References BitVec::IsolateBit(), sfcdim, and sfclevs.
| int sfcIndex::sfcGetDigit | ( | const int | level | ) | const |
Return the sfcIndexUnit (sfcdigitw bits) corresponding to level "level" of the sfc.
Remember that the most-significant sfcIndexUnit corresponds to level 1.
References BitVec::IsolateBit(), and sfclevs.
Referenced by PeanoHilbert::Map(), sfcGetDigitArray(), and sfcGetIndex().
| void sfcIndex::sfcGetDigitArray | ( | int * | digits | ) | const |
Returns the sfcdigitw bits corresponding to each sfcIndexUnit as an array of int.
References sfcGetDigit(), and sfclevs.
| int sfcIndex::sfcGetDigitW | ( | void | ) | const [inline] |
| int sfcIndex::sfcGetIndex | ( | const int | lev, | |
| const int | nlev | |||
| ) | const |
Returns the (int) integer value of the index from level lev-nlev+1 to level lev.
References BitVec::IsolateBit(), sfcbase, sfcdim, sfcGetDigit(), and sfclevs.
| int sfcIndex::sfcGetIndex | ( | const int | lev | ) | const |
Returns the (int) integer value of the index at level lev; i.e.
only the first lev digits of the sfcIndex.
References BitVec::IsolateBit(), sfcbase, sfcdim, sfcGetDigit(), and sfclevs.
| int sfcIndex::sfcGetIndex | ( | ) | const |
Returns the (int) integer value of the index.
References BitVec::IsolateBit(), sfcbase, sfcdim, sfcGetDigit(), and sfclevs.
Referenced by operator<<().
| void sfcIndex::sfcMaxDigit | ( | const int | level | ) |
Set to all 1's the sfcIndexUnit (sfcdigitw bits) corresponding to level "level" of the sfc.
References sfclevs.
Referenced by PeanoHilbert::GetBox(), PeanoHilbert::GetMax(), PeanoHilbert::SetBox(), PeanoHilbert::SetMax(), and sfcMaxIndex().
| void sfcIndex::sfcMaxIndex | ( | const int | lev | ) |
References sfclevs, and sfcMaxDigit().
| void sfcIndex::sfcSetDigit | ( | const int | level, | |
| const int | digit | |||
| ) |
Sets the sfcIndexUnit (sfcdigitw bits) corresponding to level "level" of the sfc using "digit.
References sfclevs.
Referenced by PeanoHilbert::GetBox(), PeanoHilbert::ResetBase(), PeanoHilbert::SetBox(), and sfcSetIndex().
| void sfcIndex::sfcSetIndex | ( | const int | index, | |
| const int | lev, | |||
| const int | nlev | |||
| ) |
Sets the (int) integer value of the sfcIndex from lev to lev+nlev-1 to "index".
References sfclevs, and sfcSetDigit().
| void sfcIndex::sfcSetIndex | ( | const int | index, | |
| const int | lev | |||
| ) |
Sets the (int) integer value of the sfcIndex at level lev (i.e.
MSB lev*sfcdigitw bits) to "index".
References sfclevs, and sfcSetDigit().
| void sfcIndex::sfcSetIndex | ( | const int | index | ) |
Sets the (int) integer value of the sfcIndex to "index".
References sfclevs, and sfcSetDigit().
Referenced by PeanoHilbert::Invert(), and PeanoHilbert::SetIndex().
| void sfcIndex::sfcSwapDigitWd | ( | const int | level, | |
| const int | pos1, | |||
| const int | pos2 | |||
| ) |
Swaps sfcbasew bits at positions pos1 and pos2 in the sfcIndexUnit corresponding to level "level".
sfcIndexUnit bits are numbered from 0 with the MSB being 0.
References sfcdim, sfclevs, and BitVec::SwapBit().
| void sfcIndex::sfcToggleDigitWd | ( | const int | level, | |
| const int | pos | |||
| ) |
Toggles sfcbasew bits at pos in the sfcIndexUnit corresponding to level "level".
References sfclevs.
| void sfcIndex::sfcUnsetDigit | ( | const int | level | ) |
Resets the sfcIndexUnit (sfcdigitw bits) corresponding to level "level" of the sfc.
References sfclevs.
Referenced by PeanoHilbert::SetBox(), and PeanoHilbert::SetMax().
| std::ostream& operator<< | ( | std::ostream & | os, | |
| sfcIndex const & | si | |||
| ) | [friend] |
short int sfcIndex::sfcbase [protected] |
Referenced by operator!=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), and sfcGetIndex().
short int sfcIndex::sfcdim [protected] |
Referenced by PeanoHilbert::GetBox(), PeanoHilbert::GetCardinality(), PeanoHilbert::GetCoords(), PeanoHilbert::Map(), operator!=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), PeanoHilbert::SetBox(), sfcCreateLocNum(), sfcGetCoords(), sfcGetIndex(), sfcIndex(), and sfcSwapDigitWd().
short int sfcIndex::sfclevs [protected] |
Referenced by PeanoHilbert::GetBox(), PeanoHilbert::GetCoords(), PeanoHilbert::GetDimCardinality(), PeanoHilbert::GetDimMax(), PeanoHilbert::GetMax(), PeanoHilbert::Map(), operator!=(), operator<(), operator<<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), PeanoHilbert::ResetBase(), PeanoHilbert::SetBox(), PeanoHilbert::SetMax(), sfcCreateLocNum(), sfcGetCoords(), sfcGetDigit(), sfcGetDigitArray(), sfcGetIndex(), sfcMaxDigit(), sfcMaxIndex(), sfcSetDigit(), sfcSetIndex(), sfcSwapDigitWd(), sfcToggleDigitWd(), and sfcUnsetDigit().
1.6.3