#include <complex> #include <cmath> #include <cstdio> #include "bench.h" int main() { bench::WallTime<double> wallTime; // // Initialize a matrix of doubles // wallTime.tic(); double *A = new double[1000*1000]; bench::initMatrix(1000, 1000, A, 1, 1000); delete [] A; std::printf("time elapsed: %lf\n", wallTime.toc()); // // Initialize a matrix of complex doubles // wallTime.tic(); std::complex<double> *B = new std::complex<double>[1000*1000]; bench::initMatrix(1000, 1000, B, 1, 1000); delete [] B; std::printf("time elapsed: %lf\n", wallTime.toc()); } |