Go to the documentation of this file.00001
00002
00003
00007
00008 #define WANT_STREAM // include iostream and iomanipulators
00009
00010 #include "newmatap.h"
00011
00012
00013
00014
00015 #include "newmatio.h"
00016
00017 #ifdef use_namespace
00018 using namespace RBD_LIBRARIES;
00019 #endif
00020
00021
00022 int my_main()
00023 {
00024 Tracer tr("my_main ");
00025
00026
00027 Matrix X(4,4);
00028
00029
00030 X.row(1) << 3.7 << -2.1 << 7.4 << -1.0;
00031 X.row(2) << 4.1 << 0.0 << 3.9 << 4.0;
00032 X.row(3) << -2.5 << 1.9 << -0.4 << 7.3;
00033 X.row(4) << 1.5 << 9.8 << -2.1 << 1.1;
00034
00035
00036 cout << "Matrix X" << endl;
00037 cout << setw(15) << setprecision(8) << X << endl;
00038
00039
00040 Matrix Y = X.i();
00041 cout << "Inverse of X" << endl;
00042 cout << setw(15) << setprecision(8) << Y << endl;
00043
00044
00045 cout << "X * inverse of X" << endl;
00046 cout << setw(15) << setprecision(8) << (X * Y) << endl;
00047
00048 return 0;
00049 }
00050
00051
00052
00053
00054 int main()
00055 {
00056 Try { return my_main(); }
00057 Catch(BaseException) { cout << BaseException::what() << "\n"; }
00058 CatchAll { cout << "\nProgram fails - exception generated\n\n"; }
00059 return 0;
00060 }
00061
00063