You are here:
Concepts
>
Concepts Web
>
Class documentation
Class documentation of Concepts
Loading...
Searching...
No Matches
matfile
testsuite
matfileIOTest.hh
1
8
#ifndef matlabmatfiletest_hh
9
#define matlabmatfiletest_hh
10
11
#include "
matfile/matfileIO.hh
"
12
#include "
basics/testcase.hh
"
13
14
namespace
test
{
15
16
// ****************************************************** MatfileIOTest **
17
22
class
MatfileIOTest
:
public
TestCase
{
23
24
public
:
25
MatfileIOTest
() {};
26
27
virtual
~MatfileIOTest
() {
28
};
29
30
virtual
void
run
();
31
32
private
:
33
34
//##########################################################################
35
// basic routine section
36
//##########################################################################
37
41
void
testBasics_();
42
43
//##########################################################################
44
// add section
45
//##########################################################################
46
50
template
<
typename
F>
51
void
testAddSth_(F& obj);
52
56
template
<
typename
F,
typename
G>
57
void
testAddSthOtherCmp_(F& obj_F, G& obj_G);
58
59
//##########################################################################
60
// get section
61
//##########################################################################
62
66
void
testGetSth_();
67
68
//##################################################################################
69
// compare routines for all used data structures
70
//##################################################################################
71
72
template
<
class
F>
73
bool
isEqual_(
concepts::ElementMatrix<F>
& m1,
74
concepts::ElementMatrix<F>
& m2);
75
template
<
class
F>
76
bool
isEqual_(
concepts::SparseMatrix<F>
& m1,
concepts::SparseMatrix<F>
& m2);
77
template
<
class
F>
78
bool
isEqual_(
concepts::DiagonalMatrix<F>
& m1,
79
concepts::DiagonalMatrix<F>
& m2);
80
template
<
class
F>
81
bool
isEqual_(
concepts::Sequence<F>
& m1,
concepts::Sequence<F>
& m2);
82
template
<
class
F>
83
bool
isEqual_(
concepts::Vector<F>
& m1,
concepts::Vector<F>
& m2);
84
template
<
class
F>
85
bool
isEqual_(
concepts::Array<F>
& m1,
concepts::Array<F>
& m2);
86
bool
isEqual_(
concepts::Real
& m1,
concepts::Real
& m2);
87
bool
isEqual_(
concepts::Cmplx
& m1,
concepts::Cmplx
& m2);
88
89
//this is in hh file since it is not apriory clear what dims the mapping could have if there is a error
90
template
<
class
F, u
int
dim1, u
int
dim2>
91
bool
isEqual_(
concepts::Mapping<F, dim1>
& m1,
92
concepts::Mapping<F, dim2>
& m2) {
93
if
(dim1 != dim2) {
94
_fail
(
"Dimension fails"
);
95
return
false
;
96
}
97
for
(uint i = 0; i < dim1; i++)
98
for
(uint j = 0; j < dim1; j++)
99
if
(m1(i, j) != m2(i, j)) {
100
_fail
(
"Mapping entries differ"
);
101
return
false
;
102
}
103
return
true
;
104
}
105
106
template
<
class
F, u
int
dim1, u
int
dim2>
107
bool
isEqual_(
concepts::Point<F, dim1>
& m1,
concepts::Point<F, dim2>
& m2) {
108
if
(dim1 != dim2) {
109
_fail
(
"Dimension fails"
);
110
return
false
;
111
}
112
for
(uint i = 0; i < dim1; i++)
113
if
(m1[i] != m2[i]) {
114
_fail
(
"Point entries differ"
);
115
return
false
;
116
}
117
return
true
;
118
}
119
120
//##################################################################################
121
// create a octave matfile to read with MatfileIO
122
//##################################################################################
123
124
void
createMATfile()
const
;
125
126
//##########################################################################
127
// clear section
128
//##########################################################################
129
133
void
testClearAll_();
134
135
};
136
137
}
// namespace test
138
139
#endif
concepts::Array
Definition
array.hh:46
concepts::DiagonalMatrix
Definition
diagonal.hh:24
concepts::ElementMatrix
Definition
element.hh:206
concepts::Mapping
Definition
vectorsMatrices.hh:313
concepts::Point
Definition
vectorsMatrices.hh:46
concepts::Sequence
Definition
sequence.hh:39
concepts::SparseMatrix
Definition
sparseMatrix.hh:65
concepts::Vector
Definition
vector.hh:39
test::MatfileIOTest
Definition
matfileIOTest.hh:22
test::MatfileIOTest::run
virtual void run()
Runs the tests. Must be overwritten by the specialization.
test::TestCase
Definition
testcase.hh:92
matfileIO.hh
concepts::Real
double Real
Definition
typedefs.hh:39
concepts::Cmplx
std::complex< Real > Cmplx
Type for a complex number. It also depends on the setting of Real.
Definition
typedefs.hh:42
test
Definition
testcase.hh:66
testcase.hh
_fail
#define _fail(str)
Explicitly fails a test.
Definition
testcase.hh:82
Generated on Wed Sep 13 2023 21:06:22 for Concepts by
1.9.8