// smatrix_t.cpp #include "smatrix.h" #include #include #include using std::cout; using std::cerr; using std::endl; using std::string; //********************************************************************** int main( ) { string component = "smatrix"; string ok_prefix = component + " (I): "; string error_prefix = component + " test (E): "; cout << ok_prefix << "---------- Testing component " + component + ". ----------" << endl; // Make sure assert is enabled. bool assert_flag = false; assert ( ( assert_flag = true, assert_flag ) ); if ( ! assert_flag ) { cerr << "Assert is disabled" << endl; return 1; } //******************************************************************** smatrix sma(3); sma(0,0) = 0.0; sma(1,0) = 1.0; sma(1,1) = 1.1; sma(2,0) = 2.0; sma(2,1) = 2.1; sma(2,2) = 2.2; cout << trf::trf_format; cout << sma << endl; smatrix nsma(sma); normalize(nsma); cout << nsma << endl; //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }