Skip to content

Instantly share code, notes, and snippets.

/main.cpp Secret

Created December 18, 2016 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/d57c835171b2068817b9f82493b43ea7 to your computer and use it in GitHub Desktop.
Save anonymous/d57c835171b2068817b9f82493b43ea7 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cmath>
#include <complex>
#include <omp.h>
#define EIGEN_RUNTIME_NO_MALLOC
#include <Eigen/Eigen>
typedef float Real;
typedef Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > MatrixR;
using namespace std;
int main()
{
omp_set_num_threads(4);
MatrixR c;
MatrixR a;
MatrixR b;
c.resize(500, 120);
a.resize(500, 280);
b.resize(280, 120);
a.setRandom();
b.setRandom();
Eigen::internal::set_is_malloc_allowed(false);
c.noalias() = a * b;
Eigen::internal::set_is_malloc_allowed(true);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment