compositions.hh

Go to the documentation of this file.
1 
7 #ifndef testCompositions_hh
8 #define testCompositions_hh
9 
10 #include <memory>
11 #include "basics/testcase.hh"
12 #include "operator/sparseMatrix.hh"
13 #include "operator/permutation.hh"
14 #include "sparseqr/driver.hh"
16 
17 namespace test {
18 
19  using concepts::Real;
20 
21  // *************************************************** CompositionTestBase **
22 
23  class CompositionTestBase : public TestCase {
24  protected:
25  template<typename F>
27  };
28 
29  // ****************************************************** CompositionsTest **
30 
39  public:
42  virtual ~CompositionsTest() {}
43  virtual void run();
44 
46 
47  void test1();
50  void test2();
52  void test3();
54  void test4();
56  void test5();
58  private:
59  //concepts::DummySpace<Real> spc;
60  uint dim;
62  };
63 
64  // ************************************************** MoreCompositionsTest **
65 
74  public:
77  virtual ~MoreCompositionsTest() {}
78  virtual void run();
79 
81 
82 
95  private:
96 // concepts::DummySpace<Real> spc;
97  uint dim;
99  };
100 
101  // ************************************************** DeepCompositionsTest **
102 
109  public:
113  virtual void run();
115 
117 
120  private:
123  std::unique_ptr<sparseqr::Driver> qr;
125  std::unique_ptr<concepts::Permutation<Real> > Prt;
128  std::unique_ptr<concepts::Compose<Real> > PrQgt, QgPrt, restrPrQgt,
131  };
132 
133 }
134 
135 #endif // testCompositions_hh
void testTrivExtendRestrictConsistency()
Tests if TrivExtendRestrict has consistent application operator and conversion to sparse matrix.
virtual void run()
Runs the tests. Must be overwritten by the specialization.
void test5()
Tests a*b-c.
Base class for tests.
Definition: testcase.hh:92
void testCompositions()
Tests composisitions of the matrix a with permutations, extensions and restrictions.
concepts::SparseMatrix< Real > c
void test4()
Tests a*b+c.
concepts::DummySpace< Real > spc
MoreCompositionsTest()
Constructor. Sets up a matrix a.
concepts::SparseMatrix< Real > c
Tests (a+b)*c.
Definition: compositions.hh:61
concepts::SparseMatrix< Real > b
concepts::TrivExtendRestrict< Real > * restr
uint dim
Tests (a+b)*c.
Definition: compositions.hh:60
void test2()
Tests a*(b+c)
concepts::TrivExtendRestrict< Real > * ext
Testing linear combination and multiplication of sparse matrices and the implementation of the evalua...
Definition: compositions.hh:38
Unit tests.
Definition: testcase.hh:66
std::unique_ptr< concepts::Compose< Real > > restrPrQgtM
std::unique_ptr< concepts::Compose< Real > > restrPrQgtAQgPrtext
virtual void run()
Runs the tests. Must be overwritten by the specialization.
concepts::SparseMatrix< Real > a
Tests if Permutation has consistent application operator and conversion to sparse matrix.
Definition: compositions.hh:98
uint dim
Tests if Permutation has consistent application operator and conversion to sparse matrix.
Definition: compositions.hh:97
concepts::SparseMatrix< Real > a
std::unique_ptr< concepts::Compose< Real > > restrPrQgtA
std::unique_ptr< concepts::Compose< Real > > PrQgt
virtual void run()
Runs the tests. Must be overwritten by the specialization.
Tests deeply nested compositions resulting from constrained Eigenvalue problems.
std::unique_ptr< concepts::Compose< Real > > QgPrtext
std::unique_ptr< concepts::Compose< Real > > QgPrt
Abstract class for an operator.
Definition: compositions.hh:31
std::unique_ptr< sparseqr::Driver > qr
DeepCompositionsTest()
Constructor. Sets up a matrix a.
Abstract class for an operator.
Definition: ARPACK.hh:16
void testPermutationConsistency()
Tests if Permutation has consistent application operator and conversion to sparse matrix.
sparseqr::GivensRotations< Real > * Qg
std::unique_ptr< concepts::Compose< Real > > restrPrQgtMQgPrtext
concepts::DummySpace< Real > cspc
void test3()
Tests a+b*c.
concepts::SparseMatrix< Real > b
Tests (a+b)*c.
Definition: compositions.hh:61
concepts::SparseMatrix< Real > a
Tests (a+b)*c.
Definition: compositions.hh:61
std::unique_ptr< concepts::Compose< Real > > restrPrQgt
std::unique_ptr< concepts::Permutation< Real > > Prt
concepts::Permutation< Real > * Pr
void compare(const concepts::Matrix< F > &a, concepts::Operator< F > &b)
CompositionsTest()
Constructor. Sets up three matrices a, b and c.
Performs more tests on compositions.
Definition: compositions.hh:73
sparseqr::GivensRotations< Real > * Qgt
void test1()
Tests (a+b)*c.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich