function_taking_ref.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/SVD>
3 
5 {
6  const Eigen::VectorXf sing_vals = a.jacobiSvd().singularValues();
7  return sing_vals(sing_vals.size()-1) / sing_vals(0);
8 }
9 
10 int main()
11 {
13  std::cout << "matrix m:\n" << m << "\n\n";
14  std::cout << "inv_cond(m): " << inv_cond(m) << "\n";
15  std::cout << "inv_cond(m(1:3,1:3)): " << inv_cond(m.topLeftCorner(3,3)) << "\n";
16  std::cout << "inv_cond(m+I): " << inv_cond(m+Eigen::MatrixXf::Identity(4, 4)) << "\n";
17 }
Matrix3f m
static const RandomReturnType Random()
Definition: Random.h:114
EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition: EigenBase.h:69
static const IdentityReturnType Identity()
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:285
float inv_cond(const Eigen::Ref< const Eigen::MatrixXf > &a)
int main()