update
This commit is contained in:
19
2025.09.28_cpp_openblas_test/openblas_test_wtih_eigen.cpp
Normal file
19
2025.09.28_cpp_openblas_test/openblas_test_wtih_eigen.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#define EIGEN_USE_BLAS
|
||||
#include <iostream>
|
||||
#include "Eigen/Dense" // #include <Eigen/Dense>
|
||||
|
||||
int main() {
|
||||
Eigen::MatrixXd A(4, 4);
|
||||
A << 2, 1, 1, 0,
|
||||
1, 3, 1, 1,
|
||||
1, 1, 4, 1,
|
||||
0, 1, 1, 5;
|
||||
|
||||
Eigen::MatrixXd A_inv = A.inverse();
|
||||
|
||||
std::cout << "A:\n" << A << std::endl;
|
||||
std::cout << "\nA_inv:\n" << A_inv << std::endl;
|
||||
std::cout << "\nA*A_inv:\n" << A * A_inv << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user