MCPcopy Create free account
hub / github.com/Derious/cuMPC / testMapRef

Function testMapRef

dependence/eigen-3.4.0/unsupported/test/matrix_function.cpp:181–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179
180template<typename MatrixType>
181void testMapRef(const MatrixType& A)
182{
183 // Test if passing Ref and Map objects is possible
184 // (Regression test for Bug #1796)
185 Index size = A.rows();
186 MatrixType X; X.setRandom(size, size);
187 MatrixType Y(size,size);
188 Ref< MatrixType> R(Y);
189 Ref<const MatrixType> Rc(X);
190 Map< MatrixType> M(Y.data(), size, size);
191 Map<const MatrixType> Mc(X.data(), size, size);
192
193 X = X*X; // make sure sqrt is possible
194 Y = X.sqrt();
195 R = Rc.sqrt();
196 M = Mc.sqrt();
197 Y = X.exp();
198 R = Rc.exp();
199 M = Mc.exp();
200 X = Y; // make sure log is possible
201 Y = X.log();
202 R = Rc.log();
203 M = Mc.log();
204
205 Y = X.cos() + Rc.cos() + Mc.cos();
206 Y = X.sin() + Rc.sin() + Mc.sin();
207
208 Y = X.cosh() + Rc.cosh() + Mc.cosh();
209 Y = X.sinh() + Rc.sinh() + Mc.sinh();
210}
211
212
213EIGEN_DECLARE_TEST(matrix_function)

Callers 1

EIGEN_DECLARE_TESTFunction · 0.85

Calls 9

cosMethod · 0.80
sinMethod · 0.80
coshMethod · 0.80
sinhMethod · 0.80
rowsMethod · 0.45
dataMethod · 0.45
sqrtMethod · 0.45
expMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected