Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9308001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:31:17+00:00 2026-06-19T00:31:17+00:00

The documentation says: … in Eigen, vectors are just a special case of matrices,

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:31:18+00:00Added an answer on June 19, 2026 at 12:31 am

    The documentation for transposeInPlace says:

    Note

    if the matrix is not square, then *this must be a resizable matrix.

    You’ll need your type to have both dynamic rows and columns:

    Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>
    

    However, there’s already a typedef for this: MatrixXd.

    Alternatively, if you still want the compile-time sizes, you can use tranpose rather than transposeInPlace to give you a new transposed matrix rather than modify the current one:

    typedef Eigen::Matrix<double, Eigen::Dynamic, 1> ColumnVector;
    ColumnVector column = row.transpose();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The official documentation says that Your application must have a local Service to facilitate
The official documentation says they are optional. I know COM interop requires a unique
Documentation says org.springframework.web.filter.OncePerRequestFilter guarantees to be just executed once per request . Under what
The documentation says nothing about possible return values. I have looked for the implementation
Documentation says it is a standalone component. Given I have following yaml parsed in
Documentation says that waypoints limit is 8 points. But I have to draw a
The documentation says that if I already have virtualenv installed, then pip is available
The documentation says: If you have a compound index on multiple fields, you can
Documentation says that waypoints limit is 8 points. But I have to calculate a
Documentation says Ohm lists are treated just like a Ruby array, but I see

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.