Skip to content

Instantly share code, notes, and snippets.

/main.cpp Secret
Created Dec 18, 2016

Embed
What would you like to do?
#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
You can’t perform that action at this time.