Created
April 23, 2018 05:03
-
-
Save jefftrull/d3f9e6594983d92412b8d35857c619d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// demonstrating use of Eigen::Map | |
#include <iostream> | |
#include <vector> | |
#include <Eigen/Dense> | |
int main() { | |
using namespace Eigen; | |
std::vector<float> foo{1.0, 2.0, 3.0, 4.0}; | |
Map<Matrix<float, Dynamic, 1>> foom(foo.data(), foo.size()); | |
IOFormat OctaveFmt(StreamPrecision, 0, ", ", ";\n", "", "", "[", "]"); | |
std::cout << "foo as row vector=\n" << foom.format(OctaveFmt) << "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment