Essay record

C++: Get Size of Eigen::Matrix

Record
Essay / / 1 min read / 82 words
Tags
Unfiled

DISCLOSURE: Some links may be affiliate links. Details

**Problem: **I’m using the Eigen library in C++. I have a Matrix and want to check the size of it within my code. How can I do this?

**Solution: **The best way to go about this is to call the .rows() and .cols() functions on the Matrix. This will return the number of rows and columns in your matrix, respectively.

Here’s an example code snippet to show you how it might be implemented:

 

[https://gist.github.com/SIRHAMY/577f03949a048ede0fab]

Built with CloudSeed Rust