constrained.hh

Go to the documentation of this file.
1 
6 #ifndef testConstrained_hh
7 #define testConstrained_hh
8 
9 #include "basics/testcase.hh"
10 #include "operator/sparseMatrix.hh"
11 #include "toolbox/array.hh"
12 
13 using concepts::Real;
14 
15 namespace test {
16 
17  // ******************************************************** ConstrainedEVP **
18 
28  class ConstrainedEVP : public TestCase {
29  public:
30  ConstrainedEVP(uint dim, uint cdim, uint gdim, uint kmax) :
31  spc(dim), cspc(cdim), gspc(gdim),
32  a(0), b(spc, spc), c(spc, cspc), kmax_(kmax) {}
33  virtual void run();
34 #ifdef HAS_ARPACK
35  void testARPACKregularInv();
38  void testARPACKshiftInv();
39 #endif
40 #ifdef HAS_JDBSym
41  void testJDBSym();
43 #endif
44  void testInexactInv();
46  private:
48  protected:
50  std::unique_ptr<concepts::Operator<Real> > a;
52  const Real* exact_;
53  const uint kmax_;
54  };
55 
56  // ********************************************************** GolubExample **
57 
86  class GolubExample : public ConstrainedEVP {
87  public:
90  virtual ~GolubExample() {}
91  private:
92  static const Real exact[4];
93  };
94 
95  // ******************************************************* GolubExampleSum **
96 
108  public:
111  virtual ~GolubExampleSum() {}
112  private:
113  static const Real exact[4];
115  };
116 
117  // ************************************************ MaxwellTransmissionEVP **
118 
123  public:
127  private:
128  static const Real exact[20];
130  uint i, uint j, Real entry);
131  };
132 
133 } // namespace test
134 
135 #endif // testConstrained_hh
virtual ~GolubExample()
Definition: constrained.hh:90
concepts::SparseMatrix< Real > b
Definition: constrained.hh:51
Base class for tests.
Definition: testcase.hh:92
concepts::SparseMatrix< Real > a1
Definition: constrained.hh:114
MaxwellTransmissionEVP()
Constructor. Sets up three matrices a, b and c.
static const Real exact[4]
Definition: constrained.hh:113
void matlab_matrix_entry(concepts::Matrix< Real > &m, uint i, uint j, Real entry)
concepts::SparseMatrix< Real > c
Definition: constrained.hh:51
static const Real exact[20]
Definition: constrained.hh:128
static const Real exact[4]
Definition: constrained.hh:92
ConstrainedEVP(uint dim, uint cdim, uint gdim, uint kmax)
Definition: constrained.hh:30
void testResults(const concepts::Array< Real > &res)
Unit tests.
Definition: testcase.hh:66
virtual ~GolubExampleSum()
Definition: constrained.hh:111
void testInexactInv()
Test with inexact inverse iteration.
Base class for constrained Eigenvalue problem testcases.
Definition: constrained.hh:28
concepts::DummySpace< Real > gspc
Definition: constrained.hh:49
virtual void run()
Runs the tests. Must be overwritten by the specialization.
concepts::SparseMatrix< Real > a2
Definition: constrained.hh:114
GolubExample()
Constructor. Sets up three matrices a, b and c.
Test solver for constrained Eigenvalue problems.
Definition: constrained.hh:86
concepts::DummySpace< Real > spc
Definition: constrained.hh:49
Test solver for constrained Eigenvalue problems.
Definition: constrained.hh:107
const Real * exact_
Definition: constrained.hh:52
std::unique_ptr< concepts::Operator< Real > > a
Definition: constrained.hh:50
GolubExampleSum()
Constructor. Sets up three matrices a, b and c.
concepts::DummySpace< Real > cspc
Definition: constrained.hh:49
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Test case from Maxwell transmission problem with weighted regularization.
Definition: constrained.hh:122
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich