Go to the documentation of this file.00001
00002
00003 #ifndef testConstrained_hh
00004 #define testConstrained_hh
00005
00006 #include "basics/testcase.hh"
00007 #include "operator/sparseMatrix.hh"
00008 #include "toolbox/array.hh"
00009
00010 using concepts::Real;
00011
00012 namespace test {
00013
00014
00015
00025 class ConstrainedEVP : public TestCase {
00026 public:
00027 ConstrainedEVP(uint dim, uint cdim, uint gdim, uint kmax) :
00028 spc(dim), cspc(cdim), gspc(gdim),
00029 a(0), b(spc, spc), c(spc, cspc), kmax_(kmax) {}
00030 virtual void run();
00031 #ifdef HAS_ARPACK
00032
00033 void testARPACKregularInv();
00035 void testARPACKshiftInv();
00036 #endif
00037 #ifdef HAS_JDBSym
00038
00039 void testJDBSym();
00040 #endif
00041
00042 void testInexactInv();
00043 private:
00044 void testResults(const concepts::Array<Real>& res);
00045 protected:
00046 concepts::DummySpace<Real> spc, cspc, gspc;
00047 std::auto_ptr<concepts::Operator<Real> > a;
00048 concepts::SparseMatrix<Real> b, c;
00049 const Real* exact_;
00050 const uint kmax_;
00051 };
00052
00053
00054
00083 class GolubExample : public ConstrainedEVP {
00084 public:
00086 GolubExample();
00087 virtual ~GolubExample() {}
00088 private:
00089 static const Real exact[4];
00090 };
00091
00092
00093
00104 class GolubExampleSum : public ConstrainedEVP {
00105 public:
00107 GolubExampleSum();
00108 virtual ~GolubExampleSum() {}
00109 private:
00110 static const Real exact[4];
00111 concepts::SparseMatrix<Real> a1, a2;
00112 };
00113
00114
00115
00119 class MaxwellTransmissionEVP : public ConstrainedEVP {
00120 public:
00122 MaxwellTransmissionEVP();
00123 virtual ~MaxwellTransmissionEVP() {}
00124 private:
00125 static const Real exact[20];
00126 void matlab_matrix_entry(concepts::Matrix<Real>& m,
00127 uint i, uint j, Real entry);
00128 };
00129
00130 }
00131
00132 #endif // testConstrained_hh