From 9484934a8afc49f74d0a343c4ed95f88633b8c2f Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Wed, 12 Feb 2014 18:35:18 +0000 Subject: [PATCH] improvement of matrix example --- examples/exMat.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/exMat.cpp b/examples/exMat.cpp index c347360..589e92b 100644 --- a/examples/exMat.cpp +++ b/examples/exMat.cpp @@ -1,6 +1,7 @@ #include #include #include +#include using namespace std; using namespace Latan; @@ -16,15 +17,16 @@ int main(void) F.open(fileName, File::Mode::read); A = F.read("A"); B = F.read("B"); - cout << "A=\n" << A << '\n' << endl; - cout << "B=\n" << B << '\n' << endl; - cout << "A*B=\n" << A*B << '\n' << endl; + cout << "A=\n" << A << '\n' << endl; + cout << "B=\n" << B << '\n' << endl; + cout << "A*B=\n" << A*B << '\n' << endl; + cout << "cos(A)=\n" << A.unaryExpr(StdMath::cos) << '\n' << endl; F.close(); // write cout << "-- saving A*B..." << endl; F.open(fileName, File::Mode::append); - F.save((A*B).eval(), "AB"); + F.save(A*B, "AB"); return EXIT_SUCCESS; }