function_taking_ref.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <Eigen/SVD>
3 using namespace Eigen;
4 using namespace std;
5 
7 {
8  const VectorXf sing_vals = a.jacobiSvd().singularValues();
9  return sing_vals(sing_vals.size()-1) / sing_vals(0);
10 }
11 
12 int main()
13 {
14  Matrix4f m = Matrix4f::Random();
15  cout << "matrix m:" << endl << m << endl << endl;
16  cout << "inv_cond(m): " << inv_cond(m) << endl;
17  cout << "inv_cond(m(1:3,1:3)): " << inv_cond(m.topLeftCorner(3,3)) << endl;
18  cout << "inv_cond(m+I): " << inv_cond(m+Matrix4f::Identity()) << endl;
19 }
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
main
int main()
Definition: function_taking_ref.cpp:12
inv_cond
float inv_cond(const Ref< const MatrixXf > &a)
Definition: function_taking_ref.cpp:6
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Eigen::Ref
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:281
std
Definition: BFloat16.h:88


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:33