1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 17:25:37 +01:00
Grid/lib/stencil/Lebesgue.h

50 lines
1.1 KiB
C
Raw Normal View History

#ifndef GRID_LEBESGUE_H
#define GRID_LEBESGUE_H
#include<vector>
// Lebesgue, Morton, Z-graph ordering assistance
namespace Grid {
class LebesgueOrder {
public:
2015-11-04 11:18:51 +00:00
typedef int32_t IndexInteger;
static int UseLebesgueOrder;
2015-11-04 11:18:51 +00:00
GridBase *grid;
2015-11-04 11:18:51 +00:00
public:
LebesgueOrder(GridBase *_grid);
inline IndexInteger Reorder(IndexInteger ss) {
2015-11-04 11:18:51 +00:00
return _LebesgueReorder[ss] ;
};
2015-11-04 11:18:51 +00:00
////////////////////////////
// Space filling fractal for cache oblivious
////////////////////////////
void ZGraph(void);
IndexInteger alignup(IndexInteger n);
2015-11-04 11:18:51 +00:00
/////////////////////////////////
// Cartesian stencil blocking strategy
/////////////////////////////////
static std::vector<int> Block;
void CartesianBlocking(void);
void IterateO(int ND,int dim,
std::vector<IndexInteger> & xo,
std::vector<IndexInteger> & xi,
std::vector<IndexInteger> &dims);
void IterateI(int ND,int dim,
std::vector<IndexInteger> & xo,
std::vector<IndexInteger> & xi,
std::vector<IndexInteger> &dims);
private:
std::vector<IndexInteger> _LebesgueReorder;
};
}
#endif