轉置、伴隨、行列式、逆矩陣
小矩陣(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
行列式的本質:行列式的本質是什么? - 知乎 https://www.zhihu.com/question/36966326/answer/70687817
