// -*- c++ -*- // // $COPYRIGHT$ // //=========================================================================== #include #include using namespace mtl; using namespace std; int main() { const int M = 4, N = 3; //begin typedef matrix< double, rectangle<>, array< dense<> >, row_major>::type MatA; typedef matrix< double, rectangle<>, array< compressed<> >, row_major>::type MatB; typedef matrix< double, rectangle<>, array< sparse_pair >, row_major>::type MatC; cout << "start" << endl; MatA A(M,N); MatB B(M,N); MatC C(M, N); // Fill A ... //end for (int i = 0; i < M; ++i) for (int j = 0; j < N; ++j) A(i,j) = i * N + j; //begin mtl::copy(A, B); // JGS, this is broken! #if 0 MatB::Row tmp = B[2]; B[2] = B[3]; B[3] = tmp; mtl::copy(B, C); //end #endif mtl::print_all_matrix(A); mtl::print_all_matrix(B); mtl::print_all_matrix(C); return 0; }