mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-06-20 00:06:55 +01:00
big project cleaning
This commit is contained in:
@ -9,19 +9,21 @@ using namespace Latan;
|
||||
int main(void)
|
||||
{
|
||||
AsciiFile F;
|
||||
DMat A,B;
|
||||
DMat A(2, 3), B(3, 2);
|
||||
const string fileName = "exMat.dat";
|
||||
|
||||
A << 1, 2, 3,
|
||||
4, 5, 6;
|
||||
|
||||
B << 1.0, 2.5,
|
||||
4.5, 8.9,
|
||||
1.2, 3.5;
|
||||
|
||||
// read
|
||||
cout << "-- reading " << fileName << "..." << endl;
|
||||
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 << "cos(A)=\n" << A.unaryExpr(StdMath::cos) << '\n' << endl;
|
||||
F.close();
|
||||
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;
|
||||
|
||||
// write
|
||||
cout << "-- saving A*B..." << endl;
|
||||
|
@ -1,20 +0,0 @@
|
||||
#L latan_begin mat A
|
||||
2
|
||||
2.3 5
|
||||
4.5 -1.15281
|
||||
#L latan_end mat
|
||||
|
||||
#L latan_begin mat B
|
||||
3
|
||||
1.1
|
||||
1.2
|
||||
1.3
|
||||
2
|
||||
2.2
|
||||
2.3
|
||||
#L latan_end mat
|
||||
#L latan_begin mat AB
|
||||
3
|
||||
12.53 13.76 14.49
|
||||
2.64438 2.86382 3.19854
|
||||
#L latan_end mat
|
Reference in New Issue
Block a user