标签:ant \n space c++ std stream nan int() 逆矩阵
使用eigen库:
#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; }
标签:ant \n space c++ std stream nan int() 逆矩阵
原文地址:https://www.cnblogs.com/wxl845235800/p/9027005.html