openGPMP
Open Source Mathematics Package
Functions | Variables
eigen.cpp File Reference
#include <iostream>
#include <openGPMP/linalg/eigen.hpp>
#include <vector>

Go to the source code of this file.

Functions

int main ()
 

Variables

const double TOLERANCE = 1e-3
 

Function Documentation

◆ main()

int main ( void  )

Definition at line 7 of file eigen.cpp.

7  {
8  std::vector<std::vector<double>> squareMat = {{2.0, -1.0, 0.0},
9  {-1.0, 2.0, -1.0},
10  {0.0, -1.0, 2.0}};
11  gpmp::linalg::Eigen eigenSquare(squareMat);
12 
13  double eigenvalueSquare = eigenSquare.power_iter(1000, TOLERANCE);
14 
15  std::cout << "Eigenvalue square: " << eigenvalueSquare << std::endl;
16 
17 }
Class for computing eigenvalues of a matrix.
Definition: eigen.hpp:45
const double TOLERANCE
Definition: eigen.cpp:5

References gpmp::linalg::Eigen::power_iter(), and TOLERANCE.

Variable Documentation

◆ TOLERANCE

const double TOLERANCE = 1e-3

Definition at line 5 of file eigen.cpp.

Referenced by main().