#include <iostream>
#include <cstdlib>
#include <ctime>
#include "cppscalapack.h"
#include "cppscalapack_init.h"
using namespace std;
int main(int argc, char** argv)
{
srand(time(NULL));
const int M(4), N(3);
CPPSL::initialize(argc,argv, 2,4, 64,64);
CPPSL::dgematrix A(M,N);
for(int i=0; i<A.m; i++){ for(int j=0; j<A.n; j++){
A(i,j) =double(rand()/(RAND_MAX/10));
}}
CPPSL::cout << "A =\n" << A << endl;
for(int i=0; i<A.m; i++){ for(int j=0; j<A.n; j++){
CPPSL::cout << "A(" << i << "," << j << ") =" << A(i,j) << endl;
}}
CPPSL::dgematrix B(A);
CPPSL::cout << "B =\n" << B << endl;
for(int i=0; i<B.m; i++){ for(int j=0; j<B.n; j++){
CPPSL::cout << "B(" << i << "," << j << ") =" << B(i,j) << endl;
}}
CPPSL::cout << "A+B=\n" << A+B << endl;
CPPSL::finalize();
return 0;
}