aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/matrix_function.cpp
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-02-15 19:17:25 +0000
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-02-15 19:17:25 +0000
commit25019f08366a027e783617b4b8bd86f00237a5ee (patch)
treef05aa65b727534496381b199b5c13be9f0798dcd /unsupported/test/matrix_function.cpp
parenta9096b626bc5aba2b9a6175d60bfd06fca8fa37a (diff)
Use ReturnByValue to return result of ei_matrix_exponential() .
Diffstat (limited to 'unsupported/test/matrix_function.cpp')
-rw-r--r--unsupported/test/matrix_function.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/unsupported/test/matrix_function.cpp b/unsupported/test/matrix_function.cpp
index de63937ad..25134f21d 100644
--- a/unsupported/test/matrix_function.cpp
+++ b/unsupported/test/matrix_function.cpp
@@ -100,10 +100,9 @@ void testMatrixExponential(const MatrixType& A)
typedef std::complex<RealScalar> ComplexScalar;
for (int i = 0; i < g_repeat; i++) {
- MatrixType expA1, expA2;
- ei_matrix_exponential(A, &expA1);
- ei_matrix_function(A, StdStemFunctions<ComplexScalar>::exp, &expA2);
- VERIFY_IS_APPROX(expA1, expA2);
+ MatrixType expA;
+ ei_matrix_function(A, StdStemFunctions<ComplexScalar>::exp, &expA);
+ VERIFY_IS_APPROX(ei_matrix_exponential(A), expA);
}
}
@@ -111,10 +110,10 @@ template<typename MatrixType>
void testHyperbolicFunctions(const MatrixType& A)
{
for (int i = 0; i < g_repeat; i++) {
- MatrixType sinhA, coshA, expA;
+ MatrixType sinhA, coshA;
ei_matrix_sinh(A, &sinhA);
ei_matrix_cosh(A, &coshA);
- ei_matrix_exponential(A, &expA);
+ MatrixType expA = ei_matrix_exponential(A);
VERIFY_IS_APPROX(sinhA, (expA - expA.inverse())/2);
VERIFY_IS_APPROX(coshA, (expA + expA.inverse())/2);
}
@@ -136,8 +135,7 @@ void testGonioFunctions(const MatrixType& A)
for (int i = 0; i < g_repeat; i++) {
ComplexMatrix Ac = A.template cast<ComplexScalar>();
- ComplexMatrix exp_iA;
- ei_matrix_exponential(imagUnit * Ac, &exp_iA);
+ ComplexMatrix exp_iA = ei_matrix_exponential(imagUnit * Ac);
MatrixType sinA;
ei_matrix_sin(A, &sinA);