Brick Library 0.1
Performance-portable stencil datalayout & codegen
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ZMORT Struct Reference

n-dimensional Z-Mort ordering More...

#include <zmort.h>

Public Member Functions

 ZMORT ()
 Default to 0-d.
 
 ZMORT (unsigned long id, unsigned long dim)
 Initialize using z-mort id and the number of dimensions.
 
ZMORT operator[] (unsigned long p)
 Continuously construct a Z-Mort index.
 
unsigned long operator() (unsigned long d)
 Get positions of a Z-Mort index on the d-th dimension.
 
ZMORT set (unsigned long d, unsigned long p)
 Set positions of a Z-Mort index on the d-th dimension.
 
 operator unsigned long () const
 Implicit conversion to extract the Z-Mort index.
 

Public Attributes

unsigned long id
 Z-Mort index of this struct.
 
unsigned long dim
 Number of dimensions.
 

Detailed Description

n-dimensional Z-Mort ordering

Preliminary n-d Z-Mort implementation whose returning index is not compact. Only for perfect 2-exponentials will return compact & contiguous index.

This can be viewed as a single Z-Mort index or as an array of indices that represent the original n-dimensional position. It can be constructed incrementally from 0-d Z-Mort.

Constructor & Destructor Documentation

◆ ZMORT() [1/2]

ZMORT::ZMORT ( )
inline

Default to 0-d.

◆ ZMORT() [2/2]

ZMORT::ZMORT ( unsigned long  id,
unsigned long  dim 
)
inline

Initialize using z-mort id and the number of dimensions.

Member Function Documentation

◆ operator unsigned long()

ZMORT::operator unsigned long ( ) const
inline

Implicit conversion to extract the Z-Mort index.

◆ operator()()

unsigned long ZMORT::operator() ( unsigned long  d)
inline

Get positions of a Z-Mort index on the d-th dimension.

Parameters
dThe dimension to get index, 0 is the fastest varying dimension
Returns
The position

For example, see ZMORT::operator[](unsigned long).

◆ operator[]()

ZMORT ZMORT::operator[] ( unsigned long  p)
inline

Continuously construct a Z-Mort index.

Parameters
pPosition in the current dimension
Returns
ZMORT with one more dimension than before

For example:

ZMORT z = 0ul;
ZMORT n = z[5][6][7];
// n.dim = 3, n(0) = 7, n(1) = 6, n(2) = 5
n-dimensional Z-Mort ordering
Definition: zmort.h:18

◆ set()

ZMORT ZMORT::set ( unsigned long  d,
unsigned long  p 
)
inline

Set positions of a Z-Mort index on the d-th dimension.

Parameters
dThe dimension, 0 is the fastest varying dimension
pThe position
Returns
A NEW ZMORT

Member Data Documentation

◆ dim

unsigned long ZMORT::dim

Number of dimensions.

◆ id

unsigned long ZMORT::id

Z-Mort index of this struct.


The documentation for this struct was generated from the following file: