10#include "../myAssert.h"
17#include "../indices/index.h"
30 for (
int d = 0; d < DimensionSparseGrid; d++)
34 inline explicit Depth(
int depthall) {
36 for (
int d = 0; d < DimensionSparseGrid; d++)
40 inline explicit Depth(IndexDimension indexD);
42 inline Depth(
const Depth &T_) {
43 for (
int d = 0; d < DimensionSparseGrid; d++) depth[d] = T_.depth[d];
46 inline int *returnTiefen() {
54 inline void set(
int t,
int d);
56 inline int at(
int d)
const;
59 inline unsigned int maxNorm();
61 inline unsigned int LoneNorm();
63 inline bool operator==(
const Depth &TR)
const;
65 inline bool operator<=(
const Depth &TR);
67 inline bool operator<(
const Depth &TR);
69 inline bool operator>(
const Depth &TR);
71 inline bool operator>(
int t);
73 inline bool operator>>(
int t);
75 inline bool operator==(
int t);
77 inline void operator++(){
78 for(
int d=0;d<DimensionSparseGrid; d++){
87 int depth[DimensionSparseGrid];
101inline Depth::Depth(IndexDimension indexD) {
102 for (
int d = 0; d < DimensionSparseGrid; ++d)
103 depth[d] = indexD.getDepth(d);
106inline int Depth::at(
int d)
const{
112inline void Depth::set(
int t,
int d) {
117inline bool Depth::operator==(
const Depth &TR)
const{
118 for (
int d = 0; d < DimensionSparseGrid; ++d) {
119 if (depth[d] != TR.depth[d])
return false;
124inline bool Depth::operator<=(
const Depth &TR) {
125 for (
int d = 0; d < DimensionSparseGrid; ++d) {
126 if (depth[d] > TR.depth[d])
return false;
131inline bool Depth::operator<(
const Depth &TR) {
132 for (
int d = 0; d < DimensionSparseGrid; ++d) {
133 if (depth[d] >= TR.depth[d])
return false;
138inline bool Depth::operator>(
const Depth &TR) {
139 for (
int d = 0; d < DimensionSparseGrid; ++d) {
140 if (depth[d] <= TR.depth[d])
return false;
145inline bool Depth::operator>(
int t) {
148 for (
int d = 0; d < DimensionSparseGrid; ++d) {
149 if (depth[d] <= t)
return false;
154inline bool Depth::operator>>(
int t) {
156 bool checkall =
true;
157 for (
int d = 0; d < DimensionSparseGrid; ++d) {
158 if (depth[d] <= t) checkall =
false;
164inline bool Depth::operator==(
int t) {
165 for (
int d = 0; d < DimensionSparseGrid; d++) {
166 if (depth[d] != t)
return false;
171inline unsigned int Depth::maxNorm() {
172 unsigned int maxN = depth[0];
173 for (
int d = 1; d < DimensionSparseGrid; ++d) {
174 if (maxN < depth[d]) maxN = depth[d];
179inline unsigned int Depth::LoneNorm() {
180 unsigned int loneN = depth[0];
181 for(
int d=1;d<DimensionSparseGrid;++d) {
182 loneN = loneN + depth[d];
187inline void Depth::Print() {
188 std::cout <<
"Depth ";
189 std::cout <<
" (" << depth[0];
190 for (
int d = 1; d < DimensionSparseGrid; ++d) {
191 std::cout <<
", " << depth[d];