Simple usage of Eigen

Source: Internet
Author: User

The "<<" operator is overloaded in Eigen, and can be assigned either as an element or as a piece of value.

The number of rows, columns, and sizes of the current matrix can be obtained by rows (), cols () and size (), and the size of the matrix can be dynamically modified by the resize () function for the dynamic matrix.be aware that:(1) a fixed-size matrix cannot use resize () to modify the size of the matrix; (2) The resize () function will deconstruct the original data, so calling the resize () function does not guarantee that the value of the element will not change.
(3) when using the "=" operator to manipulate a dynamic matrix, the size of the left-hand dynamic matrix will be modified to the right size if the left-and side-edge matrix is of unequal size. For example, the following code snippet:
MATRIXXF A (2,2); Std::cout << "A is of size" << a.rows () << "x" << a.cols () << Std::endl; MATRIXXF b (3,3); a = B;std::cout << "A is now of size" << a.rows () << "x" << a.cols () << std :: Endl;

the rank, conjugate matrix and adjoint matrix of the matrix are obtained.

can be passed ,&NBSP; conjugate () Transposeinplace ()  ,  adjointinplace ()  .

MATRIXXCF a = Matrixxcf::random (2,2) cout << "Here's The Matrix a\n" << a << endl;cout << "Here I s The Matrix a^t\n "<< a.transpose () << endl;cout <<" Here is the conjugate of a\n "<< a.conjugate () << endl;cout << "Here is the Matrix a^*\n" << a.adjoint () << Endl;


Simple usage of Eigen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.