Skip to content

Instantly share code, notes, and snippets.

@kris-singh
Created December 3, 2019 14:40
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 kris-singh/fd13f1d3a5dfa4a575aaaad034efed39 to your computer and use it in GitHub Desktop.
Save kris-singh/fd13f1d3a5dfa4a575aaaad034efed39 to your computer and use it in GitHub Desktop.
# Path of eigen checked out from devlopement branch
cmake_minimum_required(VERSION 3.4)
project(Test)
set(CMAKE_CXX_FLAGS "-std=c++11")
include_directories(/Users/kris/Desktop/kmean/eigen-git-mirror)
add_executable(main eigen_example.cpp)
#include <algorithm>
#include <cmath>
#include <vector>
#include <iostream>
#include <Eigen/Core>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main(){
MatrixXf mat = MatrixXf::Random(3, 4);
cout << mat(all, {2}) << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment