You are here:
Concepts
>
Concepts Web
>
Class documentation
Class documentation of Concepts
Loading...
Searching...
No Matches
operator
testsuite
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
"
15
#include "
sparseqr/givensRotations.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>
26
void
compare(
const
concepts::Matrix<F>
& a,
concepts::Operator<F>
& b);
27
};
28
29
// ****************************************************** CompositionsTest **
30
38
class
CompositionsTest
:
public
CompositionTestBase
{
39
public
:
41
CompositionsTest
();
42
virtual
~CompositionsTest
() {}
43
virtual
void
run
();
44
46
47
48
void
test1
();
50
void
test2
();
52
void
test3
();
54
void
test4
();
56
void
test5
();
58
private
:
59
//concepts::DummySpace<Real> spc;
60
uint dim;
61
concepts::SparseMatrix<Real>
a, b, c;
62
};
63
64
// ************************************************** MoreCompositionsTest **
65
73
class
MoreCompositionsTest
:
public
CompositionTestBase
{
74
public
:
76
MoreCompositionsTest
();
77
virtual
~MoreCompositionsTest
() {}
78
virtual
void
run
();
79
81
82
85
void
testPermutationConsistency
();
89
void
testTrivExtendRestrictConsistency
();
93
void
testCompositions
();
95
private
:
96
// concepts::DummySpace<Real> spc;
97
uint dim;
98
concepts::SparseMatrix<Real>
a;
99
};
100
101
// ************************************************** DeepCompositionsTest **
102
108
class
DeepCompositionsTest
:
public
CompositionTestBase
{
109
public
:
111
DeepCompositionsTest
();
112
virtual
~DeepCompositionsTest
() {}
113
virtual
void
run
();
114
void
createSparseQR();
115
117
118
void
testCompositions();
120
private
:
121
concepts::DummySpace<Real>
spc, cspc;
122
concepts::SparseMatrix<Real>
a, b, c;
123
std::unique_ptr<sparseqr::Driver> qr;
124
concepts::Permutation<Real>
* Pr;
125
std::unique_ptr<concepts::Permutation<Real> > Prt;
126
sparseqr::GivensRotations<Real>
* Qgt, * Qg;
127
concepts::TrivExtendRestrict<Real>
* ext, * restr;
128
std::unique_ptr<concepts::Compose<Real> > PrQgt, QgPrt, restrPrQgt,
129
QgPrtext, restrPrQgtA, restrPrQgtAQgPrtext, restrPrQgtM,
130
restrPrQgtMQgPrtext;
131
};
132
133
}
134
135
#endif
// testCompositions_hh
concepts::DummySpace
Definition
space.hh:373
concepts::Matrix
Definition
matrix.hh:39
concepts::Operator
Definition
compositions.hh:42
concepts::Permutation
Definition
permutation.hh:41
concepts::SparseMatrix
Definition
sparseMatrix.hh:65
concepts::TrivExtendRestrict
Definition
permutation.hh:110
sparseqr::GivensRotations
Definition
givensRotations.hh:32
test::CompositionTestBase
Definition
compositions.hh:23
test::CompositionsTest
Definition
compositions.hh:38
test::CompositionsTest::test3
void test3()
Tests a+b*c.
test::CompositionsTest::test5
void test5()
Tests a*b-c.
test::CompositionsTest::test2
void test2()
Tests a*(b+c)
test::CompositionsTest::test4
void test4()
Tests a*b+c.
test::CompositionsTest::CompositionsTest
CompositionsTest()
Constructor. Sets up three matrices a, b and c.
test::CompositionsTest::run
virtual void run()
Runs the tests. Must be overwritten by the specialization.
test::CompositionsTest::test1
void test1()
Tests (a+b)*c.
test::DeepCompositionsTest
Definition
compositions.hh:108
test::DeepCompositionsTest::DeepCompositionsTest
DeepCompositionsTest()
Constructor. Sets up a matrix a.
test::DeepCompositionsTest::run
virtual void run()
Runs the tests. Must be overwritten by the specialization.
test::MoreCompositionsTest
Definition
compositions.hh:73
test::MoreCompositionsTest::MoreCompositionsTest
MoreCompositionsTest()
Constructor. Sets up a matrix a.
test::MoreCompositionsTest::run
virtual void run()
Runs the tests. Must be overwritten by the specialization.
test::MoreCompositionsTest::testPermutationConsistency
void testPermutationConsistency()
test::MoreCompositionsTest::testTrivExtendRestrictConsistency
void testTrivExtendRestrictConsistency()
test::MoreCompositionsTest::testCompositions
void testCompositions()
test::TestCase
Definition
testcase.hh:92
driver.hh
givensRotations.hh
concepts::Real
double Real
Definition
typedefs.hh:39
test
Definition
testcase.hh:66
permutation.hh
testcase.hh
Generated on Wed Sep 13 2023 21:06:23 for Concepts by
1.9.8