KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The documentation says: ... in Eigen, vectors are just a special case of matrices, with either 1 row or 1 column. The case where they have 1 column is the most common; such vectors are called column-vectors, often abbreviated as just vectors. In the other case where they have 1 row, they are called row-vectors. However this program outputs unintuitive results: #include <eigen3/Eigen/Dense> #include <iostream> typedef Eigen::Matrix<double, 1, Eigen::Dynamic> RowVector; int main(int argc, char** argv) { RowVector row(10); std::cout << "Rows: " << row.rows() << std::endl; std::cout << "Columns: " << row.cols() << std::endl; row.transposeInPlace(); std::cout << "Rows: " << row.rows() << std::endl; std::cout << "Columns: " << row.cols() << std::endl; } Output: Rows: 1 Columns: 10 Rows: 1 Columns: 10 Is this a bug, or am I using the library incorrectly?
Tags (comma-separated)
Save Edits
Cancel