首页 > 其他 > 详细

Eigen求矩阵行列式

时间:2018-05-18 22:06:35      阅读:544      评论:0      收藏:0      [点我收藏+]

转置、伴随、行列式、逆矩阵

小矩阵(4 * 4及以下)eigen会自动优化,默认采用LU分解,效率不高

#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
    Matrix2d c;
     c << 1, 2,
     3, 4;
    //转置、伴随
    std::cout<<c<<std::endl<<std::endl;
    std::cout<<"转置\n"<<c.transpose()<<std::endl<<std::endl;
    std::cout<<"伴随\n"<<c.adjoint()<<std::endl<<std::endl;
    //逆矩阵、行列式
    std::cout << "行列式: " << c.determinant() << std::endl;
    std::cout << "逆矩阵\n" << c.inverse() << std::endl;
}

有关eigen库的一些基本使用方法 - CSDN博客 https://blog.csdn.net/r1254/article/details/47418871

Eigen求矩阵行列式

原文:https://www.cnblogs.com/wxl845235800/p/9058051.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!