mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
get rid of using namespace Eigen in sample code
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
e4c40b092a
commit
39a6aff16c
@@ -1,8 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
using namespace std;
|
||||
using namespace Eigen;
|
||||
using Eigen::MatrixXd;
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -10,5 +9,5 @@ int main()
|
||||
MatrixXd b = MatrixXd::Random(100,50);
|
||||
MatrixXd x = A.fullPivLu().solve(b);
|
||||
double relative_error = (A*x - b).norm() / b.norm(); // norm() is L2 norm
|
||||
cout << "The relative error is:\n" << relative_error << endl;
|
||||
std::cout << "The relative error is:\n" << relative_error << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user