//*********************************************************** // // NXV4 "Math-on-Paper" software // // package : MTX class _____________________________________ // // supports: move semantix // operators + - * / L,R-val context // += -= *= /= // fabs() // ~ - unary operators L,R-val // mtx i.e. int // float // double // real // cpx // cpx // cpx // cpx // type_casts between the types // cout << overload // // TOTAL = 5084 instantiated op/f's // _____________________________________ // // // authors : Mihai-Tiberiu Dima (1) // Maria Dima (2) // // Meshcheryakov Laboratory of Information Techn. // Joint Institute for Nuclear Research // Dubna-Russia // // on leave from: // // Hyperion Univ. Bucharest-Romania // // // date : MTX4/v1.0.alfa / Mon Mar 07 12:45:54 CET 2022 // //*********************************************************** #include #include #include "cpx.hh" #include "vec.hh" #include "mtx.hh" using namespace std ; using namespace cpx4 ; using namespace vec4 ; using namespace mtx4 ; int main() { // vec4::utf8x = true ; // mtx4::utf8x = true ; // this is a polymorphism example // // op = Lx + i*Ly // ^ ^ // |_dblx |_cpx // // to use this example do the following: // rm test.cc // ln -s e1.cc test.cc // make test // make run using fltx = float ; using dblx = double ; using real = long double ; double e = exp(1) ; double pi = 3.14159265853 ; cpx i(0,1) ; mtx Lx( 0, 0, 0, 0, 0, 1, 0,-1, 0 ) ; mtx Ly( 0, 0,-1, 0, 0, 0, 1, 0, 0 ) ; cout << endl ; cout << noboolalpha << endl ; cout << endl ; cout << " _____________________________________" << endl ; cout << endl ; cout << endl ; cout << endl ; cout << " " << boolalpha << Lx << " + " << i << "*" << Ly << endl << endl << endl ; cout << " = " << endl << endl << endl << endl ; cout << " " << Lx+i*Ly << endl ; cout << endl ; cout << endl ; cout << endl ; cout << " _____________________________________" << endl ; cout << endl ; cout << endl ; cout << endl ; }