30 #include <Eigen/Dense> 31 #include <Eigen/Eigenvalues> 36 using namespace gtsam;
49 0.2465342).finished();
55 const double ritzValue = actual1.dot(A * actual1);
56 const double ritzResidual = (A * actual1 - ritzValue * actual1).norm();
59 const double ev1 = 6.0;
86 const double ritzValue = actual2.dot(
L.first * actual2);
87 const double ritzResidual = (
L.first * actual2 - ritzValue * actual2).norm();
114 const double ritzValue = actual2.dot(
L.first * actual2);
115 const double ritzResidual = (
L.first * actual2 - ritzValue * actual2).norm();
static int runAllTests(TestResult &result)
GaussianFactorGraph createSparseGraph()
Create sparse and dense factor graph for PowerMethod/AcceleratedPowerMethod.
bool compute(size_t maxIterations, double tol)
BiCGSTAB< SparseMatrix< double > > solver
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
Power method for fast eigenvalue and eigenvector computation.
Compute maximum Eigenpair with power method.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Linear Factor Graph where all factors are Gaussians.
std::pair< Matrix, Vector > hessian(const Ordering &ordering) const
double eigenvalue() const
Return the eigenvalue.
Scalar & coeffRef(Index row, Index col)
#define EXPECT_LONGS_EQUAL(expected, actual)
TEST(PowerMethod, powerIteration)
GaussianFactorGraph createDenseGraph()
const EigenvalueType & eigenvalues() const
Returns the eigenvalues of given matrix.
Computes eigenvalues and eigenvectors of general matrices.
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Vector eigenvector() const
Return the eigenvector.