aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/doc
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-02-16 16:43:11 +0000
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-02-16 16:43:11 +0000
commit319bf3130b1257856408b0481401f7c353f97470 (patch)
tree44c16e180c745b600ec5f2c93903125217e51d20 /unsupported/doc
parent25019f08366a027e783617b4b8bd86f00237a5ee (diff)
Use ReturnByValue to return result of ei_matrix_function(), ...
Diffstat (limited to 'unsupported/doc')
-rw-r--r--unsupported/doc/examples/MatrixFunction.cpp7
-rw-r--r--unsupported/doc/examples/MatrixSine.cpp6
-rw-r--r--unsupported/doc/examples/MatrixSinh.cpp6
3 files changed, 7 insertions, 12 deletions
diff --git a/unsupported/doc/examples/MatrixFunction.cpp b/unsupported/doc/examples/MatrixFunction.cpp
index c11cb821b..075fe7361 100644
--- a/unsupported/doc/examples/MatrixFunction.cpp
+++ b/unsupported/doc/examples/MatrixFunction.cpp
@@ -15,9 +15,8 @@ int main()
A << 0, -pi/4, 0,
pi/4, 0, 0,
0, 0, 0;
- std::cout << "The matrix A is:\n" << A << "\n\n";
- MatrixXd B;
- ei_matrix_function(A, expfn, &B);
- std::cout << "The matrix exponential of A is:\n" << B << "\n\n";
+ std::cout << "The matrix A is:\n" << A << "\n\n";
+ std::cout << "The matrix exponential of A is:\n"
+ << ei_matrix_function(A, expfn) << "\n\n";
}
diff --git a/unsupported/doc/examples/MatrixSine.cpp b/unsupported/doc/examples/MatrixSine.cpp
index f8780ac92..2bbf99bbb 100644
--- a/unsupported/doc/examples/MatrixSine.cpp
+++ b/unsupported/doc/examples/MatrixSine.cpp
@@ -7,12 +7,10 @@ int main()
MatrixXd A = MatrixXd::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
- MatrixXd sinA;
- ei_matrix_sin(A, &sinA);
+ MatrixXd sinA = ei_matrix_sin(A);
std::cout << "sin(A) = \n" << sinA << "\n\n";
- MatrixXd cosA;
- ei_matrix_cos(A, &cosA);
+ MatrixXd cosA = ei_matrix_cos(A);
std::cout << "cos(A) = \n" << cosA << "\n\n";
// The matrix functions satisfy sin^2(A) + cos^2(A) = I,
diff --git a/unsupported/doc/examples/MatrixSinh.cpp b/unsupported/doc/examples/MatrixSinh.cpp
index 488d95652..036534dea 100644
--- a/unsupported/doc/examples/MatrixSinh.cpp
+++ b/unsupported/doc/examples/MatrixSinh.cpp
@@ -7,12 +7,10 @@ int main()
MatrixXf A = MatrixXf::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
- MatrixXf sinhA;
- ei_matrix_sinh(A, &sinhA);
+ MatrixXf sinhA = ei_matrix_sinh(A);
std::cout << "sinh(A) = \n" << sinhA << "\n\n";
- MatrixXf coshA;
- ei_matrix_cosh(A, &coshA);
+ MatrixXf coshA = ei_matrix_cosh(A);
std::cout << "cosh(A) = \n" << coshA << "\n\n";
// The matrix functions satisfy cosh^2(A) - sinh^2(A) = I,