mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 00:45:36 +00:00
improvement of matrix example
This commit is contained in:
parent
6f474ede7b
commit
9484934a8a
@ -1,6 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <latan/Io.hpp>
|
||||
#include <latan/Mat.hpp>
|
||||
#include <latan/Math.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace Latan;
|
||||
@ -16,15 +17,16 @@ int main(void)
|
||||
F.open(fileName, File::Mode::read);
|
||||
A = F.read<DMat>("A");
|
||||
B = F.read<DMat>("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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user