LoAdSG
localTensorProduct.h
1//
2// Created by scherner on 21.09.21.
3//
4#include "../iterator/RectangularIterator.h"
5
6#ifndef GRUN_LOCALTENSORPRODUCT_H
7#define GRUN_LOCALTENSORPRODUCT_H
8
9
32public:
33 explicit LocalForTensor(AdaptiveSparseGrid *grid_);
34
36
37 enum Marker {
38 nicht, fertig, arbeite
39 };
40
44 unsigned long findAnicht(unsigned long iNow);
45
46 unsigned long findAnichtWithDepth(unsigned long iNow, Depth &T_);
47
53 IndexDimension StartSearchComponent(unsigned long iNow);
54
61 void recursiveMarkArbeite(IndexDimension indexNow, unsigned long iNow);
62
63 void recursiveMarkArbeite2(IndexDimension indexNow, unsigned long iNow);
64
65 bool checkRechteck(IndexDimension indexNow);
66
72
73 void checkStorage() {} // muss man noch implementieren !!!!!!
74 void markRechteck(Marker mm);
75
76 void PrintIMaxIMin() {
77 cout << "print max and min" << endl;
78 maxIndex.PrintCoord();
79 cout << endl;
80 minIndex.PrintCoord();
81 }
82
83 IndexDimension getMin(){return minIndex;}
84 IndexDimension getMax(){return maxIndex;}
85
86 void PrintDepth() {
87 for (int i = 0; i < DimensionSparseGrid; i++) cout << T.at(i) << endl;
88 }
89/*void AdaptiveSparseGrid::CompleteToLocalTensorProductGrid() {
90 // Grid hat immer zuerst hierarchische Struktur und dann noch als TP erweitert
91 completeGrid();
92
93 //1. Start
94 LocalForTensor constructorTensor(this);
95
96 // Iteration
97 for (unsigned long iNow = constructorTensor.findAnicht(-1); iNow < maximalOccupiedSecondTable;
98 iNow = constructorTensor.findAnicht(iNow)) {
99
100 IndexDimension indexNow = constructorTensor.StartSearchComponent(iNow);
101
102 // Zusammenhangskomponente wird untersucht und bereits vorhandene Punkte auf arbeite gesetzt
103 constructorTensor.recursiveMarkArbeite(indexNow, iNow);
104
105
106 bool touch = false;
107 do {
108 // fehlende Rechteckpunkte hinzufügen, markieren arbeite und touch feststellen
109 touch = constructorTensor.markArbeiteAndAddRechteck();
110 constructorTensor.checkStorage();
111
112 if(touch){
113 constructorTensor.markRechteck(LocalForTensor::nicht);
114 constructorTensor.recursiveMarkArbeite(indexNow,iNow);
115 }
116
117 }while(touch);
118
119 constructorTensor.markRechteck(LocalForTensor::fertig);
120 constructorTensor.checkStorage();
121
122 if(TEST) PrintActiveHanging(3);
123 }
124 // completeGrid();
125
126}*/
127protected:
128 AdaptiveSparseGrid *grid;
129 Marker *marker;
130 unsigned long secondTableLength;
131
132 IndexDimension maxIndex;
133 IndexDimension minIndex;
134
135 Depth T;
136};
137
138bool checkRechteck(IndexDimension minIndex,IndexDimension maxIndex, Depth T, AdaptiveSparseGrid* grid);
139#endif //GRUN_LOCALTENSORPRODUCT_H
Definition sparseGrid.h:277
Definition localTensorProduct.h:31
IndexDimension StartSearchComponent(unsigned long iNow)
Definition localTensorProduct.cc:67
void recursiveMarkArbeite(IndexDimension indexNow, unsigned long iNow)
Definition localTensorProduct.cc:74
unsigned long findAnicht(unsigned long iNow)
Definition localTensorProduct.cc:41
bool markArbeiteAndAddRechteck()
Definition localTensorProduct.cc:93