vrcore  0.45
visuReal Messkern
 All Classes Files Functions Variables
FiniteDifferences.h
1 #pragma once
2 
3 /*loest eine Laplacegleichung (genauer: Stationaere Diffusionsgleichung m diagonaler Koeffizientenmatrix)
4 per Finite-Differenzen. Boost-basiert, koennte ocv-frei werden.
5 Paecompiler-Flag ROW_MAJOR: TestFiniteDifferences m. 30x30 liefert
6 
7 bei row_major 0 u. gmres mit col_major:
8 / - scheinbar misst er Breakpoints mit: <properly>" TestProblem ok : , CPU time GMRES = 169.339000"</properly>
9 <properly>" TestProblem ok : , CPU time GMRES = 140.210000"</properly>
10 bei row_major 1 u. gmres mit row_major:
11 / - scheinbar misst er Breakpoints mit: <properly>" TestProblem ok : , CPU time GMRES = 104.307000"</properly>
12 <properly>" TestProblem ok : , CPU time GMRES = 98.077000"</properly>
13 bei row_major 1 u. gmres mit col_major:
14 <properly>" TestProblem ok : , CPU time GMRES = 97.886000"</properly>
15 
16 nun ohne Debug:
17 bei col_major u gmres m. row_major
18 <properly>" TestProblem ok : , CPU time GMRES = 0.639000"</properly>
19 bei col_major u gmres m. col_major
20 <properly>" TestProblem ok : , CPU time GMRES = 0.624000"</properly>
21 col_major u gmres m. col_major verursacht Haenger in axpy_prod, aber - nur bei den Segmentierungsmatrizen. Warum, ist unklar.
22 
23 bei row_major 1 u. gmres mit row_major:
24 <properly>" TestProblem ok : , CPU time GMRES = 0.046000"</properly>
25 bei row_major 1 u. gmres mit col_major:
26 <properly>" TestProblem ok : , CPU time GMRES = 0.032000"</properly>
27 -Denke GMRes sollte m compressed Column_major instantiiert werden, da oft Matrixspalten verwendet werden.
28 
29 row_major u gmres m. col_major verursacht Haenger in axpy_prod, aber - nur bei den Segmentierungsmatrizen. Warum, ist unklar.
30 - nicht recht verständlich, nicht plausibel im Vergleich zu den TestGMRes-Ergebnissen.*/
31 #define ROW_MAJOR 1
32 
34 {private:
35  const int imRows;
36  const int imCols;
37  const double solverTol;
38  const int solSize;
39 /* cv::SparseMat sysMat;
40  cv::Mat rhs;
41 
42 public:
43  cv::Mat sol;*/
44  //boost::numeric::ublas::mapped_matrix<double> sysMat;
45 #if ROW_MAJOR
46  boost::numeric::ublas::compressed_matrix<double, boost::numeric::ublas::row_major>
47  sysMat;
48 #else
49  boost::numeric::ublas::compressed_matrix<double, boost::numeric::ublas::column_major>
50  sysMat;
51 #endif
52  boost::numeric::ublas::vector<double> rhs;
53 
54 public:
55  boost::numeric::ublas::vector<double> sol;
56  void operator ()();
57  int assemble( /*cv::Mat& imageIn,*/ const std::vector< cv::Vec2i >& seeds,
58  const std::vector< std::vector< cv::Vec2i >*>& othersSeeds, class CoeffFunc* coeffFunc);// double ( *coeffFunc)(int i, int j) );
59  FiniteDifferences( const int imRowsIn, const int imColsIn, const double solverTol = 1.0e-5);
60  ~FiniteDifferences(void);
61 };
62 
63 /*weitere Ergebnisse, aus TestGMRes bei 10 000 DOFS unter Release. . Merke: Ohne restart nicht dabei, stuerzt ab unter Release bei dieser Anzahl DOFS
64 <= liegt einfach daran, dass der Speicher voll wird. Die dichten Matrizen Q und dingsda mit der Dim 10 000 - 1 (~100 Millionen Eintraege * 8 wg double) fuellen ihn.
65 => die lib is in dieser Hinsicht nicht so ganz sicher.
66 -<GMRes-Funktion> <properly>" TestGMRes::runAllTests called"</properly>
67  <ERROR>" GMRes short : , CPU time GMRES = 3.369000, iters = 68, resNorm = 1.151132e-005, ok: 0 "</ERROR>
68  <properly>" GMRes dense col_major, banded as in-type, with restarts : , CPU time GMRES = 0.093000, iters = 60, resNorm = 8.873297e-008, ok: 1 "</properly>
69  <properly>" same, but GMRes instantiated with compressed column_major : , CPU time GMRES = 43.602000, iters = 60, resNorm = 8.873297e-008, ok: 1 "</properly>
70  <properly>" GMRes dense col_major with restarts, compressed column_major as in-type : , CPU time GMRES = 29.171000, iters = 60, resNorm = 8.873297e-008, ok: 1 "</properly>
71  <properly>" GMRes dense col_major, with restarts, in-type: compressed row_major : , CPU time GMRES = 0.140000, iters = 60, resNorm = 8.873297e-008, ok: 1 "</properly>
72  <properly>" GMRes dense with restarts, in-type: compressed, row_major everywhere : , CPU time GMRES = 0.171000, iters = 60, resNorm = 8.873297e-008, ok: 1 "</properly>
73  <properly>" TestGMRes::runAllTests returned ok"</properly>
74  -<FiniteDifferences-Funktion>
75 */
Definition: CoeffFunc.h:2
Definition: FiniteDifferences.h:33