src/Utilities/peanoHilbertOrderIndices.cc
//------------------------------------------------------------------------------
// The specialized function (per dimension) to dive down the recursive levels
// of the Peano-Hilbert path and generate the encoded key for a given position.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// 1-D
//------------------------------------------------------------------------------
The specialized function (per dimension) to dive down the recursive levels
of the Peano-Hilbert path and generate the encoded key for a given position.

1-D
The specialized function ( per dimension ) to dive down the recursive levels of the Peano - Hilbert path and generate the encoded key for a given position . 1 - D
inline
KeyTraits::Key
hashPosition(const Dim<1>::Vector& position,
             const Dim<1>::Vector& boxmin,
             const Dim<1>::Vector& boxmax) {
  const double boxsize = (1.0 + 1.0e-10)*(boxmax.x() - boxmin.x());
  CHECK(boxsize > 0.0);
  return KeyTraits::Key(int((position.x() - boxmin.x())/(boxsize/KeyTraits::numbits1d)));
}
inline KeyTraits :: Key hashPosition ( const Dim < 1 > :: Vector & position , const Dim < 1 > :: Vector & boxmin , const Dim < 1 > :: Vector & boxmax ) { const double boxsize = ( 1.0 + 1.0e-10 ) * ( boxmax . x ( ) - boxmin . x ( ) ) ; CHECK ( boxsize > 0.0 ) ; return KeyTraits :: Key ( int ( ( position . x ( ) - boxmin . x ( ) ) / ( boxsize / KeyTraits :: numbits1d ) ) ) ; }
The specialized function (per dimension) to dive down the recursive levels
of the Peano-Hilbert path and generate the encoded key for a given position.
The specialized function ( per dimension ) to dive down the recursive levels of the Peano - Hilbert path and generate the encoded key for a given position .